#![allow(warnings, unconditional_panic)]
#![allow(nonstandard_style)]
#![cfg_attr(any(), rustfmt::skip)]
/// Flattens all imported externs so that they can be accessed from this module
pub mod _dafny_externs {
    pub use crate::aes_gcm::*;
    pub use crate::aes_kdf_ctr::*;
    pub use crate::concurrent_call::*;
    pub use crate::dafny_libraries::*;
    pub use crate::ddb::*;
    pub use crate::digest::*;
    pub use crate::ecdh::*;
    pub use crate::ecdsa::*;
    pub use crate::hmac::*;
    pub use crate::kms::*;
    pub use crate::local_cmc::*;
    pub use crate::oslang::*;
    pub use crate::random::*;
    pub use crate::rsa::*;
    pub use crate::sets::*;
    pub use crate::software_externs::*;
    pub use crate::storm_tracker::*;
    pub use crate::time::*;
    pub use crate::uuid::*;
}

pub mod _module {

}
/// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(6,1)
pub mod AESEncryption {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::OpaqueError;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(21,3)
        pub fn EncryptionOutputFromByteSeq(s: &Sequence<u8>, encAlg: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM>) -> Arc<AESEncryptOutput> {
            let mut pivot_point: u64 = truncate!(s.cardinality(), u64) - encAlg.tagLength().clone() as u64;
            let mut cipherText: Sequence<u8> = s.take(&int!((&pivot_point).clone()));
            let mut authTag: Sequence<u8> = s.drop(&int!((&pivot_point).clone()));
            Arc::new(AESEncryptOutput::AESEncryptOutput {
                    cipherText: cipherText.clone(),
                    authTag: authTag.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(51,3)
        pub fn AESEncrypt(input: &Arc<AESEncryptInput>) -> Arc<Result<Arc<AESEncryptOutput>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<AESEncryptOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(input.iv().cardinality(), u64) == input.encAlg().ivLength().clone() as u64 && truncate!(input.key().cardinality(), u64) == input.encAlg().keyLength().clone() as u64, &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("Request does not match algorithm.")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<AESEncryptOutput>>());
                return res.read();
            };
            let mut __let_tmp_rhs0: Arc<AESEncryptInput> = input.clone();
            let mut encAlg: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM> = __let_tmp_rhs0.encAlg().clone();
            let mut iv: Sequence<u8> = __let_tmp_rhs0.iv().clone();
            let mut key: Sequence<u8> = __let_tmp_rhs0.key().clone();
            let mut msg: Sequence<u8> = __let_tmp_rhs0.msg().clone();
            let mut aad: Sequence<u8> = __let_tmp_rhs0.aad().clone();
            let mut valueOrError1: Arc<Result<Arc<AESEncryptOutput>, OpaqueError>>;
            let mut _out0: Arc<Result<Arc<AESEncryptOutput>, OpaqueError>> = crate::implementation_from_dafny::_dafny_externs::AESEncryption::AES_GCM::AESEncryptExtern(&encAlg, &iv, &key, &msg, &aad);
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<AESEncryptOutput>>());
                return res.read();
            };
            let mut value: Arc<AESEncryptOutput> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(value.cipherText().cardinality(), u64) == truncate!(msg.cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("AESEncrypt did not return cipherText of expected length")
                        }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<AESEncryptOutput>>());
                return res.read();
            };
            let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(value.authTag().cardinality(), u64) == encAlg.tagLength().clone() as u64, &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("AESEncryption did not return valid tag")
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<AESEncryptOutput>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<Arc<AESEncryptOutput>, Arc<Error>>::Success {
                            value: value.clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(105,3)
        pub fn AESDecrypt(input: &Arc<AESDecryptInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(input.key().cardinality(), u64) == input.encAlg().keyLength().clone() as u64 && truncate!(input.iv().cardinality(), u64) == input.encAlg().ivLength().clone() as u64 && truncate!(input.authTag().cardinality(), u64) == input.encAlg().tagLength().clone() as u64, &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("Request does not match algorithm.")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut __let_tmp_rhs0: Arc<AESDecryptInput> = input.clone();
            let mut encAlg: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM> = __let_tmp_rhs0.encAlg().clone();
            let mut key: Sequence<u8> = __let_tmp_rhs0.key().clone();
            let mut cipherTxt: Sequence<u8> = __let_tmp_rhs0.cipherTxt().clone();
            let mut authTag: Sequence<u8> = __let_tmp_rhs0.authTag().clone();
            let mut iv: Sequence<u8> = __let_tmp_rhs0.iv().clone();
            let mut aad: Sequence<u8> = __let_tmp_rhs0.aad().clone();
            let mut valueOrError1: Arc<Result<Sequence<u8>, OpaqueError>>;
            let mut _out0: Arc<Result<Sequence<u8>, OpaqueError>> = crate::implementation_from_dafny::_dafny_externs::AESEncryption::AES_GCM::AESDecryptExtern(&encAlg, &key, &cipherTxt, &authTag, &iv, &aad);
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut value: Sequence<u8> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(cipherTxt.cardinality(), u64) == truncate!(value.cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("AESDecrypt did not return plaintext of expected length")
                        }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: value.clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(142,3)
        pub fn CreateAESEncryptExternSuccess(output: &Arc<AESEncryptOutput>) -> Arc<Result<Arc<AESEncryptOutput>, OpaqueError>> {
            Arc::new(Result::<Arc<AESEncryptOutput>, OpaqueError>::Success {
                    value: output.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(146,3)
        pub fn CreateAESEncryptExternFailure(error: &OpaqueError) -> Arc<Result<Arc<AESEncryptOutput>, OpaqueError>> {
            Arc::new(Result::<Arc<AESEncryptOutput>, OpaqueError>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(150,3)
        pub fn CreateAESDecryptExternSuccess(bytes: &Sequence<u8>) -> Arc<Result<Sequence<u8>, OpaqueError>> {
            Arc::new(Result::<Sequence<u8>, OpaqueError>::Success {
                    value: bytes.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AESEncryption.dfy(154,3)
        pub fn CreateAESDecryptExternFailure(error: &OpaqueError) -> Arc<Result<Sequence<u8>, OpaqueError>> {
            Arc::new(Result::<Sequence<u8>, OpaqueError>::Failure {
                    error: error.clone()
                })
        }
    }
}
/// ../mpl/StandardLibrary/src/Actions.dfy(7,1)
pub mod _Actions_Compile {
    pub use ::dafny_runtime::DafnyType;
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::int;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use ::dafny_runtime::Any;
    pub use ::dafny_runtime::UpcastObject;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/Actions.dfy(110,3)
        pub fn DeterministicMap<_A: DafnyType, _R: DafnyType>(action: &Object<dyn DeterministicAction<_A, _R>>, s: &Sequence<_A>) -> Sequence<_R> {
            let mut res = MaybePlacebo::<Sequence<_R>>::new();
            let mut rs: Sequence<_R> = seq![] as Sequence<_R>;
            let mut _hi0: u64 = truncate!(s.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut r: _R;
                let mut _out0: _R = DeterministicAction::<_A, _R>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone())));
                r = _out0.clone();
                rs = rs.concat(&seq![r.clone()]);
            }
            res = MaybePlacebo::from(rs.clone());
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Actions.dfy(140,3)
        pub fn DeterministicMapWithResult<_A: DafnyType, _R: DafnyType, _E: DafnyType>(action: &Object<dyn DeterministicActionWithResult<_A, _R, _E>>, s: &Sequence<_A>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<_R>, _E>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<_R>, _E>>>::new();
            let mut rs: Sequence<_R> = seq![] as Sequence<_R>;
            let mut _hi0: u64 = truncate!(s.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_R, _E>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_R, _E>> = DeterministicAction::<_A, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_R, _E>>>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone())));
                valueOrError0 = _out0.clone();
                if valueOrError0.IsFailure() {
                    res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<_R>>());
                    return res.read();
                };
                let mut r: _R = valueOrError0.Extract();
                rs = rs.concat(&seq![r.clone()]);
            }
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<_R>, _E>::Success {
                            value: rs.clone()
                        }));
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Actions.dfy(178,3)
        pub fn DeterministicFlatMap<_A: DafnyType, _R: DafnyType>(action: &Object<dyn DeterministicAction<_A, Sequence<_R>>>, s: &Sequence<_A>) -> Sequence<_R> {
            let mut res = MaybePlacebo::<Sequence<_R>>::new();
            let mut rs: Sequence<_R> = seq![] as Sequence<_R>;
            let mut _hi0: u64 = truncate!(s.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut r: Sequence<_R>;
                let mut _out0: Sequence<_R> = DeterministicAction::<_A, Sequence<_R>>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone())));
                r = _out0.clone();
                rs = rs.concat(&r);
            }
            res = MaybePlacebo::from(rs.clone());
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Actions.dfy(215,3)
        pub fn DeterministicFlatMapWithResult<_A: DafnyType, _R: DafnyType, _E: DafnyType>(action: &Object<dyn DeterministicActionWithResult<_A, Sequence<_R>, _E>>, s: &Sequence<_A>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<_R>, _E>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<_R>, _E>>>::new();
            let mut rs: Sequence<_R> = seq![] as Sequence<_R>;
            let mut _hi0: u64 = truncate!(s.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<_R>, _E>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<_R>, _E>> = DeterministicAction::<_A, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<_R>, _E>>>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone())));
                valueOrError0 = _out0.clone();
                if valueOrError0.IsFailure() {
                    res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<_R>>());
                    return res.read();
                };
                let mut r: Sequence<_R> = valueOrError0.Extract();
                rs = rs.concat(&r);
            }
            let mut _rhs0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<_R>, _E>> = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<_R>, _E>::Success {
                        value: rs.clone()
                    });
            res = MaybePlacebo::from(_rhs0.clone());
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Actions.dfy(256,3)
        pub fn Filter<_A: DafnyType>(action: &Object<dyn DeterministicAction<_A, bool>>, s: &Sequence<_A>) -> Sequence<_A> {
            let mut res = MaybePlacebo::<Sequence<_A>>::new();
            let mut rs: Sequence<_A> = seq![] as Sequence<_A>;
            let mut _hi0: u64 = truncate!(s.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut r: bool;
                let mut _out0: bool = DeterministicAction::<_A, bool>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone())));
                r = _out0;
                if r {
                    rs = rs.concat(&seq![s.get(&int!((&i).clone()))]);
                }
            }
            res = MaybePlacebo::from(rs.clone());
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Actions.dfy(290,3)
        pub fn FilterWithResult<_A: DafnyType, _E: DafnyType>(action: &Object<dyn DeterministicActionWithResult<_A, bool, _E>>, s: &Sequence<_A>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<_A>, _E>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<_A>, _E>>>::new();
            let mut rs: Sequence<_A> = seq![] as Sequence<_A>;
            let mut _hi0: u64 = truncate!(s.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, _E>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, _E>> = DeterministicAction::<_A, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, _E>>>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone())));
                valueOrError0 = _out0.clone();
                if valueOrError0.IsFailure() {
                    res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<_A>>());
                    return res.read();
                };
                let mut r: bool = valueOrError0.Extract();
                if r {
                    rs = rs.concat(&seq![s.get(&int!((&i).clone()))]);
                }
            }
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<_A>, _E>::Success {
                            value: rs.clone()
                        }));
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Actions.dfy(330,3)
        pub fn ReduceToSuccess<_A: DafnyType, _B: DafnyType, _E: DafnyType>(action: &Object<dyn ActionWithResult<_A, _B, _E>>, s: &Sequence<_A>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, Sequence<_E>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, Sequence<_E>>>>::new();
            let mut attemptedResults: Sequence<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, _E>>> = seq![] as Sequence<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, _E>>>;
            let mut _hi0: u64 = truncate!(s.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut attempt: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, _E>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, _E>> = Action::<_A, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, _E>>>::Invoke(rd!(action.clone()), &s.get(&int!((&i).clone())));
                attempt = _out0.clone();
                attemptedResults = attemptedResults.concat(&seq![attempt.clone()]);
                if matches!((&attempt).as_ref(), Success{ .. }) {
                    let mut _rhs0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, Sequence<_E>>> = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<_B, Sequence<_E>>::Success {
                                value: attempt.value().clone()
                            });
                    res = MaybePlacebo::from(_rhs0.clone());
                    return res.read();
                }
            }
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<_B, Sequence<_E>>::Failure {
                            error: crate::implementation_from_dafny::_Seq_Compile::_default::Map::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, _E>>, _E>(&(Arc::new(move |x0: &Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, _E>>| _default::pluckErrors(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>), &attemptedResults)
                        }));
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Actions.dfy(394,3)
        pub fn pluckErrors<_B: DafnyType, _E: DafnyType>(r: &Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<_B, _E>>) -> _E {
            r.error().clone()
        }
    }

    /// ../mpl/StandardLibrary/src/Actions.dfy(14,3)
    #[derive(PartialEq, Clone)]
    pub enum ActionInvoke<A: DafnyType, R: DafnyType> {
        ActionInvoke {
            input: A,
            output: R
        }
    }

    impl<A: DafnyType, R: DafnyType> ActionInvoke<A, R> {
        /// Returns a borrow of the field input
        pub fn input(&self) -> &A {
            match self {
                ActionInvoke::ActionInvoke{input, output, } => input,
            }
        }
        /// Returns a borrow of the field output
        pub fn output(&self) -> &R {
            match self {
                ActionInvoke::ActionInvoke{input, output, } => output,
            }
        }
    }

    impl<A: DafnyType, R: DafnyType> Debug
        for ActionInvoke<A, R> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<A: DafnyType, R: DafnyType> DafnyPrint
        for ActionInvoke<A, R> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                ActionInvoke::ActionInvoke{input, output, } => {
                    write!(_formatter, "Actions_Compile.ActionInvoke.ActionInvoke(")?;
                    DafnyPrint::fmt_print(input, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(output, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<A: DafnyType + Eq, R: DafnyType + Eq> Eq
        for ActionInvoke<A, R> {}

    impl<A: DafnyType + Hash, R: DafnyType + Hash> Hash
        for ActionInvoke<A, R> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                ActionInvoke::ActionInvoke{input, output, } => {
                    Hash::hash(input, _state);
                    Hash::hash(output, _state)
                },
            }
        }
    }

    impl<A: DafnyType + Default, R: DafnyType + Default> Default
        for ActionInvoke<A, R> {
        fn default() -> ActionInvoke<A, R> {
            ActionInvoke::ActionInvoke {
                input: Default::default(),
                output: Default::default()
            }
        }
    }

    impl<A: DafnyType, R: DafnyType> AsRef<ActionInvoke<A, R>>
        for ActionInvoke<A, R> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/StandardLibrary/src/Actions.dfy(19,3)
    pub trait Action<A, R>: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send>
        where
        A: DafnyType,
        R: DafnyType {
        /// ../mpl/StandardLibrary/src/Actions.dfy(24,5)
        fn Invoke(&self, a: &A) -> R;
    }

    /// ../mpl/StandardLibrary/src/Actions.dfy(61,3)
    pub trait ActionWithResult<A, R, E>: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> + Action<A, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<R, E>>> + UpcastObject<dyn Action<A, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<R, E>>>>
        where
        A: DafnyType,
        R: DafnyType,
        E: DafnyType {}

    /// ../mpl/StandardLibrary/src/Actions.dfy(74,3)
    pub trait DeterministicAction<A, R>: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send>
        where
        A: DafnyType,
        R: DafnyType {
        /// ../mpl/StandardLibrary/src/Actions.dfy(79,5)
        fn Invoke(&self, a: &A) -> R;
    }

    /// ../mpl/StandardLibrary/src/Actions.dfy(95,3)
    pub trait DeterministicActionWithResult<A, R, E>: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> + DeterministicAction<A, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<R, E>>> + UpcastObject<dyn DeterministicAction<A, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<R, E>>>>
        where
        A: DafnyType,
        R: DafnyType,
        E: DafnyType {}
}
/// ../mpl/AwsCryptographyPrimitives/src/AesKdfCtr.dfy(46,1)
pub mod AesKdfCtr {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/AesKdfCtr.dfy(68,3)
        pub fn CreateStreamSuccess(bytes: &Sequence<u8>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: bytes.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AesKdfCtr.dfy(72,3)
        pub fn CreateStreamFailure(error: &Arc<Error>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(6,1)
pub mod _AlgorithmSuites_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Encrypt;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm::SHA_512;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_NO_KDF;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_NO_KDF;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_NO_KDF;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DBEAlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::HMAC;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId::ESDK;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::SymmetricKeyLength;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm;
    pub use ::dafny_runtime::Map;
    pub use ::dafny_runtime::map;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(13,3)
        pub fn _SupportedESDKEncrypt_q(e: &Arc<Encrypt>) -> bool {
            true && (e.AES_GCM().keyLength().clone() == 32 || e.AES_GCM().keyLength().clone() == 24 || e.AES_GCM().keyLength().clone() == 16) && e.AES_GCM().tagLength().clone() == 16 && e.AES_GCM().ivLength().clone() == 12
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(24,3)
        pub fn _SupportedDBEEncrypt_q(e: &Arc<Encrypt>) -> bool {
            true && e.AES_GCM().keyLength().clone() == 32 && e.AES_GCM().tagLength().clone() == 16 && e.AES_GCM().ivLength().clone() == 12
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(32,3)
        pub fn _SupportedDBEEDKWrapping_q(p: &Arc<EdkWrappingAlgorithm>) -> bool {
            matches!(p.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::IntermediateKeyWrapping{ .. }) && true && p.IntermediateKeyWrapping().pdkEncryptAlgorithm().AES_GCM().keyLength().clone() == 32 && p.IntermediateKeyWrapping().pdkEncryptAlgorithm().AES_GCM().tagLength().clone() == 16 && p.IntermediateKeyWrapping().pdkEncryptAlgorithm().AES_GCM().ivLength().clone() == 12 && matches!(p.IntermediateKeyWrapping().macKeyKdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && matches!(p.IntermediateKeyWrapping().keyEncryptionKeyKdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(43,3)
        pub fn _KeyDerivationAlgorithm_q(kdf: &Arc<DerivationAlgorithm>) -> bool {
            (!(true && matches!(kdf.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. })) || kdf.HKDF().inputKeyLength().clone() == kdf.HKDF().outputKeyLength().clone() && (!(kdf.HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_512 {})) || kdf.HKDF().inputKeyLength().clone() == 32)) && !matches!(kdf.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(53,3)
        pub fn _CommitmentDerivationAlgorithm_q(kdf: &Arc<DerivationAlgorithm>) -> bool {
            (!(true && matches!(kdf.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. })) || matches!(kdf.HKDF().hmac().as_ref(), SHA_512{ .. }) && kdf.HKDF().saltLength().clone() == 32 && kdf.HKDF().inputKeyLength().clone() == 32 && kdf.HKDF().outputKeyLength().clone() == 32) && !matches!(kdf.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::IDENTITY{ .. })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(65,3)
        pub fn _EdkWrappingAlgorithm_q(alg: &Arc<EdkWrappingAlgorithm>) -> bool {
            matches!(alg.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::IntermediateKeyWrapping{ .. }) && matches!(alg.IntermediateKeyWrapping().keyEncryptionKeyKdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && matches!(alg.IntermediateKeyWrapping().macKeyKdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && true && alg.IntermediateKeyWrapping().pdkEncryptAlgorithm().AES_GCM().keyLength().clone() == 32 || matches!(alg.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(77,3)
        pub fn _AlgorithmSuiteInfo_q(a: &Arc<AlgorithmSuiteInfo>) -> bool {
            _default::_KeyDerivationAlgorithm_q(a.kdf()) && _default::_CommitmentDerivationAlgorithm_q(a.commitment()) && _default::_EdkWrappingAlgorithm_q(a.edkWrapping()) && (!matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) || true && a.kdf().HKDF().outputKeyLength().clone() == a.encrypt().AES_GCM().keyLength().clone()) && (!matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) || matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. })) && (!matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) || a.commitment().HKDF().saltLength().clone() == 32 && a.commitment().clone() == a.kdf().clone()) && (!matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::IntermediateKeyWrapping{ .. }) || matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.edkWrapping().IntermediateKeyWrapping().keyEncryptionKeyKdf().clone() == a.kdf().clone() && a.edkWrapping().IntermediateKeyWrapping().macKeyKdf().clone() == a.kdf().clone()) && (!(matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. })) || a.kdf().HKDF().saltLength().clone() == 0) && (!(!matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. })) || true && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::IntermediateKeyWrapping{ .. }))
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(117,3)
        pub fn _ESDKAlgorithmSuite_q(a: &Arc<AlgorithmSuiteInfo>) -> bool {
            _default::_AlgorithmSuiteInfo_q(a) && _default::_SupportedESDKEncrypt_q(a.encrypt()) && (&({
                let mut a = a.clone();
                Arc::new(move |_source0: &Arc<ESDKAlgorithmSuiteId>| -> bool{
                        if matches!(_source0.as_ref(), ALG_AES_128_GCM_IV12_TAG16_NO_KDF{ .. }) {
                            a.binaryId().clone() == seq![0, 20] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 16 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::IDENTITY{ .. }) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                        } else {
                            if matches!(_source0.as_ref(), ALG_AES_192_GCM_IV12_TAG16_NO_KDF{ .. }) {
                                a.binaryId().clone() == seq![0, 70] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 24 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::IDENTITY{ .. }) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                            } else {
                                if matches!(_source0.as_ref(), ALG_AES_256_GCM_IV12_TAG16_NO_KDF{ .. }) {
                                    a.binaryId().clone() == seq![0, 120] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 32 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::IDENTITY{ .. }) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                                } else {
                                    if matches!(_source0.as_ref(), ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256{ .. }) {
                                        a.binaryId().clone() == seq![1, 20] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 16 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.kdf().HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_256 {}) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                                    } else {
                                        if matches!(_source0.as_ref(), ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256{ .. }) {
                                            a.binaryId().clone() == seq![1, 70] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 24 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.kdf().HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_256 {}) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                                        } else {
                                            if matches!(_source0.as_ref(), ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256{ .. }) {
                                                a.binaryId().clone() == seq![1, 120] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 32 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.kdf().HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_256 {}) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                                            } else {
                                                if matches!(_source0.as_ref(), ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256{ .. }) {
                                                    a.binaryId().clone() == seq![2, 20] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 16 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.kdf().HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_256 {}) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) && a.signature().ECDSA().curve().clone() == Arc::new(ECDSASignatureAlgorithm::ECDSA_P256 {}) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                                                } else {
                                                    if matches!(_source0.as_ref(), ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384{ .. }) {
                                                        a.binaryId().clone() == seq![3, 70] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 24 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.kdf().HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_384 {}) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) && a.signature().ECDSA().curve().clone() == Arc::new(ECDSASignatureAlgorithm::ECDSA_P384 {}) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                                                    } else {
                                                        if matches!(_source0.as_ref(), ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384{ .. }) {
                                                            a.binaryId().clone() == seq![3, 120] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 32 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.kdf().HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_384 {}) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) && a.signature().ECDSA().curve().clone() == Arc::new(ECDSASignatureAlgorithm::ECDSA_P384 {}) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                                                        } else {
                                                            if matches!(_source0.as_ref(), ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY{ .. }) {
                                                                a.binaryId().clone() == seq![4, 120] && a.messageVersion().clone() == 2 && true && a.encrypt().AES_GCM().keyLength().clone() == 32 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.kdf().HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_512 {}) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                                                            } else {
                                                                a.binaryId().clone() == seq![5, 120] && a.messageVersion().clone() == 2 && true && a.encrypt().AES_GCM().keyLength().clone() == 32 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.kdf().HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_512 {}) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) && a.signature().ECDSA().curve().clone() == Arc::new(ECDSASignatureAlgorithm::ECDSA_P384 {}) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && matches!(a.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{ .. })
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    })
            }))(a.id().ESDK())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(262,3)
        pub fn _DBEAlgorithmSuite_q(a: &Arc<AlgorithmSuiteInfo>) -> bool {
            _default::_AlgorithmSuiteInfo_q(a) && _default::_SupportedDBEEncrypt_q(a.encrypt()) && _default::_SupportedDBEEDKWrapping_q(a.edkWrapping()) && (&({
                let mut a = a.clone();
                Arc::new(move |_source0: &Arc<DBEAlgorithmSuiteId>| -> bool{
                        if matches!(_source0.as_ref(), ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384{ .. }) {
                            a.binaryId().clone() == seq![103, 0] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 32 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.kdf().HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_512 {}) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && matches!(a.symmetricSignature().as_ref(), HMAC{ .. }) && a.symmetricSignature().HMAC().clone() == Arc::new(DigestAlgorithm::SHA_384 {}) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::IntermediateKeyWrapping{ .. }) && true && a.edkWrapping().IntermediateKeyWrapping().pdkEncryptAlgorithm().AES_GCM().keyLength().clone() == 32
                        } else {
                            a.binaryId().clone() == seq![103, 1] && a.messageVersion().clone() == 1 && true && a.encrypt().AES_GCM().keyLength().clone() == 32 && matches!(a.kdf().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && a.kdf().HKDF().hmac().clone() == Arc::new(DigestAlgorithm::SHA_512 {}) && matches!(a.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) && a.signature().ECDSA().curve().clone() == Arc::new(ECDSASignatureAlgorithm::ECDSA_P384 {}) && matches!(a.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && matches!(a.symmetricSignature().as_ref(), HMAC{ .. }) && a.symmetricSignature().HMAC().clone() == Arc::new(DigestAlgorithm::SHA_384 {}) && matches!(a.edkWrapping().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::IntermediateKeyWrapping{ .. }) && true && a.edkWrapping().IntermediateKeyWrapping().pdkEncryptAlgorithm().AES_GCM().keyLength().clone() == 32
                        }
                    })
            }))(a.id().DBE())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(307,3)
        pub fn _AlgorithmSuite_q(a: &Arc<AlgorithmSuiteInfo>) -> bool {
            let mut _source0: Arc<AlgorithmSuiteId> = a.id().clone();
            if matches!((&_source0).as_ref(), ESDK{ .. }) {
                let mut ___mcc_h0: Arc<ESDKAlgorithmSuiteId> = _source0.ESDK().clone();
                _default::_ESDKAlgorithmSuite_q(a)
            } else {
                let mut ___mcc_h1: Arc<DBEAlgorithmSuiteId> = _source0.DBE().clone();
                _default::_DBEAlgorithmSuite_q(a)
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(338,3)
        pub fn HKDF_SHA_256(keyLength: SymmetricKeyLength) -> Arc<DerivationAlgorithm> {
            Arc::new(DerivationAlgorithm::HKDF {
                    HKDF: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::HKDF::HKDF {
                                hmac: Arc::new(DigestAlgorithm::SHA_256 {}),
                                saltLength: 0,
                                inputKeyLength: keyLength,
                                outputKeyLength: keyLength
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(351,3)
        pub fn HKDF_SHA_384(keyLength: SymmetricKeyLength) -> Arc<DerivationAlgorithm> {
            Arc::new(DerivationAlgorithm::HKDF {
                    HKDF: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::HKDF::HKDF {
                                hmac: Arc::new(DigestAlgorithm::SHA_384 {}),
                                saltLength: 0,
                                inputKeyLength: keyLength,
                                outputKeyLength: keyLength
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(364,3)
        pub fn HKDF_SHA_512(keyLength: SymmetricKeyLength) -> Arc<DerivationAlgorithm> {
            Arc::new(DerivationAlgorithm::HKDF {
                    HKDF: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::HKDF::HKDF {
                                hmac: Arc::new(DigestAlgorithm::SHA_512 {}),
                                saltLength: 32,
                                inputKeyLength: keyLength,
                                outputKeyLength: keyLength
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(541,3)
        pub fn GetSuite(id: &Arc<AlgorithmSuiteId>) -> AlgorithmSuite {
            let mut _source0: Arc<AlgorithmSuiteId> = id.clone();
            if matches!((&_source0).as_ref(), ESDK{ .. }) {
                let mut ___mcc_h0: Arc<ESDKAlgorithmSuiteId> = _source0.ESDK().clone();
                let mut e: Arc<ESDKAlgorithmSuiteId> = ___mcc_h0.clone();
                _default::GetESDKSuite(&e)
            } else {
                let mut ___mcc_h1: Arc<DBEAlgorithmSuiteId> = _source0.DBE().clone();
                let mut e: Arc<DBEAlgorithmSuiteId> = ___mcc_h1.clone();
                _default::GetDBESuite(&e)
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(581,3)
        pub fn GetDBESuite(id: &Arc<DBEAlgorithmSuiteId>) -> AlgorithmSuite {
            _default::SupportedDBEAlgorithmSuites().get(id)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(623,3)
        pub fn GetESDKSuite(id: &Arc<ESDKAlgorithmSuiteId>) -> AlgorithmSuite {
            _default::SupportedESDKAlgorithmSuites().get(id)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(646,3)
        pub fn GetEncryptKeyLength(a: &Arc<AlgorithmSuiteInfo>) -> i32 {
            let mut _source0: Arc<Encrypt> = a.encrypt().clone();
            let mut ___mcc_h0: Arc<AES_GCM> = _source0.AES_GCM().clone();
            let mut e: Arc<AES_GCM> = ___mcc_h0.clone();
            e.keyLength().clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(657,3)
        pub fn GetEncryptTagLength(a: &Arc<AlgorithmSuiteInfo>) -> i32 {
            let mut _source0: Arc<Encrypt> = a.encrypt().clone();
            let mut ___mcc_h0: Arc<AES_GCM> = _source0.AES_GCM().clone();
            let mut e: Arc<AES_GCM> = ___mcc_h0.clone();
            e.tagLength().clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(668,3)
        pub fn GetEncryptIvLength(a: &Arc<AlgorithmSuiteInfo>) -> i32 {
            let mut _source0: Arc<Encrypt> = a.encrypt().clone();
            let mut ___mcc_h0: Arc<AES_GCM> = _source0.AES_GCM().clone();
            let mut e: Arc<AES_GCM> = ___mcc_h0.clone();
            e.ivLength().clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(699,3)
        pub fn GetAlgorithmSuiteInfo(_binaryId_q: &Sequence<u8>) -> Arc<Result<Arc<AlgorithmSuiteInfo>, Arc<Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(_default::AlgorithmSuiteInfoByBinaryId().contains(_binaryId_q), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid BinaryId")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<AlgorithmSuite>()
            } else {
                Arc::new(Result::<AlgorithmSuite, Arc<Error>>::Success {
                        value: _default::AlgorithmSuiteInfoByBinaryId().get(_binaryId_q)
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(318,3)
        pub fn Bits128() -> i32 {
            16
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(319,3)
        pub fn TagLen() -> i32 {
            16
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(320,3)
        pub fn IvLen() -> i32 {
            12
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(322,3)
        pub fn AES_128_GCM_IV12_TAG16() -> Arc<Encrypt> {
            Arc::new(Encrypt::AES_GCM {
                    AES_GCM: Arc::new(AES_GCM::AES_GCM {
                                keyLength: _default::Bits128(),
                                tagLength: _default::TagLen(),
                                ivLength: _default::IvLen()
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(317,3)
        pub fn Bits192() -> i32 {
            24
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(327,3)
        pub fn AES_192_GCM_IV12_TAG16() -> Arc<Encrypt> {
            Arc::new(Encrypt::AES_GCM {
                    AES_GCM: Arc::new(AES_GCM::AES_GCM {
                                keyLength: _default::Bits192(),
                                tagLength: _default::TagLen(),
                                ivLength: _default::IvLen()
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(316,3)
        pub fn Bits256() -> i32 {
            32
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(332,3)
        pub fn AES_256_GCM_IV12_TAG16() -> Arc<Encrypt> {
            Arc::new(Encrypt::AES_GCM {
                    AES_GCM: Arc::new(AES_GCM::AES_GCM {
                                keyLength: _default::Bits256(),
                                tagLength: _default::TagLen(),
                                ivLength: _default::IvLen()
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(377,3)
        pub fn EDK_INTERMEDIATE_WRAPPING_AES_GCM_256_HKDF_SHA_512() -> Arc<EdkWrappingAlgorithm> {
            Arc::new(EdkWrappingAlgorithm::IntermediateKeyWrapping {
                    IntermediateKeyWrapping: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IntermediateKeyWrapping::IntermediateKeyWrapping {
                                keyEncryptionKeyKdf: _default::HKDF_SHA_512(_default::Bits256()),
                                macKeyKdf: _default::HKDF_SHA_512(_default::Bits256()),
                                pdkEncryptAlgorithm: _default::AES_256_GCM_IV12_TAG16()
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(387,3)
        pub fn DBE_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::DBE {
                                DBE: Arc::new(DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384 {})
                            }),
                    binaryId: seq![103, 0],
                    messageVersion: 1,
                    encrypt: _default::AES_256_GCM_IV12_TAG16(),
                    kdf: _default::HKDF_SHA_512(_default::Bits256()),
                    commitment: _default::HKDF_SHA_512(_default::Bits256()),
                    signature: Arc::new(SignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::HMAC {
                                HMAC: Arc::new(DigestAlgorithm::SHA_384 {})
                            }),
                    edkWrapping: _default::EDK_INTERMEDIATE_WRAPPING_AES_GCM_256_HKDF_SHA_512()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(398,3)
        pub fn DBE_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::DBE {
                                DBE: Arc::new(DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384 {})
                            }),
                    binaryId: seq![103, 1],
                    messageVersion: 1,
                    encrypt: _default::AES_256_GCM_IV12_TAG16(),
                    kdf: _default::HKDF_SHA_512(_default::Bits256()),
                    commitment: _default::HKDF_SHA_512(_default::Bits256()),
                    signature: Arc::new(SignatureAlgorithm::ECDSA {
                                ECDSA: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ECDSA::ECDSA {
                                            curve: Arc::new(ECDSASignatureAlgorithm::ECDSA_P384 {})
                                        })
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::HMAC {
                                HMAC: Arc::new(DigestAlgorithm::SHA_384 {})
                            }),
                    edkWrapping: _default::EDK_INTERMEDIATE_WRAPPING_AES_GCM_256_HKDF_SHA_512()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(413,3)
        pub fn ESDK_ALG_AES_128_GCM_IV12_TAG16_NO_KDF() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_NO_KDF {})
                            }),
                    binaryId: seq![0, 20],
                    messageVersion: 1,
                    encrypt: _default::AES_128_GCM_IV12_TAG16(),
                    kdf: Arc::new(DerivationAlgorithm::IDENTITY {
                                IDENTITY: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IDENTITY::IDENTITY {})
                            }),
                    commitment: Arc::new(DerivationAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    signature: Arc::new(SignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(424,3)
        pub fn ESDK_ALG_AES_192_GCM_IV12_TAG16_NO_KDF() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_NO_KDF {})
                            }),
                    binaryId: seq![0, 70],
                    messageVersion: 1,
                    encrypt: _default::AES_192_GCM_IV12_TAG16(),
                    kdf: Arc::new(DerivationAlgorithm::IDENTITY {
                                IDENTITY: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IDENTITY::IDENTITY {})
                            }),
                    commitment: Arc::new(DerivationAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    signature: Arc::new(SignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(435,3)
        pub fn ESDK_ALG_AES_256_GCM_IV12_TAG16_NO_KDF() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_NO_KDF {})
                            }),
                    binaryId: seq![0, 120],
                    messageVersion: 1,
                    encrypt: _default::AES_256_GCM_IV12_TAG16(),
                    kdf: Arc::new(DerivationAlgorithm::IDENTITY {
                                IDENTITY: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IDENTITY::IDENTITY {})
                            }),
                    commitment: Arc::new(DerivationAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    signature: Arc::new(SignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(448,3)
        pub fn ESDK_ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256 {})
                            }),
                    binaryId: seq![1, 20],
                    messageVersion: 1,
                    encrypt: _default::AES_128_GCM_IV12_TAG16(),
                    kdf: _default::HKDF_SHA_256(_default::Bits128()),
                    commitment: Arc::new(DerivationAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    signature: Arc::new(SignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(459,3)
        pub fn ESDK_ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256 {})
                            }),
                    binaryId: seq![1, 70],
                    messageVersion: 1,
                    encrypt: _default::AES_192_GCM_IV12_TAG16(),
                    kdf: _default::HKDF_SHA_256(_default::Bits192()),
                    commitment: Arc::new(DerivationAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    signature: Arc::new(SignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(470,3)
        pub fn ESDK_ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256 {})
                            }),
                    binaryId: seq![1, 120],
                    messageVersion: 1,
                    encrypt: _default::AES_256_GCM_IV12_TAG16(),
                    kdf: _default::HKDF_SHA_256(_default::Bits256()),
                    commitment: Arc::new(DerivationAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    signature: Arc::new(SignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(483,3)
        pub fn ESDK_ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256 {})
                            }),
                    binaryId: seq![2, 20],
                    messageVersion: 1,
                    encrypt: _default::AES_128_GCM_IV12_TAG16(),
                    kdf: _default::HKDF_SHA_256(_default::Bits128()),
                    commitment: Arc::new(DerivationAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    signature: Arc::new(SignatureAlgorithm::ECDSA {
                                ECDSA: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ECDSA::ECDSA {
                                            curve: Arc::new(ECDSASignatureAlgorithm::ECDSA_P256 {})
                                        })
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(494,3)
        pub fn ESDK_ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384 {})
                            }),
                    binaryId: seq![3, 70],
                    messageVersion: 1,
                    encrypt: _default::AES_192_GCM_IV12_TAG16(),
                    kdf: _default::HKDF_SHA_384(_default::Bits192()),
                    commitment: Arc::new(DerivationAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    signature: Arc::new(SignatureAlgorithm::ECDSA {
                                ECDSA: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ECDSA::ECDSA {
                                            curve: Arc::new(ECDSASignatureAlgorithm::ECDSA_P384 {})
                                        })
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(505,3)
        pub fn ESDK_ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384 {})
                            }),
                    binaryId: seq![3, 120],
                    messageVersion: 1,
                    encrypt: _default::AES_256_GCM_IV12_TAG16(),
                    kdf: _default::HKDF_SHA_384(_default::Bits256()),
                    commitment: Arc::new(DerivationAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    signature: Arc::new(SignatureAlgorithm::ECDSA {
                                ECDSA: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ECDSA::ECDSA {
                                            curve: Arc::new(ECDSASignatureAlgorithm::ECDSA_P384 {})
                                        })
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(518,3)
        pub fn ESDK_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY {})
                            }),
                    binaryId: seq![4, 120],
                    messageVersion: 2,
                    encrypt: _default::AES_256_GCM_IV12_TAG16(),
                    kdf: _default::HKDF_SHA_512(_default::Bits256()),
                    commitment: _default::HKDF_SHA_512(_default::Bits256()),
                    signature: Arc::new(SignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(529,3)
        pub fn ESDK_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384() -> AlgorithmSuite {
            Arc::new(AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                    id: Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384 {})
                            }),
                    binaryId: seq![5, 120],
                    messageVersion: 2,
                    encrypt: _default::AES_256_GCM_IV12_TAG16(),
                    kdf: _default::HKDF_SHA_512(_default::Bits256()),
                    commitment: _default::HKDF_SHA_512(_default::Bits256()),
                    signature: Arc::new(SignatureAlgorithm::ECDSA {
                                ECDSA: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ECDSA::ECDSA {
                                            curve: Arc::new(ECDSASignatureAlgorithm::ECDSA_P384 {})
                                        })
                            }),
                    symmetricSignature: Arc::new(SymmetricSignatureAlgorithm::None {
                                _None: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None::None {})
                            }),
                    edkWrapping: Arc::new(EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(605,3)
        pub fn SupportedESDKAlgorithmSuites() -> Map<Arc<ESDKAlgorithmSuiteId>, AlgorithmSuite> {
            map![(Arc::new(ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_NO_KDF {})) => (_default::ESDK_ALG_AES_128_GCM_IV12_TAG16_NO_KDF()), (Arc::new(ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_NO_KDF {})) => (_default::ESDK_ALG_AES_192_GCM_IV12_TAG16_NO_KDF()), (Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_NO_KDF {})) => (_default::ESDK_ALG_AES_256_GCM_IV12_TAG16_NO_KDF()), (Arc::new(ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256 {})) => (_default::ESDK_ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256()), (Arc::new(ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256 {})) => (_default::ESDK_ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256()), (Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256 {})) => (_default::ESDK_ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256()), (Arc::new(ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256 {})) => (_default::ESDK_ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256()), (Arc::new(ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384 {})) => (_default::ESDK_ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384()), (Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384 {})) => (_default::ESDK_ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384()), (Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY {})) => (_default::ESDK_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY()), (Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384 {})) => (_default::ESDK_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384())]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(572,3)
        pub fn SupportedDBEAlgorithmSuites() -> Map<Arc<DBEAlgorithmSuiteId>, AlgorithmSuite> {
            map![(Arc::new(DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384 {})) => (_default::DBE_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384()), (Arc::new(DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384 {})) => (_default::DBE_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384())]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(679,3)
        pub fn AlgorithmSuiteInfoByBinaryId() -> Map<Sequence<u8>, AlgorithmSuite> {
            map![(seq![0, 20]) => (_default::ESDK_ALG_AES_128_GCM_IV12_TAG16_NO_KDF()), (seq![0, 70]) => (_default::ESDK_ALG_AES_192_GCM_IV12_TAG16_NO_KDF()), (seq![0, 120]) => (_default::ESDK_ALG_AES_256_GCM_IV12_TAG16_NO_KDF()), (seq![1, 20]) => (_default::ESDK_ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256()), (seq![1, 70]) => (_default::ESDK_ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256()), (seq![1, 120]) => (_default::ESDK_ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256()), (seq![2, 20]) => (_default::ESDK_ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256()), (seq![3, 70]) => (_default::ESDK_ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384()), (seq![3, 120]) => (_default::ESDK_ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384()), (seq![4, 120]) => (_default::ESDK_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY()), (seq![5, 120]) => (_default::ESDK_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384()), (seq![103, 0]) => (_default::DBE_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384()), (seq![103, 1]) => (_default::DBE_ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384())]
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AlgorithmSuites.dfy(313,3)
    pub type AlgorithmSuite = Arc<AlgorithmSuiteInfo>;
}
pub mod software {
    pub mod amazon {
        pub mod cryptography {
            pub mod primitives {
                /// ../mpl/AwsCryptographyPrimitives/src/Index.dfy(7,1)
                pub mod internaldafny {
                    pub use ::std::sync::Arc;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CryptoConfig;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                    pub use ::dafny_runtime::Object;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
                    pub use crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::Config;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
                    pub use ::dafny_runtime::allocate_object;
                    pub use ::dafny_runtime::update_field_uninit_object;
                    pub use ::dafny_runtime::UpcastObject;
                    pub use ::dafny_runtime::DynAny;
                    pub use ::dafny_runtime::UpcastObjectFn;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput;
                    pub use ::dafny_runtime::Sequence;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HMacInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExtractInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExpandInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::KdfCtrInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AesKdfCtrInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRSAKeyPairInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRSAKeyPairOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetRSAKeyModulusLengthInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetRSAKeyModulusLengthOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSADecryptInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAEncryptInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSAVerifyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetPublicKeyFromPrivateKeyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetPublicKeyFromPrivateKeyOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DeriveSharedSecretInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DeriveSharedSecretOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ParsePublicKeyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ParsePublicKeyOutput;

                    pub struct _default {}

                    impl _default {
                        /// ../mpl/AwsCryptographyPrimitives/src/Index.dfy(10,3)
                        pub fn DefaultCryptoConfig() -> Arc<CryptoConfig> {
                            Arc::new(CryptoConfig::CryptoConfig {})
                        }
                        /// END MANUAL FIX
                        /// ../mpl/AwsCryptographyPrimitives/src/Index.dfy(14,3)
                        pub fn AtomicPrimitives(config: &Arc<CryptoConfig>) -> Arc<Result<Object<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient>, Arc<Error>>> {
                            let mut res: Arc<Result<Object<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient>, Arc<Error>>>;
                            let mut client: Object<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient>;
                            let mut _nw0: Object<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient> = crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient::_allocate_object();
                            crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient::_ctor(&_nw0, &Arc::new(Config::Config {}));
                            client = _nw0.clone();
                            res = Arc::new(Result::<Object<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient>, Arc<Error>>::Success {
                                        value: client.clone()
                                    });
                            return res.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(721,3)
                        pub fn CreateSuccessOfClient(client: &Object<dyn IAwsCryptographicPrimitivesClient>) -> Arc<Result<Object<dyn IAwsCryptographicPrimitivesClient>, Arc<Error>>> {
                            Arc::new(Result::<Object<dyn IAwsCryptographicPrimitivesClient>, Arc<Error>>::Success {
                                    value: client.clone()
                                })
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(724,3)
                        pub fn CreateFailureOfError(error: &Arc<Error>) -> Arc<Result<Object<dyn IAwsCryptographicPrimitivesClient>, Arc<Error>>> {
                            Arc::new(Result::<Object<dyn IAwsCryptographicPrimitivesClient>, Arc<Error>>::Failure {
                                    error: error.clone()
                                })
                        }
                    }

                    /// ../mpl/AwsCryptographyPrimitives/src/Index.dfy(27,3)
                    pub struct AtomicPrimitivesClient {
                        pub __i_config: Arc<Config>
                    }

                    impl AtomicPrimitivesClient {
                        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                        pub fn _allocate_object() -> Object<Self> {
                            allocate_object::<Self>()
                        }
                        /// ../mpl/AwsCryptographyPrimitives/src/Index.dfy(35,5)
                        pub fn _ctor(this: &Object<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient>, config: &Arc<Config>) -> () {
                            let mut _set___i_config: bool = false;
                            update_field_uninit_object!(this.clone(), __i_config, _set___i_config, config.clone());
                            return ();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(735,5)
                        pub fn config(&self) -> Arc<Config> {
                            self.__i_config.clone()
                        }
                    }

                    impl UpcastObject<DynAny>
                        for crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient {
                        UpcastObjectFn!(DynAny);
                    }

                    impl IAwsCryptographicPrimitivesClient
                        for crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient {
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(744,5)
                        fn GenerateRandomBytes(&self, input: &Arc<GenerateRandomBytesInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::GenerateRandomBytes(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(764,5)
                        fn Digest(&self, input: &Arc<DigestInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::Digest(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(783,5)
                        fn HMac(&self, input: &Arc<HMacInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::HMac(&self.config().clone(), input)
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(793,5)
                        fn HkdfExtract(&self, input: &Arc<HkdfExtractInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::HkdfExtract(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(813,5)
                        fn HkdfExpand(&self, input: &Arc<HkdfExpandInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::HkdfExpand(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(833,5)
                        fn Hkdf(&self, input: &Arc<HkdfInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::Hkdf(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(853,5)
                        fn KdfCounterMode(&self, input: &Arc<KdfCtrInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::KdfCounterMode(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(873,5)
                        fn AesKdfCounterMode(&self, input: &Arc<AesKdfCtrInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::AesKdfCounterMode(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(893,5)
                        fn AESEncrypt(&self, input: &Arc<AESEncryptInput>) -> Arc<Result<Arc<AESEncryptOutput>, Arc<Error>>> {
                            let mut output: Arc<Result<Arc<AESEncryptOutput>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Arc<AESEncryptOutput>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::AESEncrypt(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(913,5)
                        fn AESDecrypt(&self, input: &Arc<AESDecryptInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::AESDecrypt(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(933,5)
                        fn GenerateRSAKeyPair(&self, input: &Arc<GenerateRSAKeyPairInput>) -> Arc<Result<Arc<GenerateRSAKeyPairOutput>, Arc<Error>>> {
                            let mut output: Arc<Result<Arc<GenerateRSAKeyPairOutput>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Arc<GenerateRSAKeyPairOutput>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::GenerateRSAKeyPair(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(952,5)
                        fn GetRSAKeyModulusLength(&self, input: &Arc<GetRSAKeyModulusLengthInput>) -> Arc<Result<Arc<GetRSAKeyModulusLengthOutput>, Arc<Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::GetRSAKeyModulusLength(&self.config().clone(), input)
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(962,5)
                        fn RSADecrypt(&self, input: &Arc<RSADecryptInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::RSADecrypt(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(982,5)
                        fn RSAEncrypt(&self, input: &Arc<RSAEncryptInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::RSAEncrypt(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(1002,5)
                        fn GenerateECDSASignatureKey(&self, input: &Arc<GenerateECDSASignatureKeyInput>) -> Arc<Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<Error>>> {
                            let mut output: Arc<Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::GenerateECDSASignatureKey(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(1022,5)
                        fn ECDSASign(&self, input: &Arc<ECDSASignInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
                            let mut output: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::ECDSASign(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(1042,5)
                        fn ECDSAVerify(&self, input: &Arc<ECDSAVerifyInput>) -> Arc<Result<bool, Arc<Error>>> {
                            let mut output: Arc<Result<bool, Arc<Error>>>;
                            let mut _out0: Arc<Result<bool, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::ECDSAVerify(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(1062,5)
                        fn GenerateECCKeyPair(&self, input: &Arc<GenerateECCKeyPairInput>) -> Arc<Result<Arc<GenerateECCKeyPairOutput>, Arc<Error>>> {
                            let mut output: Arc<Result<Arc<GenerateECCKeyPairOutput>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Arc<GenerateECCKeyPairOutput>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::GenerateECCKeyPair(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(1082,5)
                        fn GetPublicKeyFromPrivateKey(&self, input: &Arc<GetPublicKeyFromPrivateKeyInput>) -> Arc<Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<Error>>> {
                            let mut output: Arc<Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::GetPublicKeyFromPrivateKey(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(1102,5)
                        fn ValidatePublicKey(&self, input: &Arc<ValidatePublicKeyInput>) -> Arc<Result<Arc<ValidatePublicKeyOutput>, Arc<Error>>> {
                            let mut output: Arc<Result<Arc<ValidatePublicKeyOutput>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Arc<ValidatePublicKeyOutput>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::ValidatePublicKey(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(1122,5)
                        fn DeriveSharedSecret(&self, input: &Arc<DeriveSharedSecretInput>) -> Arc<Result<Arc<DeriveSharedSecretOutput>, Arc<Error>>> {
                            let mut output: Arc<Result<Arc<DeriveSharedSecretOutput>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Arc<DeriveSharedSecretOutput>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::DeriveSharedSecret(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(1142,5)
                        fn CompressPublicKey(&self, input: &Arc<CompressPublicKeyInput>) -> Arc<Result<Arc<CompressPublicKeyOutput>, Arc<Error>>> {
                            let mut output: Arc<Result<Arc<CompressPublicKeyOutput>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Arc<CompressPublicKeyOutput>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::CompressPublicKey(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(1162,5)
                        fn DecompressPublicKey(&self, input: &Arc<DecompressPublicKeyInput>) -> Arc<Result<Arc<DecompressPublicKeyOutput>, Arc<Error>>> {
                            let mut output: Arc<Result<Arc<DecompressPublicKeyOutput>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Arc<DecompressPublicKeyOutput>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::DecompressPublicKey(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(1182,5)
                        fn ParsePublicKey(&self, input: &Arc<ParsePublicKeyInput>) -> Arc<Result<Arc<ParsePublicKeyOutput>, Arc<Error>>> {
                            let mut output: Arc<Result<Arc<ParsePublicKeyOutput>, Arc<Error>>>;
                            let mut _out0: Arc<Result<Arc<ParsePublicKeyOutput>, Arc<Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyPrimitivesOperations_Compile::_default::ParsePublicKey(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                    }

                    impl UpcastObject<dyn IAwsCryptographicPrimitivesClient>
                        for crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient {
                        UpcastObjectFn!(dyn IAwsCryptographicPrimitivesClient);
                    }

                    /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(5,1)
                    pub mod types {
                        pub use ::dafny_runtime::truncate;
                        pub use ::dafny_runtime::int;
                        pub use ::dafny_runtime::DafnyInt;
                        pub use ::dafny_runtime::DafnyType;
                        pub use ::std::fmt::Debug;
                        pub use ::std::fmt::Formatter;
                        pub use ::dafny_runtime::DafnyPrint;
                        pub use ::std::cmp::Eq;
                        pub use ::std::hash::Hash;
                        pub use ::std::hash::Hasher;
                        pub use ::std::default::Default;
                        pub use ::std::convert::AsRef;
                        pub use ::std::sync::Arc;
                        pub use ::dafny_runtime::Sequence;
                        pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
                        pub use ::dafny_runtime::Object;
                        pub use ::dafny_runtime::allocate_object;
                        pub use ::dafny_runtime::UpcastObject;
                        pub use ::dafny_runtime::DynAny;
                        pub use ::dafny_runtime::UpcastObjectFn;
                        pub use ::dafny_runtime::Any;
                        pub use ::std::marker::Sync;
                        pub use ::std::marker::Send;
                        pub use ::dafny_runtime::SequenceIter;
                        pub use ::dafny_runtime::seq;
                        pub use ::dafny_runtime::DafnyCharUTF16;

                        pub struct _default {}

                        impl _default {
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(606,3)
                            pub fn IsValid_PositiveInteger(x: i32) -> bool {
                                !(x < truncate!(int!(0), i32))
                            }
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(620,3)
                            pub fn IsValid_RSAModulusLengthBits(x: i32) -> bool {
                                !(x < truncate!(int!(81), i32))
                            }
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(624,3)
                            pub fn IsValid_RSAModulusLengthBitsToGenerate(x: i32) -> bool {
                                !(x < truncate!(int!(81), i32)) && !(truncate!(int!(4096), i32) < x)
                            }
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(642,3)
                            pub fn IsValid_SymmetricKeyLength(x: i32) -> bool {
                                !(x < truncate!(int!(1), i32)) && !(truncate!(int!(32), i32) < x)
                            }
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(646,3)
                            pub fn IsValid_Uint8Bits(x: i32) -> bool {
                                !(x < truncate!(int!(0), i32)) && !(truncate!(int!(255), i32) < x)
                            }
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(650,3)
                            pub fn IsValid_Uint8Bytes(x: i32) -> bool {
                                !(x < truncate!(int!(0), i32)) && !(truncate!(int!(32), i32) < x)
                            }
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(699,3)
                            pub fn IsDummySubsetType(x: &DafnyInt) -> bool {
                                int!(0) < x.clone()
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(11,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DafnyCallEvent<I: DafnyType, O: DafnyType> {
                            DafnyCallEvent {
                                input: I,
                                output: O
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> DafnyCallEvent<I, O> {
                            /// Returns a borrow of the field input
                            pub fn input(&self) -> &I {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => input,
                                }
                            }
                            /// Returns a borrow of the field output
                            pub fn output(&self) -> &O {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => output,
                                }
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> Debug
                            for DafnyCallEvent<I, O> {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> DafnyPrint
                            for DafnyCallEvent<I, O> {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.DafnyCallEvent.DafnyCallEvent(")?;
                                        DafnyPrint::fmt_print(input, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(output, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl<I: DafnyType + Eq, O: DafnyType + Eq> Eq
                            for DafnyCallEvent<I, O> {}

                        impl<I: DafnyType + Hash, O: DafnyType + Hash> Hash
                            for DafnyCallEvent<I, O> {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                        Hash::hash(input, _state);
                                        Hash::hash(output, _state)
                                    },
                                }
                            }
                        }

                        impl<I: DafnyType + Default, O: DafnyType + Default> Default
                            for DafnyCallEvent<I, O> {
                            fn default() -> DafnyCallEvent<I, O> {
                                DafnyCallEvent::DafnyCallEvent {
                                    input: Default::default(),
                                    output: Default::default()
                                }
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> AsRef<DafnyCallEvent<I, O>>
                            for DafnyCallEvent<I, O> {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(15,3)
                        #[derive(PartialEq, Clone)]
                        pub enum AES_CTR {
                            AES_CTR {
                                keyLength: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::SymmetricKeyLength,
                                nonceLength: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Uint8Bits
                            }
                        }

                        impl AES_CTR {
                            /// Returns a borrow of the field keyLength
                            pub fn keyLength(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::SymmetricKeyLength {
                                match self {
                                    AES_CTR::AES_CTR{keyLength, nonceLength, } => keyLength,
                                }
                            }
                            /// Returns a borrow of the field nonceLength
                            pub fn nonceLength(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Uint8Bits {
                                match self {
                                    AES_CTR::AES_CTR{keyLength, nonceLength, } => nonceLength,
                                }
                            }
                        }

                        impl Debug
                            for AES_CTR {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for AES_CTR {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    AES_CTR::AES_CTR{keyLength, nonceLength, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.AES__CTR.AES__CTR(")?;
                                        DafnyPrint::fmt_print(keyLength, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(nonceLength, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for AES_CTR {}

                        impl Hash
                            for AES_CTR {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    AES_CTR::AES_CTR{keyLength, nonceLength, } => {
                                        Hash::hash(keyLength, _state);
                                        Hash::hash(nonceLength, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for AES_CTR {
                            fn default() -> AES_CTR {
                                AES_CTR::AES_CTR {
                                    keyLength: Default::default(),
                                    nonceLength: Default::default()
                                }
                            }
                        }

                        impl AsRef<AES_CTR>
                            for AES_CTR {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(19,3)
                        #[derive(PartialEq, Clone)]
                        pub enum AES_GCM {
                            AES_GCM {
                                keyLength: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::SymmetricKeyLength,
                                tagLength: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Uint8Bytes,
                                ivLength: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Uint8Bits
                            }
                        }

                        impl AES_GCM {
                            /// Returns a borrow of the field keyLength
                            pub fn keyLength(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::SymmetricKeyLength {
                                match self {
                                    AES_GCM::AES_GCM{keyLength, tagLength, ivLength, } => keyLength,
                                }
                            }
                            /// Returns a borrow of the field tagLength
                            pub fn tagLength(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Uint8Bytes {
                                match self {
                                    AES_GCM::AES_GCM{keyLength, tagLength, ivLength, } => tagLength,
                                }
                            }
                            /// Returns a borrow of the field ivLength
                            pub fn ivLength(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Uint8Bits {
                                match self {
                                    AES_GCM::AES_GCM{keyLength, tagLength, ivLength, } => ivLength,
                                }
                            }
                        }

                        impl Debug
                            for AES_GCM {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for AES_GCM {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    AES_GCM::AES_GCM{keyLength, tagLength, ivLength, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.AES__GCM.AES__GCM(")?;
                                        DafnyPrint::fmt_print(keyLength, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(tagLength, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(ivLength, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for AES_GCM {}

                        impl Hash
                            for AES_GCM {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    AES_GCM::AES_GCM{keyLength, tagLength, ivLength, } => {
                                        Hash::hash(keyLength, _state);
                                        Hash::hash(tagLength, _state);
                                        Hash::hash(ivLength, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for AES_GCM {
                            fn default() -> AES_GCM {
                                AES_GCM::AES_GCM {
                                    keyLength: Default::default(),
                                    tagLength: Default::default(),
                                    ivLength: Default::default()
                                }
                            }
                        }

                        impl AsRef<AES_GCM>
                            for AES_GCM {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(24,3)
                        #[derive(PartialEq, Clone)]
                        pub enum AESDecryptInput {
                            AESDecryptInput {
                                encAlg: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM>,
                                key: Sequence<u8>,
                                cipherTxt: Sequence<u8>,
                                authTag: Sequence<u8>,
                                iv: Sequence<u8>,
                                aad: Sequence<u8>
                            }
                        }

                        impl AESDecryptInput {
                            /// Returns a borrow of the field encAlg
                            pub fn encAlg(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM> {
                                match self {
                                    AESDecryptInput::AESDecryptInput{encAlg, key, cipherTxt, authTag, iv, aad, } => encAlg,
                                }
                            }
                            /// Returns a borrow of the field key
                            pub fn key(&self) -> &Sequence<u8> {
                                match self {
                                    AESDecryptInput::AESDecryptInput{encAlg, key, cipherTxt, authTag, iv, aad, } => key,
                                }
                            }
                            /// Returns a borrow of the field cipherTxt
                            pub fn cipherTxt(&self) -> &Sequence<u8> {
                                match self {
                                    AESDecryptInput::AESDecryptInput{encAlg, key, cipherTxt, authTag, iv, aad, } => cipherTxt,
                                }
                            }
                            /// Returns a borrow of the field authTag
                            pub fn authTag(&self) -> &Sequence<u8> {
                                match self {
                                    AESDecryptInput::AESDecryptInput{encAlg, key, cipherTxt, authTag, iv, aad, } => authTag,
                                }
                            }
                            /// Returns a borrow of the field iv
                            pub fn iv(&self) -> &Sequence<u8> {
                                match self {
                                    AESDecryptInput::AESDecryptInput{encAlg, key, cipherTxt, authTag, iv, aad, } => iv,
                                }
                            }
                            /// Returns a borrow of the field aad
                            pub fn aad(&self) -> &Sequence<u8> {
                                match self {
                                    AESDecryptInput::AESDecryptInput{encAlg, key, cipherTxt, authTag, iv, aad, } => aad,
                                }
                            }
                        }

                        impl Debug
                            for AESDecryptInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for AESDecryptInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    AESDecryptInput::AESDecryptInput{encAlg, key, cipherTxt, authTag, iv, aad, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.AESDecryptInput.AESDecryptInput(")?;
                                        DafnyPrint::fmt_print(encAlg, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(key, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(cipherTxt, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(authTag, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(iv, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(aad, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for AESDecryptInput {}

                        impl Hash
                            for AESDecryptInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    AESDecryptInput::AESDecryptInput{encAlg, key, cipherTxt, authTag, iv, aad, } => {
                                        Hash::hash(encAlg, _state);
                                        Hash::hash(key, _state);
                                        Hash::hash(cipherTxt, _state);
                                        Hash::hash(authTag, _state);
                                        Hash::hash(iv, _state);
                                        Hash::hash(aad, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for AESDecryptInput {
                            fn default() -> AESDecryptInput {
                                AESDecryptInput::AESDecryptInput {
                                    encAlg: Default::default(),
                                    key: Default::default(),
                                    cipherTxt: Default::default(),
                                    authTag: Default::default(),
                                    iv: Default::default(),
                                    aad: Default::default()
                                }
                            }
                        }

                        impl AsRef<AESDecryptInput>
                            for AESDecryptInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(32,3)
                        #[derive(PartialEq, Clone)]
                        pub enum AESEncryptInput {
                            AESEncryptInput {
                                encAlg: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM>,
                                iv: Sequence<u8>,
                                key: Sequence<u8>,
                                msg: Sequence<u8>,
                                aad: Sequence<u8>
                            }
                        }

                        impl AESEncryptInput {
                            /// Returns a borrow of the field encAlg
                            pub fn encAlg(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM> {
                                match self {
                                    AESEncryptInput::AESEncryptInput{encAlg, iv, key, msg, aad, } => encAlg,
                                }
                            }
                            /// Returns a borrow of the field iv
                            pub fn iv(&self) -> &Sequence<u8> {
                                match self {
                                    AESEncryptInput::AESEncryptInput{encAlg, iv, key, msg, aad, } => iv,
                                }
                            }
                            /// Returns a borrow of the field key
                            pub fn key(&self) -> &Sequence<u8> {
                                match self {
                                    AESEncryptInput::AESEncryptInput{encAlg, iv, key, msg, aad, } => key,
                                }
                            }
                            /// Returns a borrow of the field msg
                            pub fn msg(&self) -> &Sequence<u8> {
                                match self {
                                    AESEncryptInput::AESEncryptInput{encAlg, iv, key, msg, aad, } => msg,
                                }
                            }
                            /// Returns a borrow of the field aad
                            pub fn aad(&self) -> &Sequence<u8> {
                                match self {
                                    AESEncryptInput::AESEncryptInput{encAlg, iv, key, msg, aad, } => aad,
                                }
                            }
                        }

                        impl Debug
                            for AESEncryptInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for AESEncryptInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    AESEncryptInput::AESEncryptInput{encAlg, iv, key, msg, aad, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.AESEncryptInput.AESEncryptInput(")?;
                                        DafnyPrint::fmt_print(encAlg, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(iv, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(key, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(msg, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(aad, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for AESEncryptInput {}

                        impl Hash
                            for AESEncryptInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    AESEncryptInput::AESEncryptInput{encAlg, iv, key, msg, aad, } => {
                                        Hash::hash(encAlg, _state);
                                        Hash::hash(iv, _state);
                                        Hash::hash(key, _state);
                                        Hash::hash(msg, _state);
                                        Hash::hash(aad, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for AESEncryptInput {
                            fn default() -> AESEncryptInput {
                                AESEncryptInput::AESEncryptInput {
                                    encAlg: Default::default(),
                                    iv: Default::default(),
                                    key: Default::default(),
                                    msg: Default::default(),
                                    aad: Default::default()
                                }
                            }
                        }

                        impl AsRef<AESEncryptInput>
                            for AESEncryptInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(39,3)
                        #[derive(PartialEq, Clone)]
                        pub enum AESEncryptOutput {
                            AESEncryptOutput {
                                cipherText: Sequence<u8>,
                                authTag: Sequence<u8>
                            }
                        }

                        impl AESEncryptOutput {
                            /// Returns a borrow of the field cipherText
                            pub fn cipherText(&self) -> &Sequence<u8> {
                                match self {
                                    AESEncryptOutput::AESEncryptOutput{cipherText, authTag, } => cipherText,
                                }
                            }
                            /// Returns a borrow of the field authTag
                            pub fn authTag(&self) -> &Sequence<u8> {
                                match self {
                                    AESEncryptOutput::AESEncryptOutput{cipherText, authTag, } => authTag,
                                }
                            }
                        }

                        impl Debug
                            for AESEncryptOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for AESEncryptOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    AESEncryptOutput::AESEncryptOutput{cipherText, authTag, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.AESEncryptOutput.AESEncryptOutput(")?;
                                        DafnyPrint::fmt_print(cipherText, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(authTag, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for AESEncryptOutput {}

                        impl Hash
                            for AESEncryptOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    AESEncryptOutput::AESEncryptOutput{cipherText, authTag, } => {
                                        Hash::hash(cipherText, _state);
                                        Hash::hash(authTag, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for AESEncryptOutput {
                            fn default() -> AESEncryptOutput {
                                AESEncryptOutput::AESEncryptOutput {
                                    cipherText: Default::default(),
                                    authTag: Default::default()
                                }
                            }
                        }

                        impl AsRef<AESEncryptOutput>
                            for AESEncryptOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(43,3)
                        #[derive(PartialEq, Clone)]
                        pub enum AesKdfCtrInput {
                            AesKdfCtrInput {
                                ikm: Sequence<u8>,
                                expectedLength: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger,
                                nonce: Arc<Option<Sequence<u8>>>
                            }
                        }

                        impl AesKdfCtrInput {
                            /// Returns a borrow of the field ikm
                            pub fn ikm(&self) -> &Sequence<u8> {
                                match self {
                                    AesKdfCtrInput::AesKdfCtrInput{ikm, expectedLength, nonce, } => ikm,
                                }
                            }
                            /// Returns a borrow of the field expectedLength
                            pub fn expectedLength(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger {
                                match self {
                                    AesKdfCtrInput::AesKdfCtrInput{ikm, expectedLength, nonce, } => expectedLength,
                                }
                            }
                            /// Returns a borrow of the field nonce
                            pub fn nonce(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    AesKdfCtrInput::AesKdfCtrInput{ikm, expectedLength, nonce, } => nonce,
                                }
                            }
                        }

                        impl Debug
                            for AesKdfCtrInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for AesKdfCtrInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    AesKdfCtrInput::AesKdfCtrInput{ikm, expectedLength, nonce, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.AesKdfCtrInput.AesKdfCtrInput(")?;
                                        DafnyPrint::fmt_print(ikm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(expectedLength, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(nonce, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for AesKdfCtrInput {}

                        impl Hash
                            for AesKdfCtrInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    AesKdfCtrInput::AesKdfCtrInput{ikm, expectedLength, nonce, } => {
                                        Hash::hash(ikm, _state);
                                        Hash::hash(expectedLength, _state);
                                        Hash::hash(nonce, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for AesKdfCtrInput {
                            fn default() -> AesKdfCtrInput {
                                AesKdfCtrInput::AesKdfCtrInput {
                                    ikm: Default::default(),
                                    expectedLength: Default::default(),
                                    nonce: Default::default()
                                }
                            }
                        }

                        impl AsRef<AesKdfCtrInput>
                            for AesKdfCtrInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(48,3)
                        pub struct IAwsCryptographicPrimitivesClientCallHistory {}

                        impl IAwsCryptographicPrimitivesClientCallHistory {
                            /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                            pub fn _allocate_object() -> Object<Self> {
                                allocate_object::<Self>()
                            }
                        }

                        impl UpcastObject<DynAny>
                            for crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClientCallHistory {
                            UpcastObjectFn!(DynAny);
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(100,3)
                        pub trait IAwsCryptographicPrimitivesClient: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(129,5)
                            fn GenerateRandomBytes(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(144,5)
                            fn Digest(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(159,5)
                            fn HMac(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HMacInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(165,5)
                            fn HkdfExtract(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExtractInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(180,5)
                            fn HkdfExpand(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExpandInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(195,5)
                            fn Hkdf(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(210,5)
                            fn KdfCounterMode(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::KdfCtrInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(225,5)
                            fn AesKdfCounterMode(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AesKdfCtrInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(240,5)
                            fn AESEncrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(255,5)
                            fn AESDecrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(270,5)
                            fn GenerateRSAKeyPair(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRSAKeyPairInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRSAKeyPairOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(285,5)
                            fn GetRSAKeyModulusLength(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetRSAKeyModulusLengthInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetRSAKeyModulusLengthOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(291,5)
                            fn RSADecrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSADecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(306,5)
                            fn RSAEncrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(321,5)
                            fn GenerateECDSASignatureKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(336,5)
                            fn ECDSASign(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(351,5)
                            fn ECDSAVerify(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSAVerifyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(366,5)
                            fn GenerateECCKeyPair(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(381,5)
                            fn GetPublicKeyFromPrivateKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetPublicKeyFromPrivateKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetPublicKeyFromPrivateKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(396,5)
                            fn ValidatePublicKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(411,5)
                            fn DeriveSharedSecret(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DeriveSharedSecretInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DeriveSharedSecretOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(426,5)
                            fn CompressPublicKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(441,5)
                            fn DecompressPublicKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(456,5)
                            fn ParsePublicKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ParsePublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ParsePublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(470,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CompressPublicKeyInput {
                            CompressPublicKeyInput {
                                publicKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey>,
                                eccCurve: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec>
                            }
                        }

                        impl CompressPublicKeyInput {
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey> {
                                match self {
                                    CompressPublicKeyInput::CompressPublicKeyInput{publicKey, eccCurve, } => publicKey,
                                }
                            }
                            /// Returns a borrow of the field eccCurve
                            pub fn eccCurve(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec> {
                                match self {
                                    CompressPublicKeyInput::CompressPublicKeyInput{publicKey, eccCurve, } => eccCurve,
                                }
                            }
                        }

                        impl Debug
                            for CompressPublicKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CompressPublicKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CompressPublicKeyInput::CompressPublicKeyInput{publicKey, eccCurve, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.CompressPublicKeyInput.CompressPublicKeyInput(")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(eccCurve, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CompressPublicKeyInput {}

                        impl Hash
                            for CompressPublicKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CompressPublicKeyInput::CompressPublicKeyInput{publicKey, eccCurve, } => {
                                        Hash::hash(publicKey, _state);
                                        Hash::hash(eccCurve, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CompressPublicKeyInput {
                            fn default() -> CompressPublicKeyInput {
                                CompressPublicKeyInput::CompressPublicKeyInput {
                                    publicKey: Default::default(),
                                    eccCurve: Default::default()
                                }
                            }
                        }

                        impl AsRef<CompressPublicKeyInput>
                            for CompressPublicKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(474,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CompressPublicKeyOutput {
                            CompressPublicKeyOutput {
                                compressedPublicKey: Sequence<u8>
                            }
                        }

                        impl CompressPublicKeyOutput {
                            /// Returns a borrow of the field compressedPublicKey
                            pub fn compressedPublicKey(&self) -> &Sequence<u8> {
                                match self {
                                    CompressPublicKeyOutput::CompressPublicKeyOutput{compressedPublicKey, } => compressedPublicKey,
                                }
                            }
                        }

                        impl Debug
                            for CompressPublicKeyOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CompressPublicKeyOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CompressPublicKeyOutput::CompressPublicKeyOutput{compressedPublicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.CompressPublicKeyOutput.CompressPublicKeyOutput(")?;
                                        DafnyPrint::fmt_print(compressedPublicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CompressPublicKeyOutput {}

                        impl Hash
                            for CompressPublicKeyOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CompressPublicKeyOutput::CompressPublicKeyOutput{compressedPublicKey, } => {
                                        Hash::hash(compressedPublicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CompressPublicKeyOutput {
                            fn default() -> CompressPublicKeyOutput {
                                CompressPublicKeyOutput::CompressPublicKeyOutput {
                                    compressedPublicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<CompressPublicKeyOutput>
                            for CompressPublicKeyOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(477,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CryptoConfig {
                            CryptoConfig {}
                        }

                        impl CryptoConfig {}

                        impl Debug
                            for CryptoConfig {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CryptoConfig {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CryptoConfig::CryptoConfig{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.CryptoConfig.CryptoConfig")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl CryptoConfig {
                            /// Enumerates all possible values of CryptoConfig
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<CryptoConfig>> {
                                seq![Arc::new(CryptoConfig::CryptoConfig {})].iter()
                            }
                        }

                        impl Eq
                            for CryptoConfig {}

                        impl Hash
                            for CryptoConfig {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CryptoConfig::CryptoConfig{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for CryptoConfig {
                            fn default() -> CryptoConfig {
                                CryptoConfig::CryptoConfig {}
                            }
                        }

                        impl AsRef<CryptoConfig>
                            for CryptoConfig {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(480,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DecompressPublicKeyInput {
                            DecompressPublicKeyInput {
                                compressedPublicKey: Sequence<u8>,
                                eccCurve: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec>
                            }
                        }

                        impl DecompressPublicKeyInput {
                            /// Returns a borrow of the field compressedPublicKey
                            pub fn compressedPublicKey(&self) -> &Sequence<u8> {
                                match self {
                                    DecompressPublicKeyInput::DecompressPublicKeyInput{compressedPublicKey, eccCurve, } => compressedPublicKey,
                                }
                            }
                            /// Returns a borrow of the field eccCurve
                            pub fn eccCurve(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec> {
                                match self {
                                    DecompressPublicKeyInput::DecompressPublicKeyInput{compressedPublicKey, eccCurve, } => eccCurve,
                                }
                            }
                        }

                        impl Debug
                            for DecompressPublicKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DecompressPublicKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DecompressPublicKeyInput::DecompressPublicKeyInput{compressedPublicKey, eccCurve, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.DecompressPublicKeyInput.DecompressPublicKeyInput(")?;
                                        DafnyPrint::fmt_print(compressedPublicKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(eccCurve, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DecompressPublicKeyInput {}

                        impl Hash
                            for DecompressPublicKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DecompressPublicKeyInput::DecompressPublicKeyInput{compressedPublicKey, eccCurve, } => {
                                        Hash::hash(compressedPublicKey, _state);
                                        Hash::hash(eccCurve, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DecompressPublicKeyInput {
                            fn default() -> DecompressPublicKeyInput {
                                DecompressPublicKeyInput::DecompressPublicKeyInput {
                                    compressedPublicKey: Default::default(),
                                    eccCurve: Default::default()
                                }
                            }
                        }

                        impl AsRef<DecompressPublicKeyInput>
                            for DecompressPublicKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(484,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DecompressPublicKeyOutput {
                            DecompressPublicKeyOutput {
                                publicKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey>
                            }
                        }

                        impl DecompressPublicKeyOutput {
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey> {
                                match self {
                                    DecompressPublicKeyOutput::DecompressPublicKeyOutput{publicKey, } => publicKey,
                                }
                            }
                        }

                        impl Debug
                            for DecompressPublicKeyOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DecompressPublicKeyOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DecompressPublicKeyOutput::DecompressPublicKeyOutput{publicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.DecompressPublicKeyOutput.DecompressPublicKeyOutput(")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DecompressPublicKeyOutput {}

                        impl Hash
                            for DecompressPublicKeyOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DecompressPublicKeyOutput::DecompressPublicKeyOutput{publicKey, } => {
                                        Hash::hash(publicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DecompressPublicKeyOutput {
                            fn default() -> DecompressPublicKeyOutput {
                                DecompressPublicKeyOutput::DecompressPublicKeyOutput {
                                    publicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<DecompressPublicKeyOutput>
                            for DecompressPublicKeyOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(487,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DeriveSharedSecretInput {
                            DeriveSharedSecretInput {
                                eccCurve: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec>,
                                privateKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey>,
                                publicKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey>
                            }
                        }

                        impl DeriveSharedSecretInput {
                            /// Returns a borrow of the field eccCurve
                            pub fn eccCurve(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec> {
                                match self {
                                    DeriveSharedSecretInput::DeriveSharedSecretInput{eccCurve, privateKey, publicKey, } => eccCurve,
                                }
                            }
                            /// Returns a borrow of the field privateKey
                            pub fn privateKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey> {
                                match self {
                                    DeriveSharedSecretInput::DeriveSharedSecretInput{eccCurve, privateKey, publicKey, } => privateKey,
                                }
                            }
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey> {
                                match self {
                                    DeriveSharedSecretInput::DeriveSharedSecretInput{eccCurve, privateKey, publicKey, } => publicKey,
                                }
                            }
                        }

                        impl Debug
                            for DeriveSharedSecretInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DeriveSharedSecretInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DeriveSharedSecretInput::DeriveSharedSecretInput{eccCurve, privateKey, publicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.DeriveSharedSecretInput.DeriveSharedSecretInput(")?;
                                        DafnyPrint::fmt_print(eccCurve, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(privateKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DeriveSharedSecretInput {}

                        impl Hash
                            for DeriveSharedSecretInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DeriveSharedSecretInput::DeriveSharedSecretInput{eccCurve, privateKey, publicKey, } => {
                                        Hash::hash(eccCurve, _state);
                                        Hash::hash(privateKey, _state);
                                        Hash::hash(publicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DeriveSharedSecretInput {
                            fn default() -> DeriveSharedSecretInput {
                                DeriveSharedSecretInput::DeriveSharedSecretInput {
                                    eccCurve: Default::default(),
                                    privateKey: Default::default(),
                                    publicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<DeriveSharedSecretInput>
                            for DeriveSharedSecretInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(492,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DeriveSharedSecretOutput {
                            DeriveSharedSecretOutput {
                                sharedSecret: Sequence<u8>
                            }
                        }

                        impl DeriveSharedSecretOutput {
                            /// Returns a borrow of the field sharedSecret
                            pub fn sharedSecret(&self) -> &Sequence<u8> {
                                match self {
                                    DeriveSharedSecretOutput::DeriveSharedSecretOutput{sharedSecret, } => sharedSecret,
                                }
                            }
                        }

                        impl Debug
                            for DeriveSharedSecretOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DeriveSharedSecretOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DeriveSharedSecretOutput::DeriveSharedSecretOutput{sharedSecret, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.DeriveSharedSecretOutput.DeriveSharedSecretOutput(")?;
                                        DafnyPrint::fmt_print(sharedSecret, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DeriveSharedSecretOutput {}

                        impl Hash
                            for DeriveSharedSecretOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DeriveSharedSecretOutput::DeriveSharedSecretOutput{sharedSecret, } => {
                                        Hash::hash(sharedSecret, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DeriveSharedSecretOutput {
                            fn default() -> DeriveSharedSecretOutput {
                                DeriveSharedSecretOutput::DeriveSharedSecretOutput {
                                    sharedSecret: Default::default()
                                }
                            }
                        }

                        impl AsRef<DeriveSharedSecretOutput>
                            for DeriveSharedSecretOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(495,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DigestAlgorithm {
                            SHA_512 {},
                            SHA_384 {},
                            SHA_256 {}
                        }

                        impl DigestAlgorithm {}

                        impl Debug
                            for DigestAlgorithm {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DigestAlgorithm {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DigestAlgorithm::SHA_512{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.DigestAlgorithm.SHA__512")?;
                                        Ok(())
                                    },
                                    DigestAlgorithm::SHA_384{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.DigestAlgorithm.SHA__384")?;
                                        Ok(())
                                    },
                                    DigestAlgorithm::SHA_256{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.DigestAlgorithm.SHA__256")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl DigestAlgorithm {
                            /// Enumerates all possible values of DigestAlgorithm
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DigestAlgorithm>> {
                                seq![Arc::new(DigestAlgorithm::SHA_512 {}), Arc::new(DigestAlgorithm::SHA_384 {}), Arc::new(DigestAlgorithm::SHA_256 {})].iter()
                            }
                        }

                        impl Eq
                            for DigestAlgorithm {}

                        impl Hash
                            for DigestAlgorithm {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DigestAlgorithm::SHA_512{} => {

                                    },
                                    DigestAlgorithm::SHA_384{} => {

                                    },
                                    DigestAlgorithm::SHA_256{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for DigestAlgorithm {
                            fn default() -> DigestAlgorithm {
                                DigestAlgorithm::SHA_512 {}
                            }
                        }

                        impl AsRef<DigestAlgorithm>
                            for DigestAlgorithm {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(499,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DigestInput {
                            DigestInput {
                                digestAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm>,
                                message: Sequence<u8>
                            }
                        }

                        impl DigestInput {
                            /// Returns a borrow of the field digestAlgorithm
                            pub fn digestAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm> {
                                match self {
                                    DigestInput::DigestInput{digestAlgorithm, message, } => digestAlgorithm,
                                }
                            }
                            /// Returns a borrow of the field message
                            pub fn message(&self) -> &Sequence<u8> {
                                match self {
                                    DigestInput::DigestInput{digestAlgorithm, message, } => message,
                                }
                            }
                        }

                        impl Debug
                            for DigestInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DigestInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DigestInput::DigestInput{digestAlgorithm, message, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.DigestInput.DigestInput(")?;
                                        DafnyPrint::fmt_print(digestAlgorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DigestInput {}

                        impl Hash
                            for DigestInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DigestInput::DigestInput{digestAlgorithm, message, } => {
                                        Hash::hash(digestAlgorithm, _state);
                                        Hash::hash(message, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DigestInput {
                            fn default() -> DigestInput {
                                DigestInput::DigestInput {
                                    digestAlgorithm: Default::default(),
                                    message: Default::default()
                                }
                            }
                        }

                        impl AsRef<DigestInput>
                            for DigestInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(503,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ECCPrivateKey {
                            ECCPrivateKey {
                                pem: Sequence<u8>
                            }
                        }

                        impl ECCPrivateKey {
                            /// Returns a borrow of the field pem
                            pub fn pem(&self) -> &Sequence<u8> {
                                match self {
                                    ECCPrivateKey::ECCPrivateKey{pem, } => pem,
                                }
                            }
                        }

                        impl Debug
                            for ECCPrivateKey {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ECCPrivateKey {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ECCPrivateKey::ECCPrivateKey{pem, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ECCPrivateKey.ECCPrivateKey(")?;
                                        DafnyPrint::fmt_print(pem, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ECCPrivateKey {}

                        impl Hash
                            for ECCPrivateKey {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ECCPrivateKey::ECCPrivateKey{pem, } => {
                                        Hash::hash(pem, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ECCPrivateKey {
                            fn default() -> ECCPrivateKey {
                                ECCPrivateKey::ECCPrivateKey {
                                    pem: Default::default()
                                }
                            }
                        }

                        impl AsRef<ECCPrivateKey>
                            for ECCPrivateKey {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(506,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ECCPublicKey {
                            ECCPublicKey {
                                der: Sequence<u8>
                            }
                        }

                        impl ECCPublicKey {
                            /// Returns a borrow of the field der
                            pub fn der(&self) -> &Sequence<u8> {
                                match self {
                                    ECCPublicKey::ECCPublicKey{der, } => der,
                                }
                            }
                        }

                        impl Debug
                            for ECCPublicKey {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ECCPublicKey {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ECCPublicKey::ECCPublicKey{der, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ECCPublicKey.ECCPublicKey(")?;
                                        DafnyPrint::fmt_print(der, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ECCPublicKey {}

                        impl Hash
                            for ECCPublicKey {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ECCPublicKey::ECCPublicKey{der, } => {
                                        Hash::hash(der, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ECCPublicKey {
                            fn default() -> ECCPublicKey {
                                ECCPublicKey::ECCPublicKey {
                                    der: Default::default()
                                }
                            }
                        }

                        impl AsRef<ECCPublicKey>
                            for ECCPublicKey {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(509,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ECDHCurveSpec {
                            ECC_NIST_P256 {},
                            ECC_NIST_P384 {},
                            ECC_NIST_P521 {},
                            SM2 {}
                        }

                        impl ECDHCurveSpec {}

                        impl Debug
                            for ECDHCurveSpec {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ECDHCurveSpec {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ECDHCurveSpec::ECC_NIST_P256{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ECDHCurveSpec.ECC__NIST__P256")?;
                                        Ok(())
                                    },
                                    ECDHCurveSpec::ECC_NIST_P384{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ECDHCurveSpec.ECC__NIST__P384")?;
                                        Ok(())
                                    },
                                    ECDHCurveSpec::ECC_NIST_P521{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ECDHCurveSpec.ECC__NIST__P521")?;
                                        Ok(())
                                    },
                                    ECDHCurveSpec::SM2{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ECDHCurveSpec.SM2")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl ECDHCurveSpec {
                            /// Enumerates all possible values of ECDHCurveSpec
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ECDHCurveSpec>> {
                                seq![Arc::new(ECDHCurveSpec::ECC_NIST_P256 {}), Arc::new(ECDHCurveSpec::ECC_NIST_P384 {}), Arc::new(ECDHCurveSpec::ECC_NIST_P521 {}), Arc::new(ECDHCurveSpec::SM2 {})].iter()
                            }
                        }

                        impl Eq
                            for ECDHCurveSpec {}

                        impl Hash
                            for ECDHCurveSpec {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ECDHCurveSpec::ECC_NIST_P256{} => {

                                    },
                                    ECDHCurveSpec::ECC_NIST_P384{} => {

                                    },
                                    ECDHCurveSpec::ECC_NIST_P521{} => {

                                    },
                                    ECDHCurveSpec::SM2{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for ECDHCurveSpec {
                            fn default() -> ECDHCurveSpec {
                                ECDHCurveSpec::ECC_NIST_P256 {}
                            }
                        }

                        impl AsRef<ECDHCurveSpec>
                            for ECDHCurveSpec {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(514,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ECDSASignatureAlgorithm {
                            ECDSA_P384 {},
                            ECDSA_P256 {}
                        }

                        impl ECDSASignatureAlgorithm {}

                        impl Debug
                            for ECDSASignatureAlgorithm {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ECDSASignatureAlgorithm {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ECDSASignatureAlgorithm::ECDSA_P384{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ECDSASignatureAlgorithm.ECDSA__P384")?;
                                        Ok(())
                                    },
                                    ECDSASignatureAlgorithm::ECDSA_P256{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ECDSASignatureAlgorithm.ECDSA__P256")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl ECDSASignatureAlgorithm {
                            /// Enumerates all possible values of ECDSASignatureAlgorithm
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ECDSASignatureAlgorithm>> {
                                seq![Arc::new(ECDSASignatureAlgorithm::ECDSA_P384 {}), Arc::new(ECDSASignatureAlgorithm::ECDSA_P256 {})].iter()
                            }
                        }

                        impl Eq
                            for ECDSASignatureAlgorithm {}

                        impl Hash
                            for ECDSASignatureAlgorithm {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ECDSASignatureAlgorithm::ECDSA_P384{} => {

                                    },
                                    ECDSASignatureAlgorithm::ECDSA_P256{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for ECDSASignatureAlgorithm {
                            fn default() -> ECDSASignatureAlgorithm {
                                ECDSASignatureAlgorithm::ECDSA_P384 {}
                            }
                        }

                        impl AsRef<ECDSASignatureAlgorithm>
                            for ECDSASignatureAlgorithm {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(517,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ECDSASignInput {
                            ECDSASignInput {
                                signatureAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm>,
                                signingKey: Sequence<u8>,
                                message: Sequence<u8>
                            }
                        }

                        impl ECDSASignInput {
                            /// Returns a borrow of the field signatureAlgorithm
                            pub fn signatureAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm> {
                                match self {
                                    ECDSASignInput::ECDSASignInput{signatureAlgorithm, signingKey, message, } => signatureAlgorithm,
                                }
                            }
                            /// Returns a borrow of the field signingKey
                            pub fn signingKey(&self) -> &Sequence<u8> {
                                match self {
                                    ECDSASignInput::ECDSASignInput{signatureAlgorithm, signingKey, message, } => signingKey,
                                }
                            }
                            /// Returns a borrow of the field message
                            pub fn message(&self) -> &Sequence<u8> {
                                match self {
                                    ECDSASignInput::ECDSASignInput{signatureAlgorithm, signingKey, message, } => message,
                                }
                            }
                        }

                        impl Debug
                            for ECDSASignInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ECDSASignInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ECDSASignInput::ECDSASignInput{signatureAlgorithm, signingKey, message, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ECDSASignInput.ECDSASignInput(")?;
                                        DafnyPrint::fmt_print(signatureAlgorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(signingKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ECDSASignInput {}

                        impl Hash
                            for ECDSASignInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ECDSASignInput::ECDSASignInput{signatureAlgorithm, signingKey, message, } => {
                                        Hash::hash(signatureAlgorithm, _state);
                                        Hash::hash(signingKey, _state);
                                        Hash::hash(message, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ECDSASignInput {
                            fn default() -> ECDSASignInput {
                                ECDSASignInput::ECDSASignInput {
                                    signatureAlgorithm: Default::default(),
                                    signingKey: Default::default(),
                                    message: Default::default()
                                }
                            }
                        }

                        impl AsRef<ECDSASignInput>
                            for ECDSASignInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(522,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ECDSAVerifyInput {
                            ECDSAVerifyInput {
                                signatureAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm>,
                                verificationKey: Sequence<u8>,
                                message: Sequence<u8>,
                                signature: Sequence<u8>
                            }
                        }

                        impl ECDSAVerifyInput {
                            /// Returns a borrow of the field signatureAlgorithm
                            pub fn signatureAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm> {
                                match self {
                                    ECDSAVerifyInput::ECDSAVerifyInput{signatureAlgorithm, verificationKey, message, signature, } => signatureAlgorithm,
                                }
                            }
                            /// Returns a borrow of the field verificationKey
                            pub fn verificationKey(&self) -> &Sequence<u8> {
                                match self {
                                    ECDSAVerifyInput::ECDSAVerifyInput{signatureAlgorithm, verificationKey, message, signature, } => verificationKey,
                                }
                            }
                            /// Returns a borrow of the field message
                            pub fn message(&self) -> &Sequence<u8> {
                                match self {
                                    ECDSAVerifyInput::ECDSAVerifyInput{signatureAlgorithm, verificationKey, message, signature, } => message,
                                }
                            }
                            /// Returns a borrow of the field signature
                            pub fn signature(&self) -> &Sequence<u8> {
                                match self {
                                    ECDSAVerifyInput::ECDSAVerifyInput{signatureAlgorithm, verificationKey, message, signature, } => signature,
                                }
                            }
                        }

                        impl Debug
                            for ECDSAVerifyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ECDSAVerifyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ECDSAVerifyInput::ECDSAVerifyInput{signatureAlgorithm, verificationKey, message, signature, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ECDSAVerifyInput.ECDSAVerifyInput(")?;
                                        DafnyPrint::fmt_print(signatureAlgorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(verificationKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(signature, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ECDSAVerifyInput {}

                        impl Hash
                            for ECDSAVerifyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ECDSAVerifyInput::ECDSAVerifyInput{signatureAlgorithm, verificationKey, message, signature, } => {
                                        Hash::hash(signatureAlgorithm, _state);
                                        Hash::hash(verificationKey, _state);
                                        Hash::hash(message, _state);
                                        Hash::hash(signature, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ECDSAVerifyInput {
                            fn default() -> ECDSAVerifyInput {
                                ECDSAVerifyInput::ECDSAVerifyInput {
                                    signatureAlgorithm: Default::default(),
                                    verificationKey: Default::default(),
                                    message: Default::default(),
                                    signature: Default::default()
                                }
                            }
                        }

                        impl AsRef<ECDSAVerifyInput>
                            for ECDSAVerifyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(528,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GenerateECCKeyPairInput {
                            GenerateECCKeyPairInput {
                                eccCurve: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec>
                            }
                        }

                        impl GenerateECCKeyPairInput {
                            /// Returns a borrow of the field eccCurve
                            pub fn eccCurve(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec> {
                                match self {
                                    GenerateECCKeyPairInput::GenerateECCKeyPairInput{eccCurve, } => eccCurve,
                                }
                            }
                        }

                        impl Debug
                            for GenerateECCKeyPairInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GenerateECCKeyPairInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GenerateECCKeyPairInput::GenerateECCKeyPairInput{eccCurve, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GenerateECCKeyPairInput.GenerateECCKeyPairInput(")?;
                                        DafnyPrint::fmt_print(eccCurve, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GenerateECCKeyPairInput {}

                        impl Hash
                            for GenerateECCKeyPairInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GenerateECCKeyPairInput::GenerateECCKeyPairInput{eccCurve, } => {
                                        Hash::hash(eccCurve, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GenerateECCKeyPairInput {
                            fn default() -> GenerateECCKeyPairInput {
                                GenerateECCKeyPairInput::GenerateECCKeyPairInput {
                                    eccCurve: Default::default()
                                }
                            }
                        }

                        impl AsRef<GenerateECCKeyPairInput>
                            for GenerateECCKeyPairInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(531,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GenerateECCKeyPairOutput {
                            GenerateECCKeyPairOutput {
                                eccCurve: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec>,
                                privateKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey>,
                                publicKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey>
                            }
                        }

                        impl GenerateECCKeyPairOutput {
                            /// Returns a borrow of the field eccCurve
                            pub fn eccCurve(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec> {
                                match self {
                                    GenerateECCKeyPairOutput::GenerateECCKeyPairOutput{eccCurve, privateKey, publicKey, } => eccCurve,
                                }
                            }
                            /// Returns a borrow of the field privateKey
                            pub fn privateKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey> {
                                match self {
                                    GenerateECCKeyPairOutput::GenerateECCKeyPairOutput{eccCurve, privateKey, publicKey, } => privateKey,
                                }
                            }
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey> {
                                match self {
                                    GenerateECCKeyPairOutput::GenerateECCKeyPairOutput{eccCurve, privateKey, publicKey, } => publicKey,
                                }
                            }
                        }

                        impl Debug
                            for GenerateECCKeyPairOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GenerateECCKeyPairOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GenerateECCKeyPairOutput::GenerateECCKeyPairOutput{eccCurve, privateKey, publicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GenerateECCKeyPairOutput.GenerateECCKeyPairOutput(")?;
                                        DafnyPrint::fmt_print(eccCurve, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(privateKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GenerateECCKeyPairOutput {}

                        impl Hash
                            for GenerateECCKeyPairOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GenerateECCKeyPairOutput::GenerateECCKeyPairOutput{eccCurve, privateKey, publicKey, } => {
                                        Hash::hash(eccCurve, _state);
                                        Hash::hash(privateKey, _state);
                                        Hash::hash(publicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GenerateECCKeyPairOutput {
                            fn default() -> GenerateECCKeyPairOutput {
                                GenerateECCKeyPairOutput::GenerateECCKeyPairOutput {
                                    eccCurve: Default::default(),
                                    privateKey: Default::default(),
                                    publicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<GenerateECCKeyPairOutput>
                            for GenerateECCKeyPairOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(536,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GenerateECDSASignatureKeyInput {
                            GenerateECDSASignatureKeyInput {
                                signatureAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm>
                            }
                        }

                        impl GenerateECDSASignatureKeyInput {
                            /// Returns a borrow of the field signatureAlgorithm
                            pub fn signatureAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm> {
                                match self {
                                    GenerateECDSASignatureKeyInput::GenerateECDSASignatureKeyInput{signatureAlgorithm, } => signatureAlgorithm,
                                }
                            }
                        }

                        impl Debug
                            for GenerateECDSASignatureKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GenerateECDSASignatureKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GenerateECDSASignatureKeyInput::GenerateECDSASignatureKeyInput{signatureAlgorithm, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GenerateECDSASignatureKeyInput.GenerateECDSASignatureKeyInput(")?;
                                        DafnyPrint::fmt_print(signatureAlgorithm, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GenerateECDSASignatureKeyInput {}

                        impl Hash
                            for GenerateECDSASignatureKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GenerateECDSASignatureKeyInput::GenerateECDSASignatureKeyInput{signatureAlgorithm, } => {
                                        Hash::hash(signatureAlgorithm, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GenerateECDSASignatureKeyInput {
                            fn default() -> GenerateECDSASignatureKeyInput {
                                GenerateECDSASignatureKeyInput::GenerateECDSASignatureKeyInput {
                                    signatureAlgorithm: Default::default()
                                }
                            }
                        }

                        impl AsRef<GenerateECDSASignatureKeyInput>
                            for GenerateECDSASignatureKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(539,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GenerateECDSASignatureKeyOutput {
                            GenerateECDSASignatureKeyOutput {
                                signatureAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm>,
                                verificationKey: Sequence<u8>,
                                signingKey: Sequence<u8>
                            }
                        }

                        impl GenerateECDSASignatureKeyOutput {
                            /// Returns a borrow of the field signatureAlgorithm
                            pub fn signatureAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm> {
                                match self {
                                    GenerateECDSASignatureKeyOutput::GenerateECDSASignatureKeyOutput{signatureAlgorithm, verificationKey, signingKey, } => signatureAlgorithm,
                                }
                            }
                            /// Returns a borrow of the field verificationKey
                            pub fn verificationKey(&self) -> &Sequence<u8> {
                                match self {
                                    GenerateECDSASignatureKeyOutput::GenerateECDSASignatureKeyOutput{signatureAlgorithm, verificationKey, signingKey, } => verificationKey,
                                }
                            }
                            /// Returns a borrow of the field signingKey
                            pub fn signingKey(&self) -> &Sequence<u8> {
                                match self {
                                    GenerateECDSASignatureKeyOutput::GenerateECDSASignatureKeyOutput{signatureAlgorithm, verificationKey, signingKey, } => signingKey,
                                }
                            }
                        }

                        impl Debug
                            for GenerateECDSASignatureKeyOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GenerateECDSASignatureKeyOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GenerateECDSASignatureKeyOutput::GenerateECDSASignatureKeyOutput{signatureAlgorithm, verificationKey, signingKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GenerateECDSASignatureKeyOutput.GenerateECDSASignatureKeyOutput(")?;
                                        DafnyPrint::fmt_print(signatureAlgorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(verificationKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(signingKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GenerateECDSASignatureKeyOutput {}

                        impl Hash
                            for GenerateECDSASignatureKeyOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GenerateECDSASignatureKeyOutput::GenerateECDSASignatureKeyOutput{signatureAlgorithm, verificationKey, signingKey, } => {
                                        Hash::hash(signatureAlgorithm, _state);
                                        Hash::hash(verificationKey, _state);
                                        Hash::hash(signingKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GenerateECDSASignatureKeyOutput {
                            fn default() -> GenerateECDSASignatureKeyOutput {
                                GenerateECDSASignatureKeyOutput::GenerateECDSASignatureKeyOutput {
                                    signatureAlgorithm: Default::default(),
                                    verificationKey: Default::default(),
                                    signingKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<GenerateECDSASignatureKeyOutput>
                            for GenerateECDSASignatureKeyOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(544,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GenerateRandomBytesInput {
                            GenerateRandomBytesInput {
                                length: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger
                            }
                        }

                        impl GenerateRandomBytesInput {
                            /// Returns a borrow of the field length
                            pub fn length(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger {
                                match self {
                                    GenerateRandomBytesInput::GenerateRandomBytesInput{length, } => length,
                                }
                            }
                        }

                        impl Debug
                            for GenerateRandomBytesInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GenerateRandomBytesInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GenerateRandomBytesInput::GenerateRandomBytesInput{length, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GenerateRandomBytesInput.GenerateRandomBytesInput(")?;
                                        DafnyPrint::fmt_print(length, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GenerateRandomBytesInput {}

                        impl Hash
                            for GenerateRandomBytesInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GenerateRandomBytesInput::GenerateRandomBytesInput{length, } => {
                                        Hash::hash(length, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GenerateRandomBytesInput {
                            fn default() -> GenerateRandomBytesInput {
                                GenerateRandomBytesInput::GenerateRandomBytesInput {
                                    length: Default::default()
                                }
                            }
                        }

                        impl AsRef<GenerateRandomBytesInput>
                            for GenerateRandomBytesInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(547,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GenerateRSAKeyPairInput {
                            GenerateRSAKeyPairInput {
                                lengthBits: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBitsToGenerate
                            }
                        }

                        impl GenerateRSAKeyPairInput {
                            /// Returns a borrow of the field lengthBits
                            pub fn lengthBits(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBitsToGenerate {
                                match self {
                                    GenerateRSAKeyPairInput::GenerateRSAKeyPairInput{lengthBits, } => lengthBits,
                                }
                            }
                        }

                        impl Debug
                            for GenerateRSAKeyPairInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GenerateRSAKeyPairInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GenerateRSAKeyPairInput::GenerateRSAKeyPairInput{lengthBits, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GenerateRSAKeyPairInput.GenerateRSAKeyPairInput(")?;
                                        DafnyPrint::fmt_print(lengthBits, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GenerateRSAKeyPairInput {}

                        impl Hash
                            for GenerateRSAKeyPairInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GenerateRSAKeyPairInput::GenerateRSAKeyPairInput{lengthBits, } => {
                                        Hash::hash(lengthBits, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GenerateRSAKeyPairInput {
                            fn default() -> GenerateRSAKeyPairInput {
                                GenerateRSAKeyPairInput::GenerateRSAKeyPairInput {
                                    lengthBits: Default::default()
                                }
                            }
                        }

                        impl AsRef<GenerateRSAKeyPairInput>
                            for GenerateRSAKeyPairInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(550,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GenerateRSAKeyPairOutput {
                            GenerateRSAKeyPairOutput {
                                publicKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPublicKey>,
                                privateKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPrivateKey>
                            }
                        }

                        impl GenerateRSAKeyPairOutput {
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPublicKey> {
                                match self {
                                    GenerateRSAKeyPairOutput::GenerateRSAKeyPairOutput{publicKey, privateKey, } => publicKey,
                                }
                            }
                            /// Returns a borrow of the field privateKey
                            pub fn privateKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPrivateKey> {
                                match self {
                                    GenerateRSAKeyPairOutput::GenerateRSAKeyPairOutput{publicKey, privateKey, } => privateKey,
                                }
                            }
                        }

                        impl Debug
                            for GenerateRSAKeyPairOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GenerateRSAKeyPairOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GenerateRSAKeyPairOutput::GenerateRSAKeyPairOutput{publicKey, privateKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GenerateRSAKeyPairOutput.GenerateRSAKeyPairOutput(")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(privateKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GenerateRSAKeyPairOutput {}

                        impl Hash
                            for GenerateRSAKeyPairOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GenerateRSAKeyPairOutput::GenerateRSAKeyPairOutput{publicKey, privateKey, } => {
                                        Hash::hash(publicKey, _state);
                                        Hash::hash(privateKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GenerateRSAKeyPairOutput {
                            fn default() -> GenerateRSAKeyPairOutput {
                                GenerateRSAKeyPairOutput::GenerateRSAKeyPairOutput {
                                    publicKey: Default::default(),
                                    privateKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<GenerateRSAKeyPairOutput>
                            for GenerateRSAKeyPairOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(554,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetPublicKeyFromPrivateKeyInput {
                            GetPublicKeyFromPrivateKeyInput {
                                eccCurve: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec>,
                                privateKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey>
                            }
                        }

                        impl GetPublicKeyFromPrivateKeyInput {
                            /// Returns a borrow of the field eccCurve
                            pub fn eccCurve(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec> {
                                match self {
                                    GetPublicKeyFromPrivateKeyInput::GetPublicKeyFromPrivateKeyInput{eccCurve, privateKey, } => eccCurve,
                                }
                            }
                            /// Returns a borrow of the field privateKey
                            pub fn privateKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey> {
                                match self {
                                    GetPublicKeyFromPrivateKeyInput::GetPublicKeyFromPrivateKeyInput{eccCurve, privateKey, } => privateKey,
                                }
                            }
                        }

                        impl Debug
                            for GetPublicKeyFromPrivateKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetPublicKeyFromPrivateKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetPublicKeyFromPrivateKeyInput::GetPublicKeyFromPrivateKeyInput{eccCurve, privateKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GetPublicKeyFromPrivateKeyInput.GetPublicKeyFromPrivateKeyInput(")?;
                                        DafnyPrint::fmt_print(eccCurve, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(privateKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetPublicKeyFromPrivateKeyInput {}

                        impl Hash
                            for GetPublicKeyFromPrivateKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetPublicKeyFromPrivateKeyInput::GetPublicKeyFromPrivateKeyInput{eccCurve, privateKey, } => {
                                        Hash::hash(eccCurve, _state);
                                        Hash::hash(privateKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetPublicKeyFromPrivateKeyInput {
                            fn default() -> GetPublicKeyFromPrivateKeyInput {
                                GetPublicKeyFromPrivateKeyInput::GetPublicKeyFromPrivateKeyInput {
                                    eccCurve: Default::default(),
                                    privateKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetPublicKeyFromPrivateKeyInput>
                            for GetPublicKeyFromPrivateKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(558,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetPublicKeyFromPrivateKeyOutput {
                            GetPublicKeyFromPrivateKeyOutput {
                                eccCurve: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec>,
                                privateKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey>,
                                publicKey: Sequence<u8>
                            }
                        }

                        impl GetPublicKeyFromPrivateKeyOutput {
                            /// Returns a borrow of the field eccCurve
                            pub fn eccCurve(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec> {
                                match self {
                                    GetPublicKeyFromPrivateKeyOutput::GetPublicKeyFromPrivateKeyOutput{eccCurve, privateKey, publicKey, } => eccCurve,
                                }
                            }
                            /// Returns a borrow of the field privateKey
                            pub fn privateKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey> {
                                match self {
                                    GetPublicKeyFromPrivateKeyOutput::GetPublicKeyFromPrivateKeyOutput{eccCurve, privateKey, publicKey, } => privateKey,
                                }
                            }
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Sequence<u8> {
                                match self {
                                    GetPublicKeyFromPrivateKeyOutput::GetPublicKeyFromPrivateKeyOutput{eccCurve, privateKey, publicKey, } => publicKey,
                                }
                            }
                        }

                        impl Debug
                            for GetPublicKeyFromPrivateKeyOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetPublicKeyFromPrivateKeyOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetPublicKeyFromPrivateKeyOutput::GetPublicKeyFromPrivateKeyOutput{eccCurve, privateKey, publicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GetPublicKeyFromPrivateKeyOutput.GetPublicKeyFromPrivateKeyOutput(")?;
                                        DafnyPrint::fmt_print(eccCurve, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(privateKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetPublicKeyFromPrivateKeyOutput {}

                        impl Hash
                            for GetPublicKeyFromPrivateKeyOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetPublicKeyFromPrivateKeyOutput::GetPublicKeyFromPrivateKeyOutput{eccCurve, privateKey, publicKey, } => {
                                        Hash::hash(eccCurve, _state);
                                        Hash::hash(privateKey, _state);
                                        Hash::hash(publicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetPublicKeyFromPrivateKeyOutput {
                            fn default() -> GetPublicKeyFromPrivateKeyOutput {
                                GetPublicKeyFromPrivateKeyOutput::GetPublicKeyFromPrivateKeyOutput {
                                    eccCurve: Default::default(),
                                    privateKey: Default::default(),
                                    publicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetPublicKeyFromPrivateKeyOutput>
                            for GetPublicKeyFromPrivateKeyOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(563,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetRSAKeyModulusLengthInput {
                            GetRSAKeyModulusLengthInput {
                                publicKey: Sequence<u8>
                            }
                        }

                        impl GetRSAKeyModulusLengthInput {
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Sequence<u8> {
                                match self {
                                    GetRSAKeyModulusLengthInput::GetRSAKeyModulusLengthInput{publicKey, } => publicKey,
                                }
                            }
                        }

                        impl Debug
                            for GetRSAKeyModulusLengthInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetRSAKeyModulusLengthInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetRSAKeyModulusLengthInput::GetRSAKeyModulusLengthInput{publicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GetRSAKeyModulusLengthInput.GetRSAKeyModulusLengthInput(")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetRSAKeyModulusLengthInput {}

                        impl Hash
                            for GetRSAKeyModulusLengthInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetRSAKeyModulusLengthInput::GetRSAKeyModulusLengthInput{publicKey, } => {
                                        Hash::hash(publicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetRSAKeyModulusLengthInput {
                            fn default() -> GetRSAKeyModulusLengthInput {
                                GetRSAKeyModulusLengthInput::GetRSAKeyModulusLengthInput {
                                    publicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetRSAKeyModulusLengthInput>
                            for GetRSAKeyModulusLengthInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(566,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetRSAKeyModulusLengthOutput {
                            GetRSAKeyModulusLengthOutput {
                                length: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBits
                            }
                        }

                        impl GetRSAKeyModulusLengthOutput {
                            /// Returns a borrow of the field length
                            pub fn length(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBits {
                                match self {
                                    GetRSAKeyModulusLengthOutput::GetRSAKeyModulusLengthOutput{length, } => length,
                                }
                            }
                        }

                        impl Debug
                            for GetRSAKeyModulusLengthOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetRSAKeyModulusLengthOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetRSAKeyModulusLengthOutput::GetRSAKeyModulusLengthOutput{length, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.GetRSAKeyModulusLengthOutput.GetRSAKeyModulusLengthOutput(")?;
                                        DafnyPrint::fmt_print(length, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetRSAKeyModulusLengthOutput {}

                        impl Hash
                            for GetRSAKeyModulusLengthOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetRSAKeyModulusLengthOutput::GetRSAKeyModulusLengthOutput{length, } => {
                                        Hash::hash(length, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetRSAKeyModulusLengthOutput {
                            fn default() -> GetRSAKeyModulusLengthOutput {
                                GetRSAKeyModulusLengthOutput::GetRSAKeyModulusLengthOutput {
                                    length: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetRSAKeyModulusLengthOutput>
                            for GetRSAKeyModulusLengthOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(569,3)
                        #[derive(PartialEq, Clone)]
                        pub enum HkdfExpandInput {
                            HkdfExpandInput {
                                digestAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm>,
                                prk: Sequence<u8>,
                                info: Sequence<u8>,
                                expectedLength: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger
                            }
                        }

                        impl HkdfExpandInput {
                            /// Returns a borrow of the field digestAlgorithm
                            pub fn digestAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm> {
                                match self {
                                    HkdfExpandInput::HkdfExpandInput{digestAlgorithm, prk, info, expectedLength, } => digestAlgorithm,
                                }
                            }
                            /// Returns a borrow of the field prk
                            pub fn prk(&self) -> &Sequence<u8> {
                                match self {
                                    HkdfExpandInput::HkdfExpandInput{digestAlgorithm, prk, info, expectedLength, } => prk,
                                }
                            }
                            /// Returns a borrow of the field info
                            pub fn info(&self) -> &Sequence<u8> {
                                match self {
                                    HkdfExpandInput::HkdfExpandInput{digestAlgorithm, prk, info, expectedLength, } => info,
                                }
                            }
                            /// Returns a borrow of the field expectedLength
                            pub fn expectedLength(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger {
                                match self {
                                    HkdfExpandInput::HkdfExpandInput{digestAlgorithm, prk, info, expectedLength, } => expectedLength,
                                }
                            }
                        }

                        impl Debug
                            for HkdfExpandInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for HkdfExpandInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    HkdfExpandInput::HkdfExpandInput{digestAlgorithm, prk, info, expectedLength, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.HkdfExpandInput.HkdfExpandInput(")?;
                                        DafnyPrint::fmt_print(digestAlgorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(prk, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(info, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(expectedLength, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for HkdfExpandInput {}

                        impl Hash
                            for HkdfExpandInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    HkdfExpandInput::HkdfExpandInput{digestAlgorithm, prk, info, expectedLength, } => {
                                        Hash::hash(digestAlgorithm, _state);
                                        Hash::hash(prk, _state);
                                        Hash::hash(info, _state);
                                        Hash::hash(expectedLength, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for HkdfExpandInput {
                            fn default() -> HkdfExpandInput {
                                HkdfExpandInput::HkdfExpandInput {
                                    digestAlgorithm: Default::default(),
                                    prk: Default::default(),
                                    info: Default::default(),
                                    expectedLength: Default::default()
                                }
                            }
                        }

                        impl AsRef<HkdfExpandInput>
                            for HkdfExpandInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(575,3)
                        #[derive(PartialEq, Clone)]
                        pub enum HkdfExtractInput {
                            HkdfExtractInput {
                                digestAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm>,
                                salt: Arc<Option<Sequence<u8>>>,
                                ikm: Sequence<u8>
                            }
                        }

                        impl HkdfExtractInput {
                            /// Returns a borrow of the field digestAlgorithm
                            pub fn digestAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm> {
                                match self {
                                    HkdfExtractInput::HkdfExtractInput{digestAlgorithm, salt, ikm, } => digestAlgorithm,
                                }
                            }
                            /// Returns a borrow of the field salt
                            pub fn salt(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    HkdfExtractInput::HkdfExtractInput{digestAlgorithm, salt, ikm, } => salt,
                                }
                            }
                            /// Returns a borrow of the field ikm
                            pub fn ikm(&self) -> &Sequence<u8> {
                                match self {
                                    HkdfExtractInput::HkdfExtractInput{digestAlgorithm, salt, ikm, } => ikm,
                                }
                            }
                        }

                        impl Debug
                            for HkdfExtractInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for HkdfExtractInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    HkdfExtractInput::HkdfExtractInput{digestAlgorithm, salt, ikm, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.HkdfExtractInput.HkdfExtractInput(")?;
                                        DafnyPrint::fmt_print(digestAlgorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(salt, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(ikm, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for HkdfExtractInput {}

                        impl Hash
                            for HkdfExtractInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    HkdfExtractInput::HkdfExtractInput{digestAlgorithm, salt, ikm, } => {
                                        Hash::hash(digestAlgorithm, _state);
                                        Hash::hash(salt, _state);
                                        Hash::hash(ikm, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for HkdfExtractInput {
                            fn default() -> HkdfExtractInput {
                                HkdfExtractInput::HkdfExtractInput {
                                    digestAlgorithm: Default::default(),
                                    salt: Default::default(),
                                    ikm: Default::default()
                                }
                            }
                        }

                        impl AsRef<HkdfExtractInput>
                            for HkdfExtractInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(580,3)
                        #[derive(PartialEq, Clone)]
                        pub enum HkdfInput {
                            HkdfInput {
                                digestAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm>,
                                salt: Arc<Option<Sequence<u8>>>,
                                ikm: Sequence<u8>,
                                info: Sequence<u8>,
                                expectedLength: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger
                            }
                        }

                        impl HkdfInput {
                            /// Returns a borrow of the field digestAlgorithm
                            pub fn digestAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm> {
                                match self {
                                    HkdfInput::HkdfInput{digestAlgorithm, salt, ikm, info, expectedLength, } => digestAlgorithm,
                                }
                            }
                            /// Returns a borrow of the field salt
                            pub fn salt(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    HkdfInput::HkdfInput{digestAlgorithm, salt, ikm, info, expectedLength, } => salt,
                                }
                            }
                            /// Returns a borrow of the field ikm
                            pub fn ikm(&self) -> &Sequence<u8> {
                                match self {
                                    HkdfInput::HkdfInput{digestAlgorithm, salt, ikm, info, expectedLength, } => ikm,
                                }
                            }
                            /// Returns a borrow of the field info
                            pub fn info(&self) -> &Sequence<u8> {
                                match self {
                                    HkdfInput::HkdfInput{digestAlgorithm, salt, ikm, info, expectedLength, } => info,
                                }
                            }
                            /// Returns a borrow of the field expectedLength
                            pub fn expectedLength(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger {
                                match self {
                                    HkdfInput::HkdfInput{digestAlgorithm, salt, ikm, info, expectedLength, } => expectedLength,
                                }
                            }
                        }

                        impl Debug
                            for HkdfInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for HkdfInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    HkdfInput::HkdfInput{digestAlgorithm, salt, ikm, info, expectedLength, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.HkdfInput.HkdfInput(")?;
                                        DafnyPrint::fmt_print(digestAlgorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(salt, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(ikm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(info, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(expectedLength, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for HkdfInput {}

                        impl Hash
                            for HkdfInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    HkdfInput::HkdfInput{digestAlgorithm, salt, ikm, info, expectedLength, } => {
                                        Hash::hash(digestAlgorithm, _state);
                                        Hash::hash(salt, _state);
                                        Hash::hash(ikm, _state);
                                        Hash::hash(info, _state);
                                        Hash::hash(expectedLength, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for HkdfInput {
                            fn default() -> HkdfInput {
                                HkdfInput::HkdfInput {
                                    digestAlgorithm: Default::default(),
                                    salt: Default::default(),
                                    ikm: Default::default(),
                                    info: Default::default(),
                                    expectedLength: Default::default()
                                }
                            }
                        }

                        impl AsRef<HkdfInput>
                            for HkdfInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(587,3)
                        #[derive(PartialEq, Clone)]
                        pub enum HMacInput {
                            HMacInput {
                                digestAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm>,
                                key: Sequence<u8>,
                                message: Sequence<u8>
                            }
                        }

                        impl HMacInput {
                            /// Returns a borrow of the field digestAlgorithm
                            pub fn digestAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm> {
                                match self {
                                    HMacInput::HMacInput{digestAlgorithm, key, message, } => digestAlgorithm,
                                }
                            }
                            /// Returns a borrow of the field key
                            pub fn key(&self) -> &Sequence<u8> {
                                match self {
                                    HMacInput::HMacInput{digestAlgorithm, key, message, } => key,
                                }
                            }
                            /// Returns a borrow of the field message
                            pub fn message(&self) -> &Sequence<u8> {
                                match self {
                                    HMacInput::HMacInput{digestAlgorithm, key, message, } => message,
                                }
                            }
                        }

                        impl Debug
                            for HMacInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for HMacInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    HMacInput::HMacInput{digestAlgorithm, key, message, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.HMacInput.HMacInput(")?;
                                        DafnyPrint::fmt_print(digestAlgorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(key, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for HMacInput {}

                        impl Hash
                            for HMacInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    HMacInput::HMacInput{digestAlgorithm, key, message, } => {
                                        Hash::hash(digestAlgorithm, _state);
                                        Hash::hash(key, _state);
                                        Hash::hash(message, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for HMacInput {
                            fn default() -> HMacInput {
                                HMacInput::HMacInput {
                                    digestAlgorithm: Default::default(),
                                    key: Default::default(),
                                    message: Default::default()
                                }
                            }
                        }

                        impl AsRef<HMacInput>
                            for HMacInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(592,3)
                        #[derive(PartialEq, Clone)]
                        pub enum KdfCtrInput {
                            KdfCtrInput {
                                digestAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm>,
                                ikm: Sequence<u8>,
                                expectedLength: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger,
                                purpose: Arc<Option<Sequence<u8>>>,
                                nonce: Arc<Option<Sequence<u8>>>
                            }
                        }

                        impl KdfCtrInput {
                            /// Returns a borrow of the field digestAlgorithm
                            pub fn digestAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm> {
                                match self {
                                    KdfCtrInput::KdfCtrInput{digestAlgorithm, ikm, expectedLength, purpose, nonce, } => digestAlgorithm,
                                }
                            }
                            /// Returns a borrow of the field ikm
                            pub fn ikm(&self) -> &Sequence<u8> {
                                match self {
                                    KdfCtrInput::KdfCtrInput{digestAlgorithm, ikm, expectedLength, purpose, nonce, } => ikm,
                                }
                            }
                            /// Returns a borrow of the field expectedLength
                            pub fn expectedLength(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger {
                                match self {
                                    KdfCtrInput::KdfCtrInput{digestAlgorithm, ikm, expectedLength, purpose, nonce, } => expectedLength,
                                }
                            }
                            /// Returns a borrow of the field purpose
                            pub fn purpose(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    KdfCtrInput::KdfCtrInput{digestAlgorithm, ikm, expectedLength, purpose, nonce, } => purpose,
                                }
                            }
                            /// Returns a borrow of the field nonce
                            pub fn nonce(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    KdfCtrInput::KdfCtrInput{digestAlgorithm, ikm, expectedLength, purpose, nonce, } => nonce,
                                }
                            }
                        }

                        impl Debug
                            for KdfCtrInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for KdfCtrInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    KdfCtrInput::KdfCtrInput{digestAlgorithm, ikm, expectedLength, purpose, nonce, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.KdfCtrInput.KdfCtrInput(")?;
                                        DafnyPrint::fmt_print(digestAlgorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(ikm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(expectedLength, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(purpose, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(nonce, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for KdfCtrInput {}

                        impl Hash
                            for KdfCtrInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    KdfCtrInput::KdfCtrInput{digestAlgorithm, ikm, expectedLength, purpose, nonce, } => {
                                        Hash::hash(digestAlgorithm, _state);
                                        Hash::hash(ikm, _state);
                                        Hash::hash(expectedLength, _state);
                                        Hash::hash(purpose, _state);
                                        Hash::hash(nonce, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for KdfCtrInput {
                            fn default() -> KdfCtrInput {
                                KdfCtrInput::KdfCtrInput {
                                    digestAlgorithm: Default::default(),
                                    ikm: Default::default(),
                                    expectedLength: Default::default(),
                                    purpose: Default::default(),
                                    nonce: Default::default()
                                }
                            }
                        }

                        impl AsRef<KdfCtrInput>
                            for KdfCtrInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(599,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ParsePublicKeyInput {
                            ParsePublicKeyInput {
                                publicKey: Sequence<u8>
                            }
                        }

                        impl ParsePublicKeyInput {
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Sequence<u8> {
                                match self {
                                    ParsePublicKeyInput::ParsePublicKeyInput{publicKey, } => publicKey,
                                }
                            }
                        }

                        impl Debug
                            for ParsePublicKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ParsePublicKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ParsePublicKeyInput::ParsePublicKeyInput{publicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ParsePublicKeyInput.ParsePublicKeyInput(")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ParsePublicKeyInput {}

                        impl Hash
                            for ParsePublicKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ParsePublicKeyInput::ParsePublicKeyInput{publicKey, } => {
                                        Hash::hash(publicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ParsePublicKeyInput {
                            fn default() -> ParsePublicKeyInput {
                                ParsePublicKeyInput::ParsePublicKeyInput {
                                    publicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<ParsePublicKeyInput>
                            for ParsePublicKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(602,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ParsePublicKeyOutput {
                            ParsePublicKeyOutput {
                                publicKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey>
                            }
                        }

                        impl ParsePublicKeyOutput {
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey> {
                                match self {
                                    ParsePublicKeyOutput::ParsePublicKeyOutput{publicKey, } => publicKey,
                                }
                            }
                        }

                        impl Debug
                            for ParsePublicKeyOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ParsePublicKeyOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ParsePublicKeyOutput::ParsePublicKeyOutput{publicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ParsePublicKeyOutput.ParsePublicKeyOutput(")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ParsePublicKeyOutput {}

                        impl Hash
                            for ParsePublicKeyOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ParsePublicKeyOutput::ParsePublicKeyOutput{publicKey, } => {
                                        Hash::hash(publicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ParsePublicKeyOutput {
                            fn default() -> ParsePublicKeyOutput {
                                ParsePublicKeyOutput::ParsePublicKeyOutput {
                                    publicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<ParsePublicKeyOutput>
                            for ParsePublicKeyOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(605,3)
                        pub type PositiveInteger = i32;

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(609,3)
                        #[derive(PartialEq, Clone)]
                        pub enum RSADecryptInput {
                            RSADecryptInput {
                                padding: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPaddingMode>,
                                privateKey: Sequence<u8>,
                                cipherText: Sequence<u8>
                            }
                        }

                        impl RSADecryptInput {
                            /// Returns a borrow of the field padding
                            pub fn padding(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPaddingMode> {
                                match self {
                                    RSADecryptInput::RSADecryptInput{padding, privateKey, cipherText, } => padding,
                                }
                            }
                            /// Returns a borrow of the field privateKey
                            pub fn privateKey(&self) -> &Sequence<u8> {
                                match self {
                                    RSADecryptInput::RSADecryptInput{padding, privateKey, cipherText, } => privateKey,
                                }
                            }
                            /// Returns a borrow of the field cipherText
                            pub fn cipherText(&self) -> &Sequence<u8> {
                                match self {
                                    RSADecryptInput::RSADecryptInput{padding, privateKey, cipherText, } => cipherText,
                                }
                            }
                        }

                        impl Debug
                            for RSADecryptInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for RSADecryptInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    RSADecryptInput::RSADecryptInput{padding, privateKey, cipherText, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.RSADecryptInput.RSADecryptInput(")?;
                                        DafnyPrint::fmt_print(padding, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(privateKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(cipherText, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for RSADecryptInput {}

                        impl Hash
                            for RSADecryptInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    RSADecryptInput::RSADecryptInput{padding, privateKey, cipherText, } => {
                                        Hash::hash(padding, _state);
                                        Hash::hash(privateKey, _state);
                                        Hash::hash(cipherText, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for RSADecryptInput {
                            fn default() -> RSADecryptInput {
                                RSADecryptInput::RSADecryptInput {
                                    padding: Default::default(),
                                    privateKey: Default::default(),
                                    cipherText: Default::default()
                                }
                            }
                        }

                        impl AsRef<RSADecryptInput>
                            for RSADecryptInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(614,3)
                        #[derive(PartialEq, Clone)]
                        pub enum RSAEncryptInput {
                            RSAEncryptInput {
                                padding: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPaddingMode>,
                                publicKey: Sequence<u8>,
                                plaintext: Sequence<u8>
                            }
                        }

                        impl RSAEncryptInput {
                            /// Returns a borrow of the field padding
                            pub fn padding(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPaddingMode> {
                                match self {
                                    RSAEncryptInput::RSAEncryptInput{padding, publicKey, plaintext, } => padding,
                                }
                            }
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Sequence<u8> {
                                match self {
                                    RSAEncryptInput::RSAEncryptInput{padding, publicKey, plaintext, } => publicKey,
                                }
                            }
                            /// Returns a borrow of the field plaintext
                            pub fn plaintext(&self) -> &Sequence<u8> {
                                match self {
                                    RSAEncryptInput::RSAEncryptInput{padding, publicKey, plaintext, } => plaintext,
                                }
                            }
                        }

                        impl Debug
                            for RSAEncryptInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for RSAEncryptInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    RSAEncryptInput::RSAEncryptInput{padding, publicKey, plaintext, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.RSAEncryptInput.RSAEncryptInput(")?;
                                        DafnyPrint::fmt_print(padding, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(plaintext, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for RSAEncryptInput {}

                        impl Hash
                            for RSAEncryptInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    RSAEncryptInput::RSAEncryptInput{padding, publicKey, plaintext, } => {
                                        Hash::hash(padding, _state);
                                        Hash::hash(publicKey, _state);
                                        Hash::hash(plaintext, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for RSAEncryptInput {
                            fn default() -> RSAEncryptInput {
                                RSAEncryptInput::RSAEncryptInput {
                                    padding: Default::default(),
                                    publicKey: Default::default(),
                                    plaintext: Default::default()
                                }
                            }
                        }

                        impl AsRef<RSAEncryptInput>
                            for RSAEncryptInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(619,3)
                        pub type RSAModulusLengthBits = i32;

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(623,3)
                        pub type RSAModulusLengthBitsToGenerate = i32;

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(627,3)
                        #[derive(PartialEq, Clone)]
                        pub enum RSAPaddingMode {
                            PKCS1 {},
                            OAEP_SHA1 {},
                            OAEP_SHA256 {},
                            OAEP_SHA384 {},
                            OAEP_SHA512 {}
                        }

                        impl RSAPaddingMode {}

                        impl Debug
                            for RSAPaddingMode {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for RSAPaddingMode {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    RSAPaddingMode::PKCS1{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.RSAPaddingMode.PKCS1")?;
                                        Ok(())
                                    },
                                    RSAPaddingMode::OAEP_SHA1{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.RSAPaddingMode.OAEP__SHA1")?;
                                        Ok(())
                                    },
                                    RSAPaddingMode::OAEP_SHA256{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.RSAPaddingMode.OAEP__SHA256")?;
                                        Ok(())
                                    },
                                    RSAPaddingMode::OAEP_SHA384{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.RSAPaddingMode.OAEP__SHA384")?;
                                        Ok(())
                                    },
                                    RSAPaddingMode::OAEP_SHA512{} => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.RSAPaddingMode.OAEP__SHA512")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl RSAPaddingMode {
                            /// Enumerates all possible values of RSAPaddingMode
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<RSAPaddingMode>> {
                                seq![Arc::new(RSAPaddingMode::PKCS1 {}), Arc::new(RSAPaddingMode::OAEP_SHA1 {}), Arc::new(RSAPaddingMode::OAEP_SHA256 {}), Arc::new(RSAPaddingMode::OAEP_SHA384 {}), Arc::new(RSAPaddingMode::OAEP_SHA512 {})].iter()
                            }
                        }

                        impl Eq
                            for RSAPaddingMode {}

                        impl Hash
                            for RSAPaddingMode {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    RSAPaddingMode::PKCS1{} => {

                                    },
                                    RSAPaddingMode::OAEP_SHA1{} => {

                                    },
                                    RSAPaddingMode::OAEP_SHA256{} => {

                                    },
                                    RSAPaddingMode::OAEP_SHA384{} => {

                                    },
                                    RSAPaddingMode::OAEP_SHA512{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for RSAPaddingMode {
                            fn default() -> RSAPaddingMode {
                                RSAPaddingMode::PKCS1 {}
                            }
                        }

                        impl AsRef<RSAPaddingMode>
                            for RSAPaddingMode {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(633,3)
                        #[derive(PartialEq, Clone)]
                        pub enum RSAPrivateKey {
                            RSAPrivateKey {
                                lengthBits: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBits,
                                pem: Sequence<u8>
                            }
                        }

                        impl RSAPrivateKey {
                            /// Returns a borrow of the field lengthBits
                            pub fn lengthBits(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBits {
                                match self {
                                    RSAPrivateKey::RSAPrivateKey{lengthBits, pem, } => lengthBits,
                                }
                            }
                            /// Returns a borrow of the field pem
                            pub fn pem(&self) -> &Sequence<u8> {
                                match self {
                                    RSAPrivateKey::RSAPrivateKey{lengthBits, pem, } => pem,
                                }
                            }
                        }

                        impl Debug
                            for RSAPrivateKey {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for RSAPrivateKey {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    RSAPrivateKey::RSAPrivateKey{lengthBits, pem, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.RSAPrivateKey.RSAPrivateKey(")?;
                                        DafnyPrint::fmt_print(lengthBits, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(pem, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for RSAPrivateKey {}

                        impl Hash
                            for RSAPrivateKey {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    RSAPrivateKey::RSAPrivateKey{lengthBits, pem, } => {
                                        Hash::hash(lengthBits, _state);
                                        Hash::hash(pem, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for RSAPrivateKey {
                            fn default() -> RSAPrivateKey {
                                RSAPrivateKey::RSAPrivateKey {
                                    lengthBits: Default::default(),
                                    pem: Default::default()
                                }
                            }
                        }

                        impl AsRef<RSAPrivateKey>
                            for RSAPrivateKey {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(637,3)
                        #[derive(PartialEq, Clone)]
                        pub enum RSAPublicKey {
                            RSAPublicKey {
                                lengthBits: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBits,
                                pem: Sequence<u8>
                            }
                        }

                        impl RSAPublicKey {
                            /// Returns a borrow of the field lengthBits
                            pub fn lengthBits(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBits {
                                match self {
                                    RSAPublicKey::RSAPublicKey{lengthBits, pem, } => lengthBits,
                                }
                            }
                            /// Returns a borrow of the field pem
                            pub fn pem(&self) -> &Sequence<u8> {
                                match self {
                                    RSAPublicKey::RSAPublicKey{lengthBits, pem, } => pem,
                                }
                            }
                        }

                        impl Debug
                            for RSAPublicKey {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for RSAPublicKey {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    RSAPublicKey::RSAPublicKey{lengthBits, pem, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.RSAPublicKey.RSAPublicKey(")?;
                                        DafnyPrint::fmt_print(lengthBits, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(pem, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for RSAPublicKey {}

                        impl Hash
                            for RSAPublicKey {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    RSAPublicKey::RSAPublicKey{lengthBits, pem, } => {
                                        Hash::hash(lengthBits, _state);
                                        Hash::hash(pem, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for RSAPublicKey {
                            fn default() -> RSAPublicKey {
                                RSAPublicKey::RSAPublicKey {
                                    lengthBits: Default::default(),
                                    pem: Default::default()
                                }
                            }
                        }

                        impl AsRef<RSAPublicKey>
                            for RSAPublicKey {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(641,3)
                        pub type SymmetricKeyLength = i32;

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(645,3)
                        pub type Uint8Bits = i32;

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(649,3)
                        pub type Uint8Bytes = i32;

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(653,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ValidatePublicKeyInput {
                            ValidatePublicKeyInput {
                                eccCurve: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec>,
                                publicKey: Sequence<u8>
                            }
                        }

                        impl ValidatePublicKeyInput {
                            /// Returns a borrow of the field eccCurve
                            pub fn eccCurve(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec> {
                                match self {
                                    ValidatePublicKeyInput::ValidatePublicKeyInput{eccCurve, publicKey, } => eccCurve,
                                }
                            }
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Sequence<u8> {
                                match self {
                                    ValidatePublicKeyInput::ValidatePublicKeyInput{eccCurve, publicKey, } => publicKey,
                                }
                            }
                        }

                        impl Debug
                            for ValidatePublicKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ValidatePublicKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ValidatePublicKeyInput::ValidatePublicKeyInput{eccCurve, publicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ValidatePublicKeyInput.ValidatePublicKeyInput(")?;
                                        DafnyPrint::fmt_print(eccCurve, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ValidatePublicKeyInput {}

                        impl Hash
                            for ValidatePublicKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ValidatePublicKeyInput::ValidatePublicKeyInput{eccCurve, publicKey, } => {
                                        Hash::hash(eccCurve, _state);
                                        Hash::hash(publicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ValidatePublicKeyInput {
                            fn default() -> ValidatePublicKeyInput {
                                ValidatePublicKeyInput::ValidatePublicKeyInput {
                                    eccCurve: Default::default(),
                                    publicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<ValidatePublicKeyInput>
                            for ValidatePublicKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(657,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ValidatePublicKeyOutput {
                            ValidatePublicKeyOutput {
                                success: bool
                            }
                        }

                        impl ValidatePublicKeyOutput {
                            /// Returns a borrow of the field success
                            pub fn success(&self) -> &bool {
                                match self {
                                    ValidatePublicKeyOutput::ValidatePublicKeyOutput{success, } => success,
                                }
                            }
                        }

                        impl Debug
                            for ValidatePublicKeyOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ValidatePublicKeyOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ValidatePublicKeyOutput::ValidatePublicKeyOutput{success, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.ValidatePublicKeyOutput.ValidatePublicKeyOutput(")?;
                                        DafnyPrint::fmt_print(success, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ValidatePublicKeyOutput {}

                        impl Hash
                            for ValidatePublicKeyOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ValidatePublicKeyOutput::ValidatePublicKeyOutput{success, } => {
                                        Hash::hash(success, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ValidatePublicKeyOutput {
                            fn default() -> ValidatePublicKeyOutput {
                                ValidatePublicKeyOutput::ValidatePublicKeyOutput {
                                    success: Default::default()
                                }
                            }
                        }

                        impl AsRef<ValidatePublicKeyOutput>
                            for ValidatePublicKeyOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(660,3)
                        #[derive(PartialEq, Clone)]
                        pub enum Error {
                            AwsCryptographicPrimitivesError {
                                message: Sequence<DafnyCharUTF16>
                            },
                            CollectionOfErrors {
                                list: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>,
                                message: Sequence<DafnyCharUTF16>
                            },
                            Opaque {
                                obj: Object<dyn Any + Sync + Send>
                            },
                            OpaqueWithText {
                                obj: Object<dyn Any + Sync + Send>,
                                objMessage: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl Error {
                            /// Gets the field message for all enum members which have it
                            pub fn message(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    Error::AwsCryptographicPrimitivesError{message, } => message,
                                    Error::CollectionOfErrors{list, message, } => message,
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field list for all enum members which have it
                            pub fn list(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>> {
                                match self {
                                    Error::AwsCryptographicPrimitivesError{message, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => list,
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field obj for all enum members which have it
                            pub fn obj(&self) -> &Object<dyn Any + Sync + Send> {
                                match self {
                                    Error::AwsCryptographicPrimitivesError{message, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => obj,
                                    Error::OpaqueWithText{obj, objMessage, } => obj,
                                }
                            }
                            /// Gets the field objMessage for all enum members which have it
                            pub fn objMessage(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    Error::AwsCryptographicPrimitivesError{message, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => objMessage,
                                }
                            }
                        }

                        impl Debug
                            for Error {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for Error {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    Error::AwsCryptographicPrimitivesError{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.Error.AwsCryptographicPrimitivesError(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::CollectionOfErrors{list, message, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.Error.CollectionOfErrors(")?;
                                        DafnyPrint::fmt_print(list, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::Opaque{obj, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.Error.Opaque(")?;
                                        DafnyPrint::fmt_print(obj, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::OpaqueWithText{obj, objMessage, } => {
                                        write!(_formatter, "software.amazon.cryptography.primitives.internaldafny.types.Error.OpaqueWithText(")?;
                                        DafnyPrint::fmt_print(obj, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(objMessage, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for Error {}

                        impl Hash
                            for Error {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    Error::AwsCryptographicPrimitivesError{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::CollectionOfErrors{list, message, } => {
                                        Hash::hash(list, _state);
                                        Hash::hash(message, _state)
                                    },
                                    Error::Opaque{obj, } => {
                                        Hash::hash(obj, _state)
                                    },
                                    Error::OpaqueWithText{obj, objMessage, } => {
                                        Hash::hash(obj, _state);
                                        Hash::hash(objMessage, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for Error {
                            fn default() -> Error {
                                Error::AwsCryptographicPrimitivesError {
                                    message: Default::default()
                                }
                            }
                        }

                        impl AsRef<Error>
                            for Error {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(695,3)
                        pub type OpaqueError = Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>;

                        /// ../mpl/AwsCryptographyPrimitives/Model/AwsCryptographyPrimitivesTypes.dfy(698,3)
                        pub type DummySubsetType = DafnyInt;

                        /// An element of DummySubsetType
                        pub fn __init_DummySubsetType() -> DafnyInt {
                            int!(1)
                        }
                    }
                }
            }

            pub mod encryptionsdk {
                /// dafny/AwsEncryptionSdk/src/Index.dfy(6,1)
                pub mod internaldafny {
                    pub use ::std::sync::Arc;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::AwsEncryptionSdkConfig;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::NetV4_0_0_RetryPolicy;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                    pub use ::dafny_runtime::Object;
                    pub use ::dafny_runtime::MaybePlacebo;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
                    pub use ::dafny_runtime::upcast_object;
                    pub use ::dafny_runtime::cast_object;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IAwsCryptographicMaterialProvidersClient;
                    pub use crate::implementation_from_dafny::_AwsEncryptionSdkOperations_Compile::Config;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::IAwsEncryptionSdkClient;
                    pub use ::dafny_runtime::allocate_object;
                    pub use ::dafny_runtime::update_field_uninit_object;
                    pub use ::dafny_runtime::UpcastObject;
                    pub use ::dafny_runtime::DynAny;
                    pub use ::dafny_runtime::UpcastObjectFn;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptOutput;

                    pub struct _default {}

                    impl _default {
                        /// dafny/AwsEncryptionSdk/src/Index.dfy(14,3)
                        pub fn DefaultAwsEncryptionSdkConfig() -> Arc<AwsEncryptionSdkConfig> {
                            Arc::new(AwsEncryptionSdkConfig::AwsEncryptionSdkConfig {
                                    commitmentPolicy: Arc::new(Option::<Arc<ESDKCommitmentPolicy>>::Some {
                                                value: Arc::new(ESDKCommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT {})
                                            }),
                                    maxEncryptedDataKeys: Arc::new(Option::<CountingNumbers>::None {}),
                                    netV4_0_0_RetryPolicy: Arc::new(Option::<Arc<NetV4_0_0_RetryPolicy>>::Some {
                                                value: Arc::new(NetV4_0_0_RetryPolicy::ALLOW_RETRY {})
                                            })
                                })
                        }
                        /// dafny/AwsEncryptionSdk/src/Index.dfy(23,3)
                        pub fn ESDK(config: &Arc<AwsEncryptionSdkConfig>) -> Arc<Result<Object<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
                            let mut res = MaybePlacebo::<Arc<Result<Object<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
                            let mut maybeCrypto: Arc<Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::AtomicPrimitives(&crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::DefaultCryptoConfig());
                            maybeCrypto = _out0.clone();
                            let mut valueOrError0: Arc<Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeCrypto.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                                        AwsCryptographyPrimitives: e.clone()
                                                    })
                                            })
                                    }));
                            if valueOrError0.IsFailure() {
                                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient>>());
                                return res.read();
                            };
                            let mut cryptoX: Object<dyn IAwsCryptographicPrimitivesClient> = upcast_object::<AtomicPrimitivesClient, dyn IAwsCryptographicPrimitivesClient>()(valueOrError0.Extract());
                            let mut crypto: Object<AtomicPrimitivesClient> = cast_object!(cryptoX.clone(), AtomicPrimitivesClient);
                            let mut maybeMpl: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out1 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
                            maybeMpl = _out1.clone();
                            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeMpl.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                                        AwsCryptographyMaterialProviders: e.clone()
                                                    })
                                            })
                                    }));
                            if valueOrError1.IsFailure() {
                                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient>>());
                                return res.read();
                            };
                            let mut mplX: Object<dyn IAwsCryptographicMaterialProvidersClient> = upcast_object::<MaterialProvidersClient, dyn IAwsCryptographicMaterialProvidersClient>()(valueOrError1.Extract());
                            let mut mpl: Object<MaterialProvidersClient> = cast_object!(mplX.clone(), MaterialProvidersClient);
                            let mut internalConfig: Arc<Config> = Arc::new(Config::Config {
                                        crypto: crypto.clone(),
                                        mpl: mpl.clone(),
                                        commitmentPolicy: config.commitmentPolicy().UnwrapOr(&Arc::new(ESDKCommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT {})),
                                        maxEncryptedDataKeys: config.maxEncryptedDataKeys().clone(),
                                        netV4_0_0_RetryPolicy: config.netV4_0_0_RetryPolicy().UnwrapOr(&Arc::new(NetV4_0_0_RetryPolicy::ALLOW_RETRY {}))
                                    });
                            let mut client: Object<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient>;
                            let mut _nw0: Object<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient::_allocate_object();
                            crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient::_ctor(&_nw0, &internalConfig);
                            client = _nw0.clone();
                            res = MaybePlacebo::from(Arc::new(Result::<Object<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                                            value: client.clone()
                                        }));
                            return res.read();
                        }
                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(207,3)
                        pub fn CreateSuccessOfClient(client: &Object<dyn IAwsEncryptionSdkClient>) -> Arc<Result<Object<dyn IAwsEncryptionSdkClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
                            Arc::new(Result::<Object<dyn IAwsEncryptionSdkClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                                    value: client.clone()
                                })
                        }
                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(210,3)
                        pub fn CreateFailureOfError(error: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>) -> Arc<Result<Object<dyn IAwsEncryptionSdkClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
                            Arc::new(Result::<Object<dyn IAwsEncryptionSdkClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Failure {
                                    error: error.clone()
                                })
                        }
                    }

                    /// dafny/AwsEncryptionSdk/src/Index.dfy(49,3)
                    pub struct ESDKClient {
                        pub __i_config: Arc<Config>
                    }

                    impl ESDKClient {
                        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                        pub fn _allocate_object() -> Object<Self> {
                            allocate_object::<Self>()
                        }
                        /// dafny/AwsEncryptionSdk/src/Index.dfy(57,5)
                        pub fn _ctor(this: &Object<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient>, config: &Arc<Config>) -> () {
                            let mut _set___i_config: bool = false;
                            update_field_uninit_object!(this.clone(), __i_config, _set___i_config, config.clone());
                            return ();
                        }
                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(221,5)
                        pub fn config(&self) -> Arc<Config> {
                            self.__i_config.clone()
                        }
                    }

                    impl UpcastObject<DynAny>
                        for crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient {
                        UpcastObjectFn!(DynAny);
                    }

                    impl IAwsEncryptionSdkClient
                        for crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient {
                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(230,5)
                        fn Encrypt(&self, input: &Arc<EncryptInput>) -> Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsEncryptionSdkOperations_Compile::_default::Encrypt(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(260,5)
                        fn Decrypt(&self, input: &Arc<DecryptInput>) -> Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsEncryptionSdkOperations_Compile::_default::Decrypt(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                    }

                    impl UpcastObject<dyn IAwsEncryptionSdkClient>
                        for crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient {
                        UpcastObjectFn!(dyn IAwsEncryptionSdkClient);
                    }

                    /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(7,1)
                    pub mod types {
                        pub use ::dafny_runtime::truncate;
                        pub use ::dafny_runtime::int;
                        pub use ::dafny_runtime::DafnyInt;
                        pub use ::dafny_runtime::DafnyType;
                        pub use ::std::fmt::Debug;
                        pub use ::std::fmt::Formatter;
                        pub use ::dafny_runtime::DafnyPrint;
                        pub use ::std::cmp::Eq;
                        pub use ::std::hash::Hash;
                        pub use ::std::hash::Hasher;
                        pub use ::std::default::Default;
                        pub use ::std::convert::AsRef;
                        pub use ::dafny_runtime::Object;
                        pub use ::dafny_runtime::allocate_object;
                        pub use ::dafny_runtime::UpcastObject;
                        pub use ::dafny_runtime::DynAny;
                        pub use ::dafny_runtime::UpcastObjectFn;
                        pub use ::dafny_runtime::Any;
                        pub use ::std::marker::Sync;
                        pub use ::std::marker::Send;
                        pub use ::std::sync::Arc;
                        pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy;
                        pub use ::dafny_runtime::Sequence;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
                        pub use ::dafny_runtime::Map;
                        pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId;
                        pub use ::dafny_runtime::SequenceIter;
                        pub use ::dafny_runtime::seq;
                        pub use ::dafny_runtime::DafnyCharUTF16;

                        pub struct _default {}

                        impl _default {
                            /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(111,3)
                            pub fn IsValid_CountingNumbers(x: i64) -> bool {
                                !(x < truncate!(int!(1), i64))
                            }
                            /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(139,3)
                            pub fn IsValid_FrameLength(x: i64) -> bool {
                                !(x < truncate!(int!(1), i64)) && !(truncate!(int!(b"4294967296"), i64) < x)
                            }
                            /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(185,3)
                            pub fn IsDummySubsetType(x: &DafnyInt) -> bool {
                                int!(0) < x.clone()
                            }
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(15,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DafnyCallEvent<I: DafnyType, O: DafnyType> {
                            DafnyCallEvent {
                                input: I,
                                output: O
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> DafnyCallEvent<I, O> {
                            /// Returns a borrow of the field input
                            pub fn input(&self) -> &I {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => input,
                                }
                            }
                            /// Returns a borrow of the field output
                            pub fn output(&self) -> &O {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => output,
                                }
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> Debug
                            for DafnyCallEvent<I, O> {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> DafnyPrint
                            for DafnyCallEvent<I, O> {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.DafnyCallEvent.DafnyCallEvent(")?;
                                        DafnyPrint::fmt_print(input, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(output, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl<I: DafnyType + Eq, O: DafnyType + Eq> Eq
                            for DafnyCallEvent<I, O> {}

                        impl<I: DafnyType + Hash, O: DafnyType + Hash> Hash
                            for DafnyCallEvent<I, O> {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                        Hash::hash(input, _state);
                                        Hash::hash(output, _state)
                                    },
                                }
                            }
                        }

                        impl<I: DafnyType + Default, O: DafnyType + Default> Default
                            for DafnyCallEvent<I, O> {
                            fn default() -> DafnyCallEvent<I, O> {
                                DafnyCallEvent::DafnyCallEvent {
                                    input: Default::default(),
                                    output: Default::default()
                                }
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> AsRef<DafnyCallEvent<I, O>>
                            for DafnyCallEvent<I, O> {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(19,3)
                        pub struct IAwsEncryptionSdkClientCallHistory {}

                        impl IAwsEncryptionSdkClientCallHistory {
                            /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                            pub fn _allocate_object() -> Object<Self> {
                                allocate_object::<Self>()
                            }
                        }

                        impl UpcastObject<DynAny>
                            for crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::IAwsEncryptionSdkClientCallHistory {
                            UpcastObjectFn!(DynAny);
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(27,3)
                        pub trait IAwsEncryptionSdkClient: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                            /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(56,5)
                            fn Encrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                            /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(81,5)
                            fn Decrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(105,3)
                        #[derive(PartialEq, Clone)]
                        pub enum AwsEncryptionSdkConfig {
                            AwsEncryptionSdkConfig {
                                commitmentPolicy: Arc<Option<Arc<ESDKCommitmentPolicy>>>,
                                maxEncryptedDataKeys: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers>>,
                                netV4_0_0_RetryPolicy: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::NetV4_0_0_RetryPolicy>>>
                            }
                        }

                        impl AwsEncryptionSdkConfig {
                            /// Returns a borrow of the field commitmentPolicy
                            pub fn commitmentPolicy(&self) -> &Arc<Option<Arc<ESDKCommitmentPolicy>>> {
                                match self {
                                    AwsEncryptionSdkConfig::AwsEncryptionSdkConfig{commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => commitmentPolicy,
                                }
                            }
                            /// Returns a borrow of the field maxEncryptedDataKeys
                            pub fn maxEncryptedDataKeys(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers>> {
                                match self {
                                    AwsEncryptionSdkConfig::AwsEncryptionSdkConfig{commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => maxEncryptedDataKeys,
                                }
                            }
                            /// Returns a borrow of the field netV4_0_0_RetryPolicy
                            pub fn netV4_0_0_RetryPolicy(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::NetV4_0_0_RetryPolicy>>> {
                                match self {
                                    AwsEncryptionSdkConfig::AwsEncryptionSdkConfig{commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => netV4_0_0_RetryPolicy,
                                }
                            }
                        }

                        impl Debug
                            for AwsEncryptionSdkConfig {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for AwsEncryptionSdkConfig {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    AwsEncryptionSdkConfig::AwsEncryptionSdkConfig{commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.AwsEncryptionSdkConfig.AwsEncryptionSdkConfig(")?;
                                        DafnyPrint::fmt_print(commitmentPolicy, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(maxEncryptedDataKeys, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(netV4_0_0_RetryPolicy, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for AwsEncryptionSdkConfig {}

                        impl Hash
                            for AwsEncryptionSdkConfig {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    AwsEncryptionSdkConfig::AwsEncryptionSdkConfig{commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => {
                                        Hash::hash(commitmentPolicy, _state);
                                        Hash::hash(maxEncryptedDataKeys, _state);
                                        Hash::hash(netV4_0_0_RetryPolicy, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for AwsEncryptionSdkConfig {
                            fn default() -> AwsEncryptionSdkConfig {
                                AwsEncryptionSdkConfig::AwsEncryptionSdkConfig {
                                    commitmentPolicy: Default::default(),
                                    maxEncryptedDataKeys: Default::default(),
                                    netV4_0_0_RetryPolicy: Default::default()
                                }
                            }
                        }

                        impl AsRef<AwsEncryptionSdkConfig>
                            for AwsEncryptionSdkConfig {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(110,3)
                        pub type CountingNumbers = i64;

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(114,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DecryptInput {
                            DecryptInput {
                                ciphertext: Sequence<u8>,
                                materialsManager: Arc<Option<Object<dyn ICryptographicMaterialsManager>>>,
                                keyring: Arc<Option<Object<dyn IKeyring>>>,
                                encryptionContext: Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>>
                            }
                        }

                        impl DecryptInput {
                            /// Returns a borrow of the field ciphertext
                            pub fn ciphertext(&self) -> &Sequence<u8> {
                                match self {
                                    DecryptInput::DecryptInput{ciphertext, materialsManager, keyring, encryptionContext, } => ciphertext,
                                }
                            }
                            /// Returns a borrow of the field materialsManager
                            pub fn materialsManager(&self) -> &Arc<Option<Object<dyn ICryptographicMaterialsManager>>> {
                                match self {
                                    DecryptInput::DecryptInput{ciphertext, materialsManager, keyring, encryptionContext, } => materialsManager,
                                }
                            }
                            /// Returns a borrow of the field keyring
                            pub fn keyring(&self) -> &Arc<Option<Object<dyn IKeyring>>> {
                                match self {
                                    DecryptInput::DecryptInput{ciphertext, materialsManager, keyring, encryptionContext, } => keyring,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>> {
                                match self {
                                    DecryptInput::DecryptInput{ciphertext, materialsManager, keyring, encryptionContext, } => encryptionContext,
                                }
                            }
                        }

                        impl Debug
                            for DecryptInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DecryptInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DecryptInput::DecryptInput{ciphertext, materialsManager, keyring, encryptionContext, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.DecryptInput.DecryptInput(")?;
                                        DafnyPrint::fmt_print(ciphertext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(materialsManager, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(keyring, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DecryptInput {}

                        impl Hash
                            for DecryptInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DecryptInput::DecryptInput{ciphertext, materialsManager, keyring, encryptionContext, } => {
                                        Hash::hash(ciphertext, _state);
                                        Hash::hash(materialsManager, _state);
                                        Hash::hash(keyring, _state);
                                        Hash::hash(encryptionContext, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DecryptInput {
                            fn default() -> DecryptInput {
                                DecryptInput::DecryptInput {
                                    ciphertext: Default::default(),
                                    materialsManager: Default::default(),
                                    keyring: Default::default(),
                                    encryptionContext: Default::default()
                                }
                            }
                        }

                        impl AsRef<DecryptInput>
                            for DecryptInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(120,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DecryptOutput {
                            DecryptOutput {
                                plaintext: Sequence<u8>,
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
                                algorithmSuiteId: Arc<ESDKAlgorithmSuiteId>
                            }
                        }

                        impl DecryptOutput {
                            /// Returns a borrow of the field plaintext
                            pub fn plaintext(&self) -> &Sequence<u8> {
                                match self {
                                    DecryptOutput::DecryptOutput{plaintext, encryptionContext, algorithmSuiteId, } => plaintext,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    DecryptOutput::DecryptOutput{plaintext, encryptionContext, algorithmSuiteId, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field algorithmSuiteId
                            pub fn algorithmSuiteId(&self) -> &Arc<ESDKAlgorithmSuiteId> {
                                match self {
                                    DecryptOutput::DecryptOutput{plaintext, encryptionContext, algorithmSuiteId, } => algorithmSuiteId,
                                }
                            }
                        }

                        impl Debug
                            for DecryptOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DecryptOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DecryptOutput::DecryptOutput{plaintext, encryptionContext, algorithmSuiteId, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.DecryptOutput.DecryptOutput(")?;
                                        DafnyPrint::fmt_print(plaintext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(algorithmSuiteId, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DecryptOutput {}

                        impl Hash
                            for DecryptOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DecryptOutput::DecryptOutput{plaintext, encryptionContext, algorithmSuiteId, } => {
                                        Hash::hash(plaintext, _state);
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(algorithmSuiteId, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DecryptOutput {
                            fn default() -> DecryptOutput {
                                DecryptOutput::DecryptOutput {
                                    plaintext: Default::default(),
                                    encryptionContext: Default::default(),
                                    algorithmSuiteId: Default::default()
                                }
                            }
                        }

                        impl AsRef<DecryptOutput>
                            for DecryptOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(125,3)
                        #[derive(PartialEq, Clone)]
                        pub enum EncryptInput {
                            EncryptInput {
                                plaintext: Sequence<u8>,
                                encryptionContext: Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>>,
                                materialsManager: Arc<Option<Object<dyn ICryptographicMaterialsManager>>>,
                                keyring: Arc<Option<Object<dyn IKeyring>>>,
                                algorithmSuiteId: Arc<Option<Arc<ESDKAlgorithmSuiteId>>>,
                                frameLength: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::FrameLength>>
                            }
                        }

                        impl EncryptInput {
                            /// Returns a borrow of the field plaintext
                            pub fn plaintext(&self) -> &Sequence<u8> {
                                match self {
                                    EncryptInput::EncryptInput{plaintext, encryptionContext, materialsManager, keyring, algorithmSuiteId, frameLength, } => plaintext,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>> {
                                match self {
                                    EncryptInput::EncryptInput{plaintext, encryptionContext, materialsManager, keyring, algorithmSuiteId, frameLength, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field materialsManager
                            pub fn materialsManager(&self) -> &Arc<Option<Object<dyn ICryptographicMaterialsManager>>> {
                                match self {
                                    EncryptInput::EncryptInput{plaintext, encryptionContext, materialsManager, keyring, algorithmSuiteId, frameLength, } => materialsManager,
                                }
                            }
                            /// Returns a borrow of the field keyring
                            pub fn keyring(&self) -> &Arc<Option<Object<dyn IKeyring>>> {
                                match self {
                                    EncryptInput::EncryptInput{plaintext, encryptionContext, materialsManager, keyring, algorithmSuiteId, frameLength, } => keyring,
                                }
                            }
                            /// Returns a borrow of the field algorithmSuiteId
                            pub fn algorithmSuiteId(&self) -> &Arc<Option<Arc<ESDKAlgorithmSuiteId>>> {
                                match self {
                                    EncryptInput::EncryptInput{plaintext, encryptionContext, materialsManager, keyring, algorithmSuiteId, frameLength, } => algorithmSuiteId,
                                }
                            }
                            /// Returns a borrow of the field frameLength
                            pub fn frameLength(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::FrameLength>> {
                                match self {
                                    EncryptInput::EncryptInput{plaintext, encryptionContext, materialsManager, keyring, algorithmSuiteId, frameLength, } => frameLength,
                                }
                            }
                        }

                        impl Debug
                            for EncryptInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for EncryptInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    EncryptInput::EncryptInput{plaintext, encryptionContext, materialsManager, keyring, algorithmSuiteId, frameLength, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.EncryptInput.EncryptInput(")?;
                                        DafnyPrint::fmt_print(plaintext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(materialsManager, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(keyring, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(algorithmSuiteId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(frameLength, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for EncryptInput {}

                        impl Hash
                            for EncryptInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    EncryptInput::EncryptInput{plaintext, encryptionContext, materialsManager, keyring, algorithmSuiteId, frameLength, } => {
                                        Hash::hash(plaintext, _state);
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(materialsManager, _state);
                                        Hash::hash(keyring, _state);
                                        Hash::hash(algorithmSuiteId, _state);
                                        Hash::hash(frameLength, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for EncryptInput {
                            fn default() -> EncryptInput {
                                EncryptInput::EncryptInput {
                                    plaintext: Default::default(),
                                    encryptionContext: Default::default(),
                                    materialsManager: Default::default(),
                                    keyring: Default::default(),
                                    algorithmSuiteId: Default::default(),
                                    frameLength: Default::default()
                                }
                            }
                        }

                        impl AsRef<EncryptInput>
                            for EncryptInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(133,3)
                        #[derive(PartialEq, Clone)]
                        pub enum EncryptOutput {
                            EncryptOutput {
                                ciphertext: Sequence<u8>,
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
                                algorithmSuiteId: Arc<ESDKAlgorithmSuiteId>
                            }
                        }

                        impl EncryptOutput {
                            /// Returns a borrow of the field ciphertext
                            pub fn ciphertext(&self) -> &Sequence<u8> {
                                match self {
                                    EncryptOutput::EncryptOutput{ciphertext, encryptionContext, algorithmSuiteId, } => ciphertext,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    EncryptOutput::EncryptOutput{ciphertext, encryptionContext, algorithmSuiteId, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field algorithmSuiteId
                            pub fn algorithmSuiteId(&self) -> &Arc<ESDKAlgorithmSuiteId> {
                                match self {
                                    EncryptOutput::EncryptOutput{ciphertext, encryptionContext, algorithmSuiteId, } => algorithmSuiteId,
                                }
                            }
                        }

                        impl Debug
                            for EncryptOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for EncryptOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    EncryptOutput::EncryptOutput{ciphertext, encryptionContext, algorithmSuiteId, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.EncryptOutput.EncryptOutput(")?;
                                        DafnyPrint::fmt_print(ciphertext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(algorithmSuiteId, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for EncryptOutput {}

                        impl Hash
                            for EncryptOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    EncryptOutput::EncryptOutput{ciphertext, encryptionContext, algorithmSuiteId, } => {
                                        Hash::hash(ciphertext, _state);
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(algorithmSuiteId, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for EncryptOutput {
                            fn default() -> EncryptOutput {
                                EncryptOutput::EncryptOutput {
                                    ciphertext: Default::default(),
                                    encryptionContext: Default::default(),
                                    algorithmSuiteId: Default::default()
                                }
                            }
                        }

                        impl AsRef<EncryptOutput>
                            for EncryptOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(138,3)
                        pub type FrameLength = i64;

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(142,3)
                        #[derive(PartialEq, Clone)]
                        pub enum NetV4_0_0_RetryPolicy {
                            FORBID_RETRY {},
                            ALLOW_RETRY {}
                        }

                        impl NetV4_0_0_RetryPolicy {}

                        impl Debug
                            for NetV4_0_0_RetryPolicy {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for NetV4_0_0_RetryPolicy {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    NetV4_0_0_RetryPolicy::FORBID_RETRY{} => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.NetV4__0__0__RetryPolicy.FORBID__RETRY")?;
                                        Ok(())
                                    },
                                    NetV4_0_0_RetryPolicy::ALLOW_RETRY{} => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.NetV4__0__0__RetryPolicy.ALLOW__RETRY")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl NetV4_0_0_RetryPolicy {
                            /// Enumerates all possible values of NetV4_0_0_RetryPolicy
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<NetV4_0_0_RetryPolicy>> {
                                seq![Arc::new(NetV4_0_0_RetryPolicy::FORBID_RETRY {}), Arc::new(NetV4_0_0_RetryPolicy::ALLOW_RETRY {})].iter()
                            }
                        }

                        impl Eq
                            for NetV4_0_0_RetryPolicy {}

                        impl Hash
                            for NetV4_0_0_RetryPolicy {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    NetV4_0_0_RetryPolicy::FORBID_RETRY{} => {

                                    },
                                    NetV4_0_0_RetryPolicy::ALLOW_RETRY{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for NetV4_0_0_RetryPolicy {
                            fn default() -> NetV4_0_0_RetryPolicy {
                                NetV4_0_0_RetryPolicy::FORBID_RETRY {}
                            }
                        }

                        impl AsRef<NetV4_0_0_RetryPolicy>
                            for NetV4_0_0_RetryPolicy {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(145,3)
                        #[derive(PartialEq, Clone)]
                        pub enum Error {
                            AwsEncryptionSdkException {
                                message: Sequence<DafnyCharUTF16>
                            },
                            AwsCryptographyMaterialProviders {
                                AwsCryptographyMaterialProviders: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>
                            },
                            AwsCryptographyPrimitives {
                                AwsCryptographyPrimitives: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>
                            },
                            CollectionOfErrors {
                                list: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>,
                                message: Sequence<DafnyCharUTF16>
                            },
                            Opaque {
                                obj: Object<dyn Any + Sync + Send>
                            },
                            OpaqueWithText {
                                obj: Object<dyn Any + Sync + Send>,
                                objMessage: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl Error {
                            /// Gets the field message for all enum members which have it
                            pub fn message(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    Error::AwsEncryptionSdkException{message, } => message,
                                    Error::AwsCryptographyMaterialProviders{AwsCryptographyMaterialProviders, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => message,
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field AwsCryptographyMaterialProviders for all enum members which have it
                            pub fn AwsCryptographyMaterialProviders(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error> {
                                match self {
                                    Error::AwsEncryptionSdkException{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyMaterialProviders{AwsCryptographyMaterialProviders, } => AwsCryptographyMaterialProviders,
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field AwsCryptographyPrimitives for all enum members which have it
                            pub fn AwsCryptographyPrimitives(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error> {
                                match self {
                                    Error::AwsEncryptionSdkException{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyMaterialProviders{AwsCryptographyMaterialProviders, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => AwsCryptographyPrimitives,
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field list for all enum members which have it
                            pub fn list(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>> {
                                match self {
                                    Error::AwsEncryptionSdkException{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyMaterialProviders{AwsCryptographyMaterialProviders, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => list,
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field obj for all enum members which have it
                            pub fn obj(&self) -> &Object<dyn Any + Sync + Send> {
                                match self {
                                    Error::AwsEncryptionSdkException{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyMaterialProviders{AwsCryptographyMaterialProviders, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => obj,
                                    Error::OpaqueWithText{obj, objMessage, } => obj,
                                }
                            }
                            /// Gets the field objMessage for all enum members which have it
                            pub fn objMessage(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    Error::AwsEncryptionSdkException{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyMaterialProviders{AwsCryptographyMaterialProviders, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => objMessage,
                                }
                            }
                        }

                        impl Debug
                            for Error {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for Error {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    Error::AwsEncryptionSdkException{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.Error.AwsEncryptionSdkException(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::AwsCryptographyMaterialProviders{AwsCryptographyMaterialProviders, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.Error.AwsCryptographyMaterialProviders(")?;
                                        DafnyPrint::fmt_print(AwsCryptographyMaterialProviders, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.Error.AwsCryptographyPrimitives(")?;
                                        DafnyPrint::fmt_print(AwsCryptographyPrimitives, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::CollectionOfErrors{list, message, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.Error.CollectionOfErrors(")?;
                                        DafnyPrint::fmt_print(list, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::Opaque{obj, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.Error.Opaque(")?;
                                        DafnyPrint::fmt_print(obj, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::OpaqueWithText{obj, objMessage, } => {
                                        write!(_formatter, "software.amazon.cryptography.encryptionsdk.internaldafny.types.Error.OpaqueWithText(")?;
                                        DafnyPrint::fmt_print(obj, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(objMessage, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for Error {}

                        impl Hash
                            for Error {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    Error::AwsEncryptionSdkException{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::AwsCryptographyMaterialProviders{AwsCryptographyMaterialProviders, } => {
                                        Hash::hash(AwsCryptographyMaterialProviders, _state)
                                    },
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => {
                                        Hash::hash(AwsCryptographyPrimitives, _state)
                                    },
                                    Error::CollectionOfErrors{list, message, } => {
                                        Hash::hash(list, _state);
                                        Hash::hash(message, _state)
                                    },
                                    Error::Opaque{obj, } => {
                                        Hash::hash(obj, _state)
                                    },
                                    Error::OpaqueWithText{obj, objMessage, } => {
                                        Hash::hash(obj, _state);
                                        Hash::hash(objMessage, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for Error {
                            fn default() -> Error {
                                Error::AwsEncryptionSdkException {
                                    message: Default::default()
                                }
                            }
                        }

                        impl AsRef<Error>
                            for Error {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(181,3)
                        pub type OpaqueError = Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>;

                        /// dafny/AwsEncryptionSdk/Model/AwsCryptographyEncryptionSdkTypes.dfy(184,3)
                        pub type DummySubsetType = DafnyInt;

                        /// An element of DummySubsetType
                        pub fn __init_DummySubsetType() -> DafnyInt {
                            int!(1)
                        }
                    }
                }
            }

            pub mod keystore {
                /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Index.dfy(9,1)
                pub mod internaldafny {
                    pub use ::std::sync::Arc;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KeyStoreConfig;
                    pub use ::dafny_runtime::string_utf16_of;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
                    pub use ::dafny_runtime::Sequence;
                    pub use ::dafny_runtime::DafnyCharUTF16;
                    pub use ::dafny_runtime::Object;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                    pub use ::dafny_runtime::MaybePlacebo;
                    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn;
                    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsArn;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration::mrDiscovery;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
                    pub use crate::implementation_from_dafny::_AwsCryptographyKeyStoreOperations_Compile::Config;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::IKeyStoreClient;
                    pub use ::dafny_runtime::allocate_object;
                    pub use ::dafny_runtime::update_field_uninit_object;
                    pub use ::dafny_runtime::UpcastObject;
                    pub use ::dafny_runtime::DynAny;
                    pub use ::dafny_runtime::UpcastObjectFn;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetKeyStoreInfoOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyStoreInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyStoreOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::VersionKeyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::VersionKeyOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBranchKeyVersionInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBranchKeyVersionOutput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBeaconKeyInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBeaconKeyOutput;

                    pub struct _default {}

                    impl _default {
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Index.dfy(23,3)
                        pub fn DefaultKeyStoreConfig() -> Arc<KeyStoreConfig> {
                            Arc::new(KeyStoreConfig::KeyStoreConfig {
                                    ddbTableName: string_utf16_of("None"),
                                    kmsConfiguration: Arc::new(KMSConfiguration::kmsKeyArn {
                                                kmsKeyArn: string_utf16_of("arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab")
                                            }),
                                    logicalKeyStoreName: string_utf16_of("None"),
                                    id: Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {}),
                                    grantTokens: Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::None {}),
                                    ddbClient: Arc::new(Option::<Object<dyn IDynamoDBClient>>::None {}),
                                    kmsClient: Arc::new(Option::<Object<dyn IKMSClient>>::None {})
                                })
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Index.dfy(36,3)
                        pub fn KeyStore(config: &Arc<KeyStoreConfig>) -> Arc<Result<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
                            let mut res = MaybePlacebo::<Arc<Result<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>>::new();
                            let mut kmsClient: Object<dyn IKMSClient>;
                            let mut ddbClient: Object<dyn IDynamoDBClient>;
                            let mut inferredRegion: Arc<Option<Sequence<DafnyCharUTF16>>> = Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {});
                            if crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::HasKeyId(config.kmsConfiguration()) {
                                let mut valueOrError0: Arc<Result<AwsKmsArn, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_KmsArn_Compile::_default::IsValidKeyArn(&crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::GetKeyId(config.kmsConfiguration()));
                                if valueOrError0.IsFailure() {
                                    res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>>());
                                    return res.read();
                                };
                                let mut parsedArn: Arc<AwsArn> = valueOrError0.Extract();
                                inferredRegion = Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                            value: parsedArn.region().clone()
                                        });
                            } else {
                                if matches!(config.kmsConfiguration().as_ref(), mrDiscovery{ .. }) {
                                    inferredRegion = Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                                value: config.kmsConfiguration().mrDiscovery().region().clone()
                                            });
                                }
                            };
                            let mut grantTokens: Arc<Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(config.grantTokens());
                            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            valueOrError1 = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(true && matches!((&grantTokens).as_ref(), Success{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                                            message: string_utf16_of("Grant Tokens passed to Key Store configuration are invalid.")
                                        }));
                            if valueOrError1.IsFailure() {
                                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>>());
                                return res.read();
                            };
                            let mut keyStoreId: Sequence<DafnyCharUTF16>;
                            if matches!(config.id().as_ref(), Some{ .. }) {
                                keyStoreId = config.id().value().clone();
                            } else {
                                let mut maybeUuid: Arc<Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>;
                                let mut _out0: Arc<Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>;
                                _out0 = crate::implementation_from_dafny::UUID::_default::GenerateUUID();
                                maybeUuid = _out0.clone();
                                let mut valueOrError2: Arc<Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                                valueOrError2 = maybeUuid.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                                            Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                                                            message: e.clone()
                                                        })
                                                })
                                        }));
                                if valueOrError2.IsFailure() {
                                    res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>>());
                                    return res.read();
                                };
                                let mut uuid: Sequence<DafnyCharUTF16> = valueOrError2.Extract();
                                keyStoreId = uuid.clone();
                            };
                            if matches!(config.kmsClient().as_ref(), Some{ .. }) {
                                kmsClient = config.kmsClient().value().clone();
                            } else {
                                if matches!(config.kmsClient().as_ref(), None{ .. }) && matches!((&inferredRegion).as_ref(), Some{ .. }) {
                                    let mut maybeKmsClient: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                    let mut _out1: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                    _out1 = crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::_default::KMSClientForRegion(inferredRegion.value());
                                    maybeKmsClient = _out1.clone();
                                    let mut valueOrError3: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeKmsClient.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                                                Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                                        Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsKms {
                                                                ComAmazonawsKms: e.clone()
                                                            })
                                                    })
                                            }));
                                    if valueOrError3.IsFailure() {
                                        res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>>());
                                        return res.read();
                                    };
                                    kmsClient = valueOrError3.Extract();
                                } else {
                                    let mut maybeKmsClient: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                    let mut _out2: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                    _out2 = crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::_default::KMSClient();
                                    maybeKmsClient = _out2.clone();
                                    let mut valueOrError4: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeKmsClient.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                                                Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                                        Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsKms {
                                                                ComAmazonawsKms: e.clone()
                                                            })
                                                    })
                                            }));
                                    if valueOrError4.IsFailure() {
                                        res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>>());
                                        return res.read();
                                    };
                                    kmsClient = valueOrError4.Extract();
                                }
                            };
                            if matches!(config.ddbClient().as_ref(), Some{ .. }) {
                                ddbClient = config.ddbClient().value().clone();
                            } else {
                                if matches!(config.ddbClient().as_ref(), None{ .. }) && matches!((&inferredRegion).as_ref(), Some{ .. }) {
                                    let mut maybeDdbClient: Arc<Result<Object<dyn IDynamoDBClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                    let mut _out3: Arc<Result<Object<dyn IDynamoDBClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                    _out3 = crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::_default::DDBClientForRegion(inferredRegion.value());
                                    maybeDdbClient = _out3.clone();
                                    let mut valueOrError5: Arc<Result<Object<dyn IDynamoDBClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeDdbClient.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                                                Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                                        Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsDynamodb {
                                                                ComAmazonawsDynamodb: e.clone()
                                                            })
                                                    })
                                            }));
                                    if valueOrError5.IsFailure() {
                                        res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>>());
                                        return res.read();
                                    };
                                    ddbClient = valueOrError5.Extract();
                                } else {
                                    let mut maybeDdbClient: Arc<Result<Object<dyn IDynamoDBClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                    let mut _out4: Arc<Result<Object<dyn IDynamoDBClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                    _out4 = crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::_default::DynamoDBClient();
                                    maybeDdbClient = _out4.clone();
                                    let mut valueOrError6: Arc<Result<Object<dyn IDynamoDBClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeDdbClient.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                                                Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                                        Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsDynamodb {
                                                                ComAmazonawsDynamodb: e.clone()
                                                            })
                                                    })
                                            }));
                                    if valueOrError6.IsFailure() {
                                        res = MaybePlacebo::from(valueOrError6.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>>());
                                        return res.read();
                                    };
                                    ddbClient = valueOrError6.Extract();
                                }
                            };
                            let mut valueOrError7: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            valueOrError7 = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::_default::IsValid_TableName(config.ddbTableName()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                                            message: string_utf16_of("Invalid Amazon DynamoDB Table Name")
                                        }));
                            if valueOrError7.IsFailure() {
                                res = MaybePlacebo::from(valueOrError7.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>>());
                                return res.read();
                            };
                            let mut client: Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>;
                            let mut _nw0: Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient> = crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient::_allocate_object();
                            crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient::_ctor(&_nw0, &Arc::new(Config::Config {
                                        id: keyStoreId.clone(),
                                        ddbTableName: config.ddbTableName().clone(),
                                        logicalKeyStoreName: config.logicalKeyStoreName().clone(),
                                        kmsConfiguration: config.kmsConfiguration().clone(),
                                        grantTokens: grantTokens.value().clone(),
                                        kmsClient: kmsClient.clone(),
                                        ddbClient: ddbClient.clone()
                                    }));
                            client = _nw0.clone();
                            res = MaybePlacebo::from(Arc::new(Result::<Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                                            value: client.clone()
                                        }));
                            return res.read();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(335,3)
                        pub fn CreateSuccessOfClient(client: &Object<dyn IKeyStoreClient>) -> Arc<Result<Object<dyn IKeyStoreClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
                            Arc::new(Result::<Object<dyn IKeyStoreClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                                    value: client.clone()
                                })
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(338,3)
                        pub fn CreateFailureOfError(error: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>) -> Arc<Result<Object<dyn IKeyStoreClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
                            Arc::new(Result::<Object<dyn IKeyStoreClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Failure {
                                    error: error.clone()
                                })
                        }
                    }

                    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Index.dfy(187,3)
                    pub struct KeyStoreClient {
                        pub __i_config: Arc<Config>
                    }

                    impl KeyStoreClient {
                        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                        pub fn _allocate_object() -> Object<Self> {
                            allocate_object::<Self>()
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Index.dfy(195,5)
                        pub fn _ctor(this: &Object<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient>, config: &Arc<Config>) -> () {
                            let mut _set___i_config: bool = false;
                            update_field_uninit_object!(this.clone(), __i_config, _set___i_config, config.clone());
                            return ();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(349,5)
                        pub fn config(&self) -> Arc<Config> {
                            self.__i_config.clone()
                        }
                    }

                    impl UpcastObject<DynAny>
                        for crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient {
                        UpcastObjectFn!(DynAny);
                    }

                    impl IKeyStoreClient
                        for crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient {
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(358,5)
                        fn GetKeyStoreInfo(&self) -> Arc<Result<Arc<GetKeyStoreInfoOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Arc<GetKeyStoreInfoOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Arc<GetKeyStoreInfoOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyKeyStoreOperations_Compile::_default::GetKeyStoreInfo(&self.config().clone());
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(378,5)
                        fn CreateKeyStore(&self, input: &Arc<CreateKeyStoreInput>) -> Arc<Result<Arc<CreateKeyStoreOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Arc<CreateKeyStoreOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Arc<CreateKeyStoreOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyKeyStoreOperations_Compile::_default::CreateKeyStore(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(398,5)
                        fn CreateKey(&self, input: &Arc<CreateKeyInput>) -> Arc<Result<Arc<CreateKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Arc<CreateKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Arc<CreateKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyKeyStoreOperations_Compile::_default::CreateKey(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(418,5)
                        fn VersionKey(&self, input: &Arc<VersionKeyInput>) -> Arc<Result<Arc<VersionKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Arc<VersionKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Arc<VersionKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyKeyStoreOperations_Compile::_default::VersionKey(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(438,5)
                        fn GetActiveBranchKey(&self, input: &Arc<GetActiveBranchKeyInput>) -> Arc<Result<Arc<GetActiveBranchKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Arc<GetActiveBranchKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Arc<GetActiveBranchKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyKeyStoreOperations_Compile::_default::GetActiveBranchKey(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(458,5)
                        fn GetBranchKeyVersion(&self, input: &Arc<GetBranchKeyVersionInput>) -> Arc<Result<Arc<GetBranchKeyVersionOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Arc<GetBranchKeyVersionOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Arc<GetBranchKeyVersionOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyKeyStoreOperations_Compile::_default::GetBranchKeyVersion(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(478,5)
                        fn GetBeaconKey(&self, input: &Arc<GetBeaconKeyInput>) -> Arc<Result<Arc<GetBeaconKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Arc<GetBeaconKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Arc<GetBeaconKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyKeyStoreOperations_Compile::_default::GetBeaconKey(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                    }

                    impl UpcastObject<dyn IKeyStoreClient>
                        for crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient {
                        UpcastObjectFn!(dyn IKeyStoreClient);
                    }

                    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(7,1)
                    pub mod types {
                        pub use ::dafny_runtime::DafnyInt;
                        pub use ::dafny_runtime::int;
                        pub use ::dafny_runtime::DafnyType;
                        pub use ::std::fmt::Debug;
                        pub use ::std::fmt::Formatter;
                        pub use ::dafny_runtime::DafnyPrint;
                        pub use ::std::cmp::Eq;
                        pub use ::std::hash::Hash;
                        pub use ::std::hash::Hasher;
                        pub use ::std::default::Default;
                        pub use ::std::convert::AsRef;
                        pub use ::dafny_runtime::Sequence;
                        pub use ::dafny_runtime::DafnyCharUTF16;
                        pub use ::dafny_runtime::Map;
                        pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
                        pub use ::std::sync::Arc;
                        pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
                        pub use ::dafny_runtime::SequenceIter;
                        pub use ::dafny_runtime::seq;
                        pub use ::dafny_runtime::Object;
                        pub use ::dafny_runtime::allocate_object;
                        pub use ::dafny_runtime::UpcastObject;
                        pub use ::dafny_runtime::DynAny;
                        pub use ::dafny_runtime::UpcastObjectFn;
                        pub use ::dafny_runtime::Any;
                        pub use ::std::marker::Sync;
                        pub use ::std::marker::Send;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;

                        pub struct _default {}

                        impl _default {
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(292,3)
                            pub fn IsDummySubsetType(x: &DafnyInt) -> bool {
                                int!(0) < x.clone()
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(15,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DafnyCallEvent<I: DafnyType, O: DafnyType> {
                            DafnyCallEvent {
                                input: I,
                                output: O
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> DafnyCallEvent<I, O> {
                            /// Returns a borrow of the field input
                            pub fn input(&self) -> &I {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => input,
                                }
                            }
                            /// Returns a borrow of the field output
                            pub fn output(&self) -> &O {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => output,
                                }
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> Debug
                            for DafnyCallEvent<I, O> {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> DafnyPrint
                            for DafnyCallEvent<I, O> {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.DafnyCallEvent.DafnyCallEvent(")?;
                                        DafnyPrint::fmt_print(input, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(output, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl<I: DafnyType + Eq, O: DafnyType + Eq> Eq
                            for DafnyCallEvent<I, O> {}

                        impl<I: DafnyType + Hash, O: DafnyType + Hash> Hash
                            for DafnyCallEvent<I, O> {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                        Hash::hash(input, _state);
                                        Hash::hash(output, _state)
                                    },
                                }
                            }
                        }

                        impl<I: DafnyType + Default, O: DafnyType + Default> Default
                            for DafnyCallEvent<I, O> {
                            fn default() -> DafnyCallEvent<I, O> {
                                DafnyCallEvent::DafnyCallEvent {
                                    input: Default::default(),
                                    output: Default::default()
                                }
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> AsRef<DafnyCallEvent<I, O>>
                            for DafnyCallEvent<I, O> {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(19,3)
                        #[derive(PartialEq, Clone)]
                        pub enum BeaconKeyMaterials {
                            BeaconKeyMaterials {
                                beaconKeyIdentifier: Sequence<DafnyCharUTF16>,
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
                                beaconKey: Arc<Option<Sequence<u8>>>,
                                hmacKeys: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<u8>>>>
                            }
                        }

                        impl BeaconKeyMaterials {
                            /// Returns a borrow of the field beaconKeyIdentifier
                            pub fn beaconKeyIdentifier(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    BeaconKeyMaterials::BeaconKeyMaterials{beaconKeyIdentifier, encryptionContext, beaconKey, hmacKeys, } => beaconKeyIdentifier,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    BeaconKeyMaterials::BeaconKeyMaterials{beaconKeyIdentifier, encryptionContext, beaconKey, hmacKeys, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field beaconKey
                            pub fn beaconKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    BeaconKeyMaterials::BeaconKeyMaterials{beaconKeyIdentifier, encryptionContext, beaconKey, hmacKeys, } => beaconKey,
                                }
                            }
                            /// Returns a borrow of the field hmacKeys
                            pub fn hmacKeys(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<u8>>>> {
                                match self {
                                    BeaconKeyMaterials::BeaconKeyMaterials{beaconKeyIdentifier, encryptionContext, beaconKey, hmacKeys, } => hmacKeys,
                                }
                            }
                        }

                        impl Debug
                            for BeaconKeyMaterials {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for BeaconKeyMaterials {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    BeaconKeyMaterials::BeaconKeyMaterials{beaconKeyIdentifier, encryptionContext, beaconKey, hmacKeys, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.BeaconKeyMaterials.BeaconKeyMaterials(")?;
                                        DafnyPrint::fmt_print(beaconKeyIdentifier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(beaconKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(hmacKeys, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for BeaconKeyMaterials {}

                        impl Hash
                            for BeaconKeyMaterials {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    BeaconKeyMaterials::BeaconKeyMaterials{beaconKeyIdentifier, encryptionContext, beaconKey, hmacKeys, } => {
                                        Hash::hash(beaconKeyIdentifier, _state);
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(beaconKey, _state);
                                        Hash::hash(hmacKeys, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for BeaconKeyMaterials {
                            fn default() -> BeaconKeyMaterials {
                                BeaconKeyMaterials::BeaconKeyMaterials {
                                    beaconKeyIdentifier: Default::default(),
                                    encryptionContext: Default::default(),
                                    beaconKey: Default::default(),
                                    hmacKeys: Default::default()
                                }
                            }
                        }

                        impl AsRef<BeaconKeyMaterials>
                            for BeaconKeyMaterials {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(25,3)
                        #[derive(PartialEq, Clone)]
                        pub enum BranchKeyMaterials {
                            BranchKeyMaterials {
                                branchKeyIdentifier: Sequence<DafnyCharUTF16>,
                                branchKeyVersion: ValidUTF8Bytes,
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
                                branchKey: Sequence<u8>
                            }
                        }

                        impl BranchKeyMaterials {
                            /// Returns a borrow of the field branchKeyIdentifier
                            pub fn branchKeyIdentifier(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    BranchKeyMaterials::BranchKeyMaterials{branchKeyIdentifier, branchKeyVersion, encryptionContext, branchKey, } => branchKeyIdentifier,
                                }
                            }
                            /// Returns a borrow of the field branchKeyVersion
                            pub fn branchKeyVersion(&self) -> &ValidUTF8Bytes {
                                match self {
                                    BranchKeyMaterials::BranchKeyMaterials{branchKeyIdentifier, branchKeyVersion, encryptionContext, branchKey, } => branchKeyVersion,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    BranchKeyMaterials::BranchKeyMaterials{branchKeyIdentifier, branchKeyVersion, encryptionContext, branchKey, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field branchKey
                            pub fn branchKey(&self) -> &Sequence<u8> {
                                match self {
                                    BranchKeyMaterials::BranchKeyMaterials{branchKeyIdentifier, branchKeyVersion, encryptionContext, branchKey, } => branchKey,
                                }
                            }
                        }

                        impl Debug
                            for BranchKeyMaterials {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for BranchKeyMaterials {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    BranchKeyMaterials::BranchKeyMaterials{branchKeyIdentifier, branchKeyVersion, encryptionContext, branchKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.BranchKeyMaterials.BranchKeyMaterials(")?;
                                        DafnyPrint::fmt_print(branchKeyIdentifier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(branchKeyVersion, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(branchKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for BranchKeyMaterials {}

                        impl Hash
                            for BranchKeyMaterials {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    BranchKeyMaterials::BranchKeyMaterials{branchKeyIdentifier, branchKeyVersion, encryptionContext, branchKey, } => {
                                        Hash::hash(branchKeyIdentifier, _state);
                                        Hash::hash(branchKeyVersion, _state);
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(branchKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for BranchKeyMaterials {
                            fn default() -> BranchKeyMaterials {
                                BranchKeyMaterials::BranchKeyMaterials {
                                    branchKeyIdentifier: Default::default(),
                                    branchKeyVersion: Default::default(),
                                    encryptionContext: Default::default(),
                                    branchKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<BranchKeyMaterials>
                            for BranchKeyMaterials {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(31,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateKeyInput {
                            CreateKeyInput {
                                branchKeyIdentifier: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                encryptionContext: Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>>
                            }
                        }

                        impl CreateKeyInput {
                            /// Returns a borrow of the field branchKeyIdentifier
                            pub fn branchKeyIdentifier(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                match self {
                                    CreateKeyInput::CreateKeyInput{branchKeyIdentifier, encryptionContext, } => branchKeyIdentifier,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>> {
                                match self {
                                    CreateKeyInput::CreateKeyInput{branchKeyIdentifier, encryptionContext, } => encryptionContext,
                                }
                            }
                        }

                        impl Debug
                            for CreateKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateKeyInput::CreateKeyInput{branchKeyIdentifier, encryptionContext, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.CreateKeyInput.CreateKeyInput(")?;
                                        DafnyPrint::fmt_print(branchKeyIdentifier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateKeyInput {}

                        impl Hash
                            for CreateKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateKeyInput::CreateKeyInput{branchKeyIdentifier, encryptionContext, } => {
                                        Hash::hash(branchKeyIdentifier, _state);
                                        Hash::hash(encryptionContext, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateKeyInput {
                            fn default() -> CreateKeyInput {
                                CreateKeyInput::CreateKeyInput {
                                    branchKeyIdentifier: Default::default(),
                                    encryptionContext: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateKeyInput>
                            for CreateKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(35,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateKeyOutput {
                            CreateKeyOutput {
                                branchKeyIdentifier: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl CreateKeyOutput {
                            /// Returns a borrow of the field branchKeyIdentifier
                            pub fn branchKeyIdentifier(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    CreateKeyOutput::CreateKeyOutput{branchKeyIdentifier, } => branchKeyIdentifier,
                                }
                            }
                        }

                        impl Debug
                            for CreateKeyOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateKeyOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateKeyOutput::CreateKeyOutput{branchKeyIdentifier, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.CreateKeyOutput.CreateKeyOutput(")?;
                                        DafnyPrint::fmt_print(branchKeyIdentifier, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateKeyOutput {}

                        impl Hash
                            for CreateKeyOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateKeyOutput::CreateKeyOutput{branchKeyIdentifier, } => {
                                        Hash::hash(branchKeyIdentifier, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateKeyOutput {
                            fn default() -> CreateKeyOutput {
                                CreateKeyOutput::CreateKeyOutput {
                                    branchKeyIdentifier: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateKeyOutput>
                            for CreateKeyOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(38,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateKeyStoreInput {
                            CreateKeyStoreInput {}
                        }

                        impl CreateKeyStoreInput {}

                        impl Debug
                            for CreateKeyStoreInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateKeyStoreInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateKeyStoreInput::CreateKeyStoreInput{} => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.CreateKeyStoreInput.CreateKeyStoreInput")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl CreateKeyStoreInput {
                            /// Enumerates all possible values of CreateKeyStoreInput
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<CreateKeyStoreInput>> {
                                seq![Arc::new(CreateKeyStoreInput::CreateKeyStoreInput {})].iter()
                            }
                        }

                        impl Eq
                            for CreateKeyStoreInput {}

                        impl Hash
                            for CreateKeyStoreInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateKeyStoreInput::CreateKeyStoreInput{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateKeyStoreInput {
                            fn default() -> CreateKeyStoreInput {
                                CreateKeyStoreInput::CreateKeyStoreInput {}
                            }
                        }

                        impl AsRef<CreateKeyStoreInput>
                            for CreateKeyStoreInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(41,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateKeyStoreOutput {
                            CreateKeyStoreOutput {
                                tableArn: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl CreateKeyStoreOutput {
                            /// Returns a borrow of the field tableArn
                            pub fn tableArn(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    CreateKeyStoreOutput::CreateKeyStoreOutput{tableArn, } => tableArn,
                                }
                            }
                        }

                        impl Debug
                            for CreateKeyStoreOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateKeyStoreOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateKeyStoreOutput::CreateKeyStoreOutput{tableArn, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.CreateKeyStoreOutput.CreateKeyStoreOutput(")?;
                                        DafnyPrint::fmt_print(tableArn, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateKeyStoreOutput {}

                        impl Hash
                            for CreateKeyStoreOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateKeyStoreOutput::CreateKeyStoreOutput{tableArn, } => {
                                        Hash::hash(tableArn, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateKeyStoreOutput {
                            fn default() -> CreateKeyStoreOutput {
                                CreateKeyStoreOutput::CreateKeyStoreOutput {
                                    tableArn: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateKeyStoreOutput>
                            for CreateKeyStoreOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(44,3)
                        #[derive(PartialEq, Clone)]
                        pub enum Discovery {
                            Discovery {}
                        }

                        impl Discovery {}

                        impl Debug
                            for Discovery {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for Discovery {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    Discovery::Discovery{} => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.Discovery.Discovery")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Discovery {
                            /// Enumerates all possible values of Discovery
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<Discovery>> {
                                seq![Arc::new(Discovery::Discovery {})].iter()
                            }
                        }

                        impl Eq
                            for Discovery {}

                        impl Hash
                            for Discovery {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    Discovery::Discovery{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for Discovery {
                            fn default() -> Discovery {
                                Discovery::Discovery {}
                            }
                        }

                        impl AsRef<Discovery>
                            for Discovery {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(48,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetActiveBranchKeyInput {
                            GetActiveBranchKeyInput {
                                branchKeyIdentifier: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl GetActiveBranchKeyInput {
                            /// Returns a borrow of the field branchKeyIdentifier
                            pub fn branchKeyIdentifier(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    GetActiveBranchKeyInput::GetActiveBranchKeyInput{branchKeyIdentifier, } => branchKeyIdentifier,
                                }
                            }
                        }

                        impl Debug
                            for GetActiveBranchKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetActiveBranchKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetActiveBranchKeyInput::GetActiveBranchKeyInput{branchKeyIdentifier, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.GetActiveBranchKeyInput.GetActiveBranchKeyInput(")?;
                                        DafnyPrint::fmt_print(branchKeyIdentifier, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetActiveBranchKeyInput {}

                        impl Hash
                            for GetActiveBranchKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetActiveBranchKeyInput::GetActiveBranchKeyInput{branchKeyIdentifier, } => {
                                        Hash::hash(branchKeyIdentifier, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetActiveBranchKeyInput {
                            fn default() -> GetActiveBranchKeyInput {
                                GetActiveBranchKeyInput::GetActiveBranchKeyInput {
                                    branchKeyIdentifier: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetActiveBranchKeyInput>
                            for GetActiveBranchKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(51,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetActiveBranchKeyOutput {
                            GetActiveBranchKeyOutput {
                                branchKeyMaterials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BranchKeyMaterials>
                            }
                        }

                        impl GetActiveBranchKeyOutput {
                            /// Returns a borrow of the field branchKeyMaterials
                            pub fn branchKeyMaterials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BranchKeyMaterials> {
                                match self {
                                    GetActiveBranchKeyOutput::GetActiveBranchKeyOutput{branchKeyMaterials, } => branchKeyMaterials,
                                }
                            }
                        }

                        impl Debug
                            for GetActiveBranchKeyOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetActiveBranchKeyOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetActiveBranchKeyOutput::GetActiveBranchKeyOutput{branchKeyMaterials, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.GetActiveBranchKeyOutput.GetActiveBranchKeyOutput(")?;
                                        DafnyPrint::fmt_print(branchKeyMaterials, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetActiveBranchKeyOutput {}

                        impl Hash
                            for GetActiveBranchKeyOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetActiveBranchKeyOutput::GetActiveBranchKeyOutput{branchKeyMaterials, } => {
                                        Hash::hash(branchKeyMaterials, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetActiveBranchKeyOutput {
                            fn default() -> GetActiveBranchKeyOutput {
                                GetActiveBranchKeyOutput::GetActiveBranchKeyOutput {
                                    branchKeyMaterials: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetActiveBranchKeyOutput>
                            for GetActiveBranchKeyOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(54,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetBeaconKeyInput {
                            GetBeaconKeyInput {
                                branchKeyIdentifier: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl GetBeaconKeyInput {
                            /// Returns a borrow of the field branchKeyIdentifier
                            pub fn branchKeyIdentifier(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    GetBeaconKeyInput::GetBeaconKeyInput{branchKeyIdentifier, } => branchKeyIdentifier,
                                }
                            }
                        }

                        impl Debug
                            for GetBeaconKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetBeaconKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetBeaconKeyInput::GetBeaconKeyInput{branchKeyIdentifier, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.GetBeaconKeyInput.GetBeaconKeyInput(")?;
                                        DafnyPrint::fmt_print(branchKeyIdentifier, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetBeaconKeyInput {}

                        impl Hash
                            for GetBeaconKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetBeaconKeyInput::GetBeaconKeyInput{branchKeyIdentifier, } => {
                                        Hash::hash(branchKeyIdentifier, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetBeaconKeyInput {
                            fn default() -> GetBeaconKeyInput {
                                GetBeaconKeyInput::GetBeaconKeyInput {
                                    branchKeyIdentifier: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetBeaconKeyInput>
                            for GetBeaconKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(57,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetBeaconKeyOutput {
                            GetBeaconKeyOutput {
                                beaconKeyMaterials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BeaconKeyMaterials>
                            }
                        }

                        impl GetBeaconKeyOutput {
                            /// Returns a borrow of the field beaconKeyMaterials
                            pub fn beaconKeyMaterials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BeaconKeyMaterials> {
                                match self {
                                    GetBeaconKeyOutput::GetBeaconKeyOutput{beaconKeyMaterials, } => beaconKeyMaterials,
                                }
                            }
                        }

                        impl Debug
                            for GetBeaconKeyOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetBeaconKeyOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetBeaconKeyOutput::GetBeaconKeyOutput{beaconKeyMaterials, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.GetBeaconKeyOutput.GetBeaconKeyOutput(")?;
                                        DafnyPrint::fmt_print(beaconKeyMaterials, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetBeaconKeyOutput {}

                        impl Hash
                            for GetBeaconKeyOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetBeaconKeyOutput::GetBeaconKeyOutput{beaconKeyMaterials, } => {
                                        Hash::hash(beaconKeyMaterials, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetBeaconKeyOutput {
                            fn default() -> GetBeaconKeyOutput {
                                GetBeaconKeyOutput::GetBeaconKeyOutput {
                                    beaconKeyMaterials: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetBeaconKeyOutput>
                            for GetBeaconKeyOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(60,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetBranchKeyVersionInput {
                            GetBranchKeyVersionInput {
                                branchKeyIdentifier: Sequence<DafnyCharUTF16>,
                                branchKeyVersion: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl GetBranchKeyVersionInput {
                            /// Returns a borrow of the field branchKeyIdentifier
                            pub fn branchKeyIdentifier(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    GetBranchKeyVersionInput::GetBranchKeyVersionInput{branchKeyIdentifier, branchKeyVersion, } => branchKeyIdentifier,
                                }
                            }
                            /// Returns a borrow of the field branchKeyVersion
                            pub fn branchKeyVersion(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    GetBranchKeyVersionInput::GetBranchKeyVersionInput{branchKeyIdentifier, branchKeyVersion, } => branchKeyVersion,
                                }
                            }
                        }

                        impl Debug
                            for GetBranchKeyVersionInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetBranchKeyVersionInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetBranchKeyVersionInput::GetBranchKeyVersionInput{branchKeyIdentifier, branchKeyVersion, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.GetBranchKeyVersionInput.GetBranchKeyVersionInput(")?;
                                        DafnyPrint::fmt_print(branchKeyIdentifier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(branchKeyVersion, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetBranchKeyVersionInput {}

                        impl Hash
                            for GetBranchKeyVersionInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetBranchKeyVersionInput::GetBranchKeyVersionInput{branchKeyIdentifier, branchKeyVersion, } => {
                                        Hash::hash(branchKeyIdentifier, _state);
                                        Hash::hash(branchKeyVersion, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetBranchKeyVersionInput {
                            fn default() -> GetBranchKeyVersionInput {
                                GetBranchKeyVersionInput::GetBranchKeyVersionInput {
                                    branchKeyIdentifier: Default::default(),
                                    branchKeyVersion: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetBranchKeyVersionInput>
                            for GetBranchKeyVersionInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(64,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetBranchKeyVersionOutput {
                            GetBranchKeyVersionOutput {
                                branchKeyMaterials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BranchKeyMaterials>
                            }
                        }

                        impl GetBranchKeyVersionOutput {
                            /// Returns a borrow of the field branchKeyMaterials
                            pub fn branchKeyMaterials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BranchKeyMaterials> {
                                match self {
                                    GetBranchKeyVersionOutput::GetBranchKeyVersionOutput{branchKeyMaterials, } => branchKeyMaterials,
                                }
                            }
                        }

                        impl Debug
                            for GetBranchKeyVersionOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetBranchKeyVersionOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetBranchKeyVersionOutput::GetBranchKeyVersionOutput{branchKeyMaterials, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.GetBranchKeyVersionOutput.GetBranchKeyVersionOutput(")?;
                                        DafnyPrint::fmt_print(branchKeyMaterials, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetBranchKeyVersionOutput {}

                        impl Hash
                            for GetBranchKeyVersionOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetBranchKeyVersionOutput::GetBranchKeyVersionOutput{branchKeyMaterials, } => {
                                        Hash::hash(branchKeyMaterials, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetBranchKeyVersionOutput {
                            fn default() -> GetBranchKeyVersionOutput {
                                GetBranchKeyVersionOutput::GetBranchKeyVersionOutput {
                                    branchKeyMaterials: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetBranchKeyVersionOutput>
                            for GetBranchKeyVersionOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(67,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetKeyStoreInfoOutput {
                            GetKeyStoreInfoOutput {
                                keyStoreId: Sequence<DafnyCharUTF16>,
                                keyStoreName: Sequence<DafnyCharUTF16>,
                                logicalKeyStoreName: Sequence<DafnyCharUTF16>,
                                grantTokens: Sequence<Sequence<DafnyCharUTF16>>,
                                kmsConfiguration: Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration>
                            }
                        }

                        impl GetKeyStoreInfoOutput {
                            /// Returns a borrow of the field keyStoreId
                            pub fn keyStoreId(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    GetKeyStoreInfoOutput::GetKeyStoreInfoOutput{keyStoreId, keyStoreName, logicalKeyStoreName, grantTokens, kmsConfiguration, } => keyStoreId,
                                }
                            }
                            /// Returns a borrow of the field keyStoreName
                            pub fn keyStoreName(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    GetKeyStoreInfoOutput::GetKeyStoreInfoOutput{keyStoreId, keyStoreName, logicalKeyStoreName, grantTokens, kmsConfiguration, } => keyStoreName,
                                }
                            }
                            /// Returns a borrow of the field logicalKeyStoreName
                            pub fn logicalKeyStoreName(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    GetKeyStoreInfoOutput::GetKeyStoreInfoOutput{keyStoreId, keyStoreName, logicalKeyStoreName, grantTokens, kmsConfiguration, } => logicalKeyStoreName,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Sequence<Sequence<DafnyCharUTF16>> {
                                match self {
                                    GetKeyStoreInfoOutput::GetKeyStoreInfoOutput{keyStoreId, keyStoreName, logicalKeyStoreName, grantTokens, kmsConfiguration, } => grantTokens,
                                }
                            }
                            /// Returns a borrow of the field kmsConfiguration
                            pub fn kmsConfiguration(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration> {
                                match self {
                                    GetKeyStoreInfoOutput::GetKeyStoreInfoOutput{keyStoreId, keyStoreName, logicalKeyStoreName, grantTokens, kmsConfiguration, } => kmsConfiguration,
                                }
                            }
                        }

                        impl Debug
                            for GetKeyStoreInfoOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetKeyStoreInfoOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetKeyStoreInfoOutput::GetKeyStoreInfoOutput{keyStoreId, keyStoreName, logicalKeyStoreName, grantTokens, kmsConfiguration, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.GetKeyStoreInfoOutput.GetKeyStoreInfoOutput(")?;
                                        DafnyPrint::fmt_print(keyStoreId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(keyStoreName, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(logicalKeyStoreName, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kmsConfiguration, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetKeyStoreInfoOutput {}

                        impl Hash
                            for GetKeyStoreInfoOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetKeyStoreInfoOutput::GetKeyStoreInfoOutput{keyStoreId, keyStoreName, logicalKeyStoreName, grantTokens, kmsConfiguration, } => {
                                        Hash::hash(keyStoreId, _state);
                                        Hash::hash(keyStoreName, _state);
                                        Hash::hash(logicalKeyStoreName, _state);
                                        Hash::hash(grantTokens, _state);
                                        Hash::hash(kmsConfiguration, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetKeyStoreInfoOutput {
                            fn default() -> GetKeyStoreInfoOutput {
                                GetKeyStoreInfoOutput::GetKeyStoreInfoOutput {
                                    keyStoreId: Default::default(),
                                    keyStoreName: Default::default(),
                                    logicalKeyStoreName: Default::default(),
                                    grantTokens: Default::default(),
                                    kmsConfiguration: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetKeyStoreInfoOutput>
                            for GetKeyStoreInfoOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(76,3)
                        pub struct IKeyStoreClientCallHistory {}

                        impl IKeyStoreClientCallHistory {
                            /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                            pub fn _allocate_object() -> Object<Self> {
                                allocate_object::<Self>()
                            }
                        }

                        impl UpcastObject<DynAny>
                            for crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::IKeyStoreClientCallHistory {
                            UpcastObjectFn!(DynAny);
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(94,3)
                        pub trait IKeyStoreClient: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(123,5)
                            fn GetKeyStoreInfo(&self) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetKeyStoreInfoOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(138,5)
                            fn CreateKeyStore(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyStoreInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyStoreOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(153,5)
                            fn CreateKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(168,5)
                            fn VersionKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::VersionKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::VersionKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(183,5)
                            fn GetActiveBranchKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(198,5)
                            fn GetBranchKeyVersion(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBranchKeyVersionInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBranchKeyVersionOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(213,5)
                            fn GetBeaconKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBeaconKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBeaconKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(227,3)
                        #[derive(PartialEq, Clone)]
                        pub enum KeyStoreConfig {
                            KeyStoreConfig {
                                ddbTableName: Sequence<DafnyCharUTF16>,
                                kmsConfiguration: Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration>,
                                logicalKeyStoreName: Sequence<DafnyCharUTF16>,
                                id: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>,
                                ddbClient: Arc<Option<Object<dyn IDynamoDBClient>>>,
                                kmsClient: Arc<Option<Object<dyn IKMSClient>>>
                            }
                        }

                        impl KeyStoreConfig {
                            /// Returns a borrow of the field ddbTableName
                            pub fn ddbTableName(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    KeyStoreConfig::KeyStoreConfig{ddbTableName, kmsConfiguration, logicalKeyStoreName, id, grantTokens, ddbClient, kmsClient, } => ddbTableName,
                                }
                            }
                            /// Returns a borrow of the field kmsConfiguration
                            pub fn kmsConfiguration(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration> {
                                match self {
                                    KeyStoreConfig::KeyStoreConfig{ddbTableName, kmsConfiguration, logicalKeyStoreName, id, grantTokens, ddbClient, kmsClient, } => kmsConfiguration,
                                }
                            }
                            /// Returns a borrow of the field logicalKeyStoreName
                            pub fn logicalKeyStoreName(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    KeyStoreConfig::KeyStoreConfig{ddbTableName, kmsConfiguration, logicalKeyStoreName, id, grantTokens, ddbClient, kmsClient, } => logicalKeyStoreName,
                                }
                            }
                            /// Returns a borrow of the field id
                            pub fn id(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                match self {
                                    KeyStoreConfig::KeyStoreConfig{ddbTableName, kmsConfiguration, logicalKeyStoreName, id, grantTokens, ddbClient, kmsClient, } => id,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    KeyStoreConfig::KeyStoreConfig{ddbTableName, kmsConfiguration, logicalKeyStoreName, id, grantTokens, ddbClient, kmsClient, } => grantTokens,
                                }
                            }
                            /// Returns a borrow of the field ddbClient
                            pub fn ddbClient(&self) -> &Arc<Option<Object<dyn IDynamoDBClient>>> {
                                match self {
                                    KeyStoreConfig::KeyStoreConfig{ddbTableName, kmsConfiguration, logicalKeyStoreName, id, grantTokens, ddbClient, kmsClient, } => ddbClient,
                                }
                            }
                            /// Returns a borrow of the field kmsClient
                            pub fn kmsClient(&self) -> &Arc<Option<Object<dyn IKMSClient>>> {
                                match self {
                                    KeyStoreConfig::KeyStoreConfig{ddbTableName, kmsConfiguration, logicalKeyStoreName, id, grantTokens, ddbClient, kmsClient, } => kmsClient,
                                }
                            }
                        }

                        impl Debug
                            for KeyStoreConfig {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for KeyStoreConfig {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    KeyStoreConfig::KeyStoreConfig{ddbTableName, kmsConfiguration, logicalKeyStoreName, id, grantTokens, ddbClient, kmsClient, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.KeyStoreConfig.KeyStoreConfig(")?;
                                        DafnyPrint::fmt_print(ddbTableName, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kmsConfiguration, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(logicalKeyStoreName, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(id, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(ddbClient, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kmsClient, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for KeyStoreConfig {}

                        impl Hash
                            for KeyStoreConfig {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    KeyStoreConfig::KeyStoreConfig{ddbTableName, kmsConfiguration, logicalKeyStoreName, id, grantTokens, ddbClient, kmsClient, } => {
                                        Hash::hash(ddbTableName, _state);
                                        Hash::hash(kmsConfiguration, _state);
                                        Hash::hash(logicalKeyStoreName, _state);
                                        Hash::hash(id, _state);
                                        Hash::hash(grantTokens, _state);
                                        Hash::hash(ddbClient, _state);
                                        Hash::hash(kmsClient, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for KeyStoreConfig {
                            fn default() -> KeyStoreConfig {
                                KeyStoreConfig::KeyStoreConfig {
                                    ddbTableName: Default::default(),
                                    kmsConfiguration: Default::default(),
                                    logicalKeyStoreName: Default::default(),
                                    id: Default::default(),
                                    grantTokens: Default::default(),
                                    ddbClient: Default::default(),
                                    kmsClient: Default::default()
                                }
                            }
                        }

                        impl AsRef<KeyStoreConfig>
                            for KeyStoreConfig {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(236,3)
                        #[derive(PartialEq, Clone)]
                        pub enum KMSConfiguration {
                            kmsKeyArn {
                                kmsKeyArn: Sequence<DafnyCharUTF16>
                            },
                            kmsMRKeyArn {
                                kmsMRKeyArn: Sequence<DafnyCharUTF16>
                            },
                            discovery {
                                discovery: Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Discovery>
                            },
                            mrDiscovery {
                                mrDiscovery: Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::MRDiscovery>
                            }
                        }

                        impl KMSConfiguration {
                            /// Gets the field kmsKeyArn for all enum members which have it
                            pub fn kmsKeyArn(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    KMSConfiguration::kmsKeyArn{kmsKeyArn, } => kmsKeyArn,
                                    KMSConfiguration::kmsMRKeyArn{kmsMRKeyArn, } => panic!("field does not exist on this variant"),
                                    KMSConfiguration::discovery{discovery, } => panic!("field does not exist on this variant"),
                                    KMSConfiguration::mrDiscovery{mrDiscovery, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field kmsMRKeyArn for all enum members which have it
                            pub fn kmsMRKeyArn(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    KMSConfiguration::kmsKeyArn{kmsKeyArn, } => panic!("field does not exist on this variant"),
                                    KMSConfiguration::kmsMRKeyArn{kmsMRKeyArn, } => kmsMRKeyArn,
                                    KMSConfiguration::discovery{discovery, } => panic!("field does not exist on this variant"),
                                    KMSConfiguration::mrDiscovery{mrDiscovery, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field discovery for all enum members which have it
                            pub fn discovery(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Discovery> {
                                match self {
                                    KMSConfiguration::kmsKeyArn{kmsKeyArn, } => panic!("field does not exist on this variant"),
                                    KMSConfiguration::kmsMRKeyArn{kmsMRKeyArn, } => panic!("field does not exist on this variant"),
                                    KMSConfiguration::discovery{discovery, } => discovery,
                                    KMSConfiguration::mrDiscovery{mrDiscovery, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field mrDiscovery for all enum members which have it
                            pub fn mrDiscovery(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::MRDiscovery> {
                                match self {
                                    KMSConfiguration::kmsKeyArn{kmsKeyArn, } => panic!("field does not exist on this variant"),
                                    KMSConfiguration::kmsMRKeyArn{kmsMRKeyArn, } => panic!("field does not exist on this variant"),
                                    KMSConfiguration::discovery{discovery, } => panic!("field does not exist on this variant"),
                                    KMSConfiguration::mrDiscovery{mrDiscovery, } => mrDiscovery,
                                }
                            }
                        }

                        impl Debug
                            for KMSConfiguration {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for KMSConfiguration {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    KMSConfiguration::kmsKeyArn{kmsKeyArn, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.KMSConfiguration.kmsKeyArn(")?;
                                        DafnyPrint::fmt_print(kmsKeyArn, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    KMSConfiguration::kmsMRKeyArn{kmsMRKeyArn, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.KMSConfiguration.kmsMRKeyArn(")?;
                                        DafnyPrint::fmt_print(kmsMRKeyArn, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    KMSConfiguration::discovery{discovery, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.KMSConfiguration.discovery(")?;
                                        DafnyPrint::fmt_print(discovery, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    KMSConfiguration::mrDiscovery{mrDiscovery, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.KMSConfiguration.mrDiscovery(")?;
                                        DafnyPrint::fmt_print(mrDiscovery, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for KMSConfiguration {}

                        impl Hash
                            for KMSConfiguration {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    KMSConfiguration::kmsKeyArn{kmsKeyArn, } => {
                                        Hash::hash(kmsKeyArn, _state)
                                    },
                                    KMSConfiguration::kmsMRKeyArn{kmsMRKeyArn, } => {
                                        Hash::hash(kmsMRKeyArn, _state)
                                    },
                                    KMSConfiguration::discovery{discovery, } => {
                                        Hash::hash(discovery, _state)
                                    },
                                    KMSConfiguration::mrDiscovery{mrDiscovery, } => {
                                        Hash::hash(mrDiscovery, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for KMSConfiguration {
                            fn default() -> KMSConfiguration {
                                KMSConfiguration::kmsKeyArn {
                                    kmsKeyArn: Default::default()
                                }
                            }
                        }

                        impl AsRef<KMSConfiguration>
                            for KMSConfiguration {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(241,3)
                        #[derive(PartialEq, Clone)]
                        pub enum MRDiscovery {
                            MRDiscovery {
                                region: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl MRDiscovery {
                            /// Returns a borrow of the field region
                            pub fn region(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    MRDiscovery::MRDiscovery{region, } => region,
                                }
                            }
                        }

                        impl Debug
                            for MRDiscovery {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for MRDiscovery {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    MRDiscovery::MRDiscovery{region, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.MRDiscovery.MRDiscovery(")?;
                                        DafnyPrint::fmt_print(region, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for MRDiscovery {}

                        impl Hash
                            for MRDiscovery {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    MRDiscovery::MRDiscovery{region, } => {
                                        Hash::hash(region, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for MRDiscovery {
                            fn default() -> MRDiscovery {
                                MRDiscovery::MRDiscovery {
                                    region: Default::default()
                                }
                            }
                        }

                        impl AsRef<MRDiscovery>
                            for MRDiscovery {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(246,3)
                        #[derive(PartialEq, Clone)]
                        pub enum VersionKeyInput {
                            VersionKeyInput {
                                branchKeyIdentifier: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl VersionKeyInput {
                            /// Returns a borrow of the field branchKeyIdentifier
                            pub fn branchKeyIdentifier(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    VersionKeyInput::VersionKeyInput{branchKeyIdentifier, } => branchKeyIdentifier,
                                }
                            }
                        }

                        impl Debug
                            for VersionKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for VersionKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    VersionKeyInput::VersionKeyInput{branchKeyIdentifier, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.VersionKeyInput.VersionKeyInput(")?;
                                        DafnyPrint::fmt_print(branchKeyIdentifier, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for VersionKeyInput {}

                        impl Hash
                            for VersionKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    VersionKeyInput::VersionKeyInput{branchKeyIdentifier, } => {
                                        Hash::hash(branchKeyIdentifier, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for VersionKeyInput {
                            fn default() -> VersionKeyInput {
                                VersionKeyInput::VersionKeyInput {
                                    branchKeyIdentifier: Default::default()
                                }
                            }
                        }

                        impl AsRef<VersionKeyInput>
                            for VersionKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(249,3)
                        #[derive(PartialEq, Clone)]
                        pub enum VersionKeyOutput {
                            VersionKeyOutput {}
                        }

                        impl VersionKeyOutput {}

                        impl Debug
                            for VersionKeyOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for VersionKeyOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    VersionKeyOutput::VersionKeyOutput{} => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.VersionKeyOutput.VersionKeyOutput")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl VersionKeyOutput {
                            /// Enumerates all possible values of VersionKeyOutput
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<VersionKeyOutput>> {
                                seq![Arc::new(VersionKeyOutput::VersionKeyOutput {})].iter()
                            }
                        }

                        impl Eq
                            for VersionKeyOutput {}

                        impl Hash
                            for VersionKeyOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    VersionKeyOutput::VersionKeyOutput{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for VersionKeyOutput {
                            fn default() -> VersionKeyOutput {
                                VersionKeyOutput::VersionKeyOutput {}
                            }
                        }

                        impl AsRef<VersionKeyOutput>
                            for VersionKeyOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(252,3)
                        #[derive(PartialEq, Clone)]
                        pub enum Error {
                            KeyStoreException {
                                message: Sequence<DafnyCharUTF16>
                            },
                            ComAmazonawsDynamodb {
                                ComAmazonawsDynamodb: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>
                            },
                            ComAmazonawsKms {
                                ComAmazonawsKms: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>
                            },
                            CollectionOfErrors {
                                list: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>,
                                message: Sequence<DafnyCharUTF16>
                            },
                            Opaque {
                                obj: Object<dyn Any + Sync + Send>
                            },
                            OpaqueWithText {
                                obj: Object<dyn Any + Sync + Send>,
                                objMessage: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl Error {
                            /// Gets the field message for all enum members which have it
                            pub fn message(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    Error::KeyStoreException{message, } => message,
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => message,
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field ComAmazonawsDynamodb for all enum members which have it
                            pub fn ComAmazonawsDynamodb(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error> {
                                match self {
                                    Error::KeyStoreException{message, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => ComAmazonawsDynamodb,
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field ComAmazonawsKms for all enum members which have it
                            pub fn ComAmazonawsKms(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error> {
                                match self {
                                    Error::KeyStoreException{message, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => ComAmazonawsKms,
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field list for all enum members which have it
                            pub fn list(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>> {
                                match self {
                                    Error::KeyStoreException{message, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => list,
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field obj for all enum members which have it
                            pub fn obj(&self) -> &Object<dyn Any + Sync + Send> {
                                match self {
                                    Error::KeyStoreException{message, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => obj,
                                    Error::OpaqueWithText{obj, objMessage, } => obj,
                                }
                            }
                            /// Gets the field objMessage for all enum members which have it
                            pub fn objMessage(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    Error::KeyStoreException{message, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => objMessage,
                                }
                            }
                        }

                        impl Debug
                            for Error {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for Error {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    Error::KeyStoreException{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.Error.KeyStoreException(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.Error.ComAmazonawsDynamodb(")?;
                                        DafnyPrint::fmt_print(ComAmazonawsDynamodb, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.Error.ComAmazonawsKms(")?;
                                        DafnyPrint::fmt_print(ComAmazonawsKms, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::CollectionOfErrors{list, message, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.Error.CollectionOfErrors(")?;
                                        DafnyPrint::fmt_print(list, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::Opaque{obj, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.Error.Opaque(")?;
                                        DafnyPrint::fmt_print(obj, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::OpaqueWithText{obj, objMessage, } => {
                                        write!(_formatter, "software.amazon.cryptography.keystore.internaldafny.types.Error.OpaqueWithText(")?;
                                        DafnyPrint::fmt_print(obj, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(objMessage, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for Error {}

                        impl Hash
                            for Error {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    Error::KeyStoreException{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => {
                                        Hash::hash(ComAmazonawsDynamodb, _state)
                                    },
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => {
                                        Hash::hash(ComAmazonawsKms, _state)
                                    },
                                    Error::CollectionOfErrors{list, message, } => {
                                        Hash::hash(list, _state);
                                        Hash::hash(message, _state)
                                    },
                                    Error::Opaque{obj, } => {
                                        Hash::hash(obj, _state)
                                    },
                                    Error::OpaqueWithText{obj, objMessage, } => {
                                        Hash::hash(obj, _state);
                                        Hash::hash(objMessage, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for Error {
                            fn default() -> Error {
                                Error::KeyStoreException {
                                    message: Default::default()
                                }
                            }
                        }

                        impl AsRef<Error>
                            for Error {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(288,3)
                        pub type OpaqueError = Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>;

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/Model/AwsCryptographyKeyStoreTypes.dfy(291,3)
                        pub type DummySubsetType = DafnyInt;

                        /// An element of DummySubsetType
                        pub fn __init_DummySubsetType() -> DafnyInt {
                            int!(1)
                        }
                    }
                }
            }

            pub mod materialproviders {
                /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy(6,1)
                pub mod internaldafny {
                    pub use ::std::sync::Arc;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::MaterialProvidersConfig;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                    pub use ::dafny_runtime::Object;
                    pub use ::dafny_runtime::MaybePlacebo;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
                    pub use ::dafny_runtime::upcast_object;
                    pub use ::dafny_runtime::cast_object;
                    pub use crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::Config;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IAwsCryptographicMaterialProvidersClient;
                    pub use ::dafny_runtime::allocate_object;
                    pub use ::dafny_runtime::update_field_uninit_object;
                    pub use ::dafny_runtime::UpcastObject;
                    pub use ::dafny_runtime::DynAny;
                    pub use ::dafny_runtime::UpcastObjectFn;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsDiscoveryKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMultiKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsDiscoveryMultiKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkMultiKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkDiscoveryKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkDiscoveryMultiKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsHierarchicalKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsRsaKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsEcdhKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateMultiKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawAesKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawRsaKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawEcdhKeyringInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultCryptographicMaterialsManagerInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRequiredEncryptionContextCMMInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateCryptographicMaterialsCacheInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultClientSupplierInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeEncryptionMaterialsInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeDecryptionMaterialsInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidEncryptionMaterialsTransitionInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidDecryptionMaterialsTransitionInput;
                    pub use ::dafny_runtime::Sequence;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnEncryptInput;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnDecryptInput;

                    pub struct _default {}

                    impl _default {
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy(13,3)
                        pub fn DefaultMaterialProvidersConfig() -> Arc<MaterialProvidersConfig> {
                            Arc::new(MaterialProvidersConfig::MaterialProvidersConfig {})
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy(18,3)
                        pub fn MaterialProviders(config: &Arc<MaterialProvidersConfig>) -> Arc<Result<Object<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut res = MaybePlacebo::<Arc<Result<Object<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
                            let mut maybeCrypto: Arc<Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::AtomicPrimitives(&crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::DefaultCryptoConfig());
                            maybeCrypto = _out0.clone();
                            let mut valueOrError0: Arc<Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeCrypto.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                                        AwsCryptographyPrimitives: e.clone()
                                                    })
                                            })
                                    }));
                            if valueOrError0.IsFailure() {
                                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient>>());
                                return res.read();
                            };
                            let mut cryptoPrimitivesX: Object<dyn IAwsCryptographicPrimitivesClient> = upcast_object::<AtomicPrimitivesClient, dyn IAwsCryptographicPrimitivesClient>()(valueOrError0.Extract());
                            let mut cryptoPrimitives: Object<AtomicPrimitivesClient> = cast_object!(cryptoPrimitivesX.clone(), AtomicPrimitivesClient);
                            let mut client: Object<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient>;
                            let mut _nw0: Object<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient::_allocate_object();
                            crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient::_ctor(&_nw0, &Arc::new(Config::Config {
                                        crypto: cryptoPrimitives.clone()
                                    }));
                            client = _nw0.clone();
                            res = MaybePlacebo::from(Arc::new(Result::<Object<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                            value: client.clone()
                                        }));
                            return res.read();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1751,3)
                        pub fn CreateSuccessOfClient(client: &Object<dyn IAwsCryptographicMaterialProvidersClient>) -> Arc<Result<Object<dyn IAwsCryptographicMaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            Arc::new(Result::<Object<dyn IAwsCryptographicMaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                    value: client.clone()
                                })
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1754,3)
                        pub fn CreateFailureOfError(error: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>) -> Arc<Result<Object<dyn IAwsCryptographicMaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            Arc::new(Result::<Object<dyn IAwsCryptographicMaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                    error: error.clone()
                                })
                        }
                    }

                    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy(33,3)
                    pub struct MaterialProvidersClient {
                        pub __i_config: Arc<Config>
                    }

                    impl MaterialProvidersClient {
                        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                        pub fn _allocate_object() -> Object<Self> {
                            allocate_object::<Self>()
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Index.dfy(41,5)
                        pub fn _ctor(this: &Object<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient>, config: &Arc<Config>) -> () {
                            let mut _set___i_config: bool = false;
                            update_field_uninit_object!(this.clone(), __i_config, _set___i_config, config.clone());
                            return ();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1765,5)
                        pub fn config(&self) -> Arc<Config> {
                            self.__i_config.clone()
                        }
                    }

                    impl UpcastObject<DynAny>
                        for crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient {
                        UpcastObjectFn!(DynAny);
                    }

                    impl IAwsCryptographicMaterialProvidersClient
                        for crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient {
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1774,5)
                        fn CreateAwsKmsKeyring(&self, input: &Arc<CreateAwsKmsKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1805,5)
                        fn CreateAwsKmsDiscoveryKeyring(&self, input: &Arc<CreateAwsKmsDiscoveryKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsDiscoveryKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1836,5)
                        fn CreateAwsKmsMultiKeyring(&self, input: &Arc<CreateAwsKmsMultiKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsMultiKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1868,5)
                        fn CreateAwsKmsDiscoveryMultiKeyring(&self, input: &Arc<CreateAwsKmsDiscoveryMultiKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsDiscoveryMultiKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1900,5)
                        fn CreateAwsKmsMrkKeyring(&self, input: &Arc<CreateAwsKmsMrkKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsMrkKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1931,5)
                        fn CreateAwsKmsMrkMultiKeyring(&self, input: &Arc<CreateAwsKmsMrkMultiKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsMrkMultiKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1963,5)
                        fn CreateAwsKmsMrkDiscoveryKeyring(&self, input: &Arc<CreateAwsKmsMrkDiscoveryKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsMrkDiscoveryKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1994,5)
                        fn CreateAwsKmsMrkDiscoveryMultiKeyring(&self, input: &Arc<CreateAwsKmsMrkDiscoveryMultiKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsMrkDiscoveryMultiKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2026,5)
                        fn CreateAwsKmsHierarchicalKeyring(&self, input: &Arc<CreateAwsKmsHierarchicalKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsHierarchicalKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2086,5)
                        fn CreateAwsKmsRsaKeyring(&self, input: &Arc<CreateAwsKmsRsaKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsRsaKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2118,5)
                        fn CreateAwsKmsEcdhKeyring(&self, input: &Arc<CreateAwsKmsEcdhKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateAwsKmsEcdhKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2149,5)
                        fn CreateMultiKeyring(&self, input: &Arc<CreateMultiKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateMultiKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2187,5)
                        fn CreateRawAesKeyring(&self, input: &Arc<CreateRawAesKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateRawAesKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2213,5)
                        fn CreateRawRsaKeyring(&self, input: &Arc<CreateRawRsaKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateRawRsaKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2239,5)
                        fn CreateRawEcdhKeyring(&self, input: &Arc<CreateRawEcdhKeyringInput>) -> Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateRawEcdhKeyring(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2265,5)
                        fn CreateDefaultCryptographicMaterialsManager(&self, input: &Arc<CreateDefaultCryptographicMaterialsManagerInput>) -> Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateDefaultCryptographicMaterialsManager(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2296,5)
                        fn CreateRequiredEncryptionContextCMM(&self, input: &Arc<CreateRequiredEncryptionContextCMMInput>) -> Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateRequiredEncryptionContextCMM(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2334,5)
                        fn CreateCryptographicMaterialsCache(&self, input: &Arc<CreateCryptographicMaterialsCacheInput>) -> Arc<Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateCryptographicMaterialsCache(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2382,5)
                        fn CreateDefaultClientSupplier(&self, input: &Arc<CreateDefaultClientSupplierInput>) -> Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            let mut output: Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out0: Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            _out0 = crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::CreateDefaultClientSupplier(&self.config().clone(), input);
                            output = _out0.clone();
                            return output.clone();
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2407,5)
                        fn InitializeEncryptionMaterials(&self, input: &Arc<InitializeEncryptionMaterialsInput>) -> Arc<Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::InitializeEncryptionMaterials(&self.config().clone(), input)
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2416,5)
                        fn InitializeDecryptionMaterials(&self, input: &Arc<InitializeDecryptionMaterialsInput>) -> Arc<Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::InitializeDecryptionMaterials(&self.config().clone(), input)
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2425,5)
                        fn ValidEncryptionMaterialsTransition(&self, input: &Arc<ValidEncryptionMaterialsTransitionInput>) -> Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::ValidEncryptionMaterialsTransition(&self.config().clone(), input)
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2434,5)
                        fn ValidDecryptionMaterialsTransition(&self, input: &Arc<ValidDecryptionMaterialsTransitionInput>) -> Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::ValidDecryptionMaterialsTransition(&self.config().clone(), input)
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2443,5)
                        fn EncryptionMaterialsHasPlaintextDataKey(&self, input: &Arc<EncryptionMaterials>) -> Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(&self.config().clone(), input)
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2452,5)
                        fn DecryptionMaterialsWithPlaintextDataKey(&self, input: &Arc<DecryptionMaterials>) -> Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::DecryptionMaterialsWithPlaintextDataKey(&self.config().clone(), input)
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2461,5)
                        fn GetAlgorithmSuiteInfo(&self, input: &Sequence<u8>) -> Arc<Result<Arc<AlgorithmSuiteInfo>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::GetAlgorithmSuiteInfo(&self.config().clone(), input)
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2470,5)
                        fn ValidAlgorithmSuiteInfo(&self, input: &Arc<AlgorithmSuiteInfo>) -> Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::ValidAlgorithmSuiteInfo(&self.config().clone(), input)
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2479,5)
                        fn ValidateCommitmentPolicyOnEncrypt(&self, input: &Arc<ValidateCommitmentPolicyOnEncryptInput>) -> Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::ValidateCommitmentPolicyOnEncrypt(&self.config().clone(), input)
                        }
                        /// Functions that are transparent do not need ensures
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(2488,5)
                        fn ValidateCommitmentPolicyOnDecrypt(&self, input: &Arc<ValidateCommitmentPolicyOnDecryptInput>) -> Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                            crate::implementation_from_dafny::_AwsCryptographyMaterialProvidersOperations_Compile::_default::ValidateCommitmentPolicyOnDecrypt(&self.config().clone(), input)
                        }
                    }

                    impl UpcastObject<dyn IAwsCryptographicMaterialProvidersClient>
                        for crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient {
                        UpcastObjectFn!(dyn IAwsCryptographicMaterialProvidersClient);
                    }

                    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(9,1)
                    pub mod types {
                        pub use ::dafny_runtime::truncate;
                        pub use ::dafny_runtime::int;
                        pub use ::dafny_runtime::DafnyInt;
                        pub use ::dafny_runtime::DafnyType;
                        pub use ::std::fmt::Debug;
                        pub use ::std::fmt::Formatter;
                        pub use ::dafny_runtime::DafnyPrint;
                        pub use ::std::cmp::Eq;
                        pub use ::std::hash::Hash;
                        pub use ::std::hash::Hasher;
                        pub use ::std::default::Default;
                        pub use ::std::convert::AsRef;
                        pub use ::dafny_runtime::SequenceIter;
                        pub use ::std::sync::Arc;
                        pub use ::dafny_runtime::seq;
                        pub use ::dafny_runtime::Sequence;
                        pub use ::dafny_runtime::Object;
                        pub use ::dafny_runtime::allocate_object;
                        pub use ::dafny_runtime::UpcastObject;
                        pub use ::dafny_runtime::DynAny;
                        pub use ::dafny_runtime::UpcastObjectFn;
                        pub use ::dafny_runtime::Any;
                        pub use ::std::marker::Sync;
                        pub use ::std::marker::Send;
                        pub use ::dafny_runtime::rd;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
                        pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
                        pub use ::dafny_runtime::DafnyCharUTF16;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::IKeyStoreClient;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec;
                        pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
                        pub use ::dafny_runtime::Map;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::SymmetricKeyLength;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BranchKeyMaterials;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BeaconKeyMaterials;

                        pub struct _default {}

                        impl _default {
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(885,3)
                            pub fn IsValid_CountingNumber(x: i32) -> bool {
                                !(x < truncate!(int!(1), i32))
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1580,3)
                            pub fn IsValid_PositiveInteger(x: i32) -> bool {
                                !(x < truncate!(int!(0), i32))
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1584,3)
                            pub fn IsValid_PositiveLong(x: i64) -> bool {
                                !(x < truncate!(int!(0), i64))
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1729,3)
                            pub fn IsDummySubsetType(x: &DafnyInt) -> bool {
                                int!(0) < x.clone()
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(19,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DafnyCallEvent<I: DafnyType, O: DafnyType> {
                            DafnyCallEvent {
                                input: I,
                                output: O
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> DafnyCallEvent<I, O> {
                            /// Returns a borrow of the field input
                            pub fn input(&self) -> &I {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => input,
                                }
                            }
                            /// Returns a borrow of the field output
                            pub fn output(&self) -> &O {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => output,
                                }
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> Debug
                            for DafnyCallEvent<I, O> {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> DafnyPrint
                            for DafnyCallEvent<I, O> {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DafnyCallEvent.DafnyCallEvent(")?;
                                        DafnyPrint::fmt_print(input, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(output, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl<I: DafnyType + Eq, O: DafnyType + Eq> Eq
                            for DafnyCallEvent<I, O> {}

                        impl<I: DafnyType + Hash, O: DafnyType + Hash> Hash
                            for DafnyCallEvent<I, O> {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                        Hash::hash(input, _state);
                                        Hash::hash(output, _state)
                                    },
                                }
                            }
                        }

                        impl<I: DafnyType + Default, O: DafnyType + Default> Default
                            for DafnyCallEvent<I, O> {
                            fn default() -> DafnyCallEvent<I, O> {
                                DafnyCallEvent::DafnyCallEvent {
                                    input: Default::default(),
                                    output: Default::default()
                                }
                            }
                        }

                        impl<I: DafnyType, O: DafnyType> AsRef<DafnyCallEvent<I, O>>
                            for DafnyCallEvent<I, O> {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(25,3)
                        #[derive(PartialEq, Clone)]
                        pub enum AesWrappingAlg {
                            ALG_AES128_GCM_IV12_TAG16 {},
                            ALG_AES192_GCM_IV12_TAG16 {},
                            ALG_AES256_GCM_IV12_TAG16 {}
                        }

                        impl AesWrappingAlg {}

                        impl Debug
                            for AesWrappingAlg {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for AesWrappingAlg {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    AesWrappingAlg::ALG_AES128_GCM_IV12_TAG16{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.AesWrappingAlg.ALG__AES128__GCM__IV12__TAG16")?;
                                        Ok(())
                                    },
                                    AesWrappingAlg::ALG_AES192_GCM_IV12_TAG16{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.AesWrappingAlg.ALG__AES192__GCM__IV12__TAG16")?;
                                        Ok(())
                                    },
                                    AesWrappingAlg::ALG_AES256_GCM_IV12_TAG16{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.AesWrappingAlg.ALG__AES256__GCM__IV12__TAG16")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl AesWrappingAlg {
                            /// Enumerates all possible values of AesWrappingAlg
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<AesWrappingAlg>> {
                                seq![Arc::new(AesWrappingAlg::ALG_AES128_GCM_IV12_TAG16 {}), Arc::new(AesWrappingAlg::ALG_AES192_GCM_IV12_TAG16 {}), Arc::new(AesWrappingAlg::ALG_AES256_GCM_IV12_TAG16 {})].iter()
                            }
                        }

                        impl Eq
                            for AesWrappingAlg {}

                        impl Hash
                            for AesWrappingAlg {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    AesWrappingAlg::ALG_AES128_GCM_IV12_TAG16{} => {

                                    },
                                    AesWrappingAlg::ALG_AES192_GCM_IV12_TAG16{} => {

                                    },
                                    AesWrappingAlg::ALG_AES256_GCM_IV12_TAG16{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for AesWrappingAlg {
                            fn default() -> AesWrappingAlg {
                                AesWrappingAlg::ALG_AES128_GCM_IV12_TAG16 {}
                            }
                        }

                        impl AsRef<AesWrappingAlg>
                            for AesWrappingAlg {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(29,3)
                        #[derive(PartialEq, Clone)]
                        pub enum AlgorithmSuiteId {
                            ESDK {
                                ESDK: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId>
                            },
                            DBE {
                                DBE: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DBEAlgorithmSuiteId>
                            }
                        }

                        impl AlgorithmSuiteId {
                            /// Gets the field ESDK for all enum members which have it
                            pub fn ESDK(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId> {
                                match self {
                                    AlgorithmSuiteId::ESDK{ESDK, } => ESDK,
                                    AlgorithmSuiteId::DBE{DBE, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field DBE for all enum members which have it
                            pub fn DBE(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DBEAlgorithmSuiteId> {
                                match self {
                                    AlgorithmSuiteId::ESDK{ESDK, } => panic!("field does not exist on this variant"),
                                    AlgorithmSuiteId::DBE{DBE, } => DBE,
                                }
                            }
                        }

                        impl Debug
                            for AlgorithmSuiteId {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for AlgorithmSuiteId {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    AlgorithmSuiteId::ESDK{ESDK, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteId.ESDK(")?;
                                        DafnyPrint::fmt_print(ESDK, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    AlgorithmSuiteId::DBE{DBE, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteId.DBE(")?;
                                        DafnyPrint::fmt_print(DBE, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for AlgorithmSuiteId {}

                        impl Hash
                            for AlgorithmSuiteId {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    AlgorithmSuiteId::ESDK{ESDK, } => {
                                        Hash::hash(ESDK, _state)
                                    },
                                    AlgorithmSuiteId::DBE{DBE, } => {
                                        Hash::hash(DBE, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for AlgorithmSuiteId {
                            fn default() -> AlgorithmSuiteId {
                                AlgorithmSuiteId::ESDK {
                                    ESDK: Default::default()
                                }
                            }
                        }

                        impl AsRef<AlgorithmSuiteId>
                            for AlgorithmSuiteId {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(32,3)
                        #[derive(PartialEq, Clone)]
                        pub enum AlgorithmSuiteInfo {
                            AlgorithmSuiteInfo {
                                id: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId>,
                                binaryId: Sequence<u8>,
                                messageVersion: i32,
                                encrypt: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Encrypt>,
                                kdf: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm>,
                                commitment: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm>,
                                signature: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm>,
                                symmetricSignature: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm>,
                                edkWrapping: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm>
                            }
                        }

                        impl AlgorithmSuiteInfo {
                            /// Returns a borrow of the field id
                            pub fn id(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId> {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => id,
                                }
                            }
                            /// Returns a borrow of the field binaryId
                            pub fn binaryId(&self) -> &Sequence<u8> {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => binaryId,
                                }
                            }
                            /// Returns a borrow of the field messageVersion
                            pub fn messageVersion(&self) -> &i32 {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => messageVersion,
                                }
                            }
                            /// Returns a borrow of the field encrypt
                            pub fn encrypt(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Encrypt> {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => encrypt,
                                }
                            }
                            /// Returns a borrow of the field kdf
                            pub fn kdf(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm> {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => kdf,
                                }
                            }
                            /// Returns a borrow of the field commitment
                            pub fn commitment(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm> {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => commitment,
                                }
                            }
                            /// Returns a borrow of the field signature
                            pub fn signature(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm> {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => signature,
                                }
                            }
                            /// Returns a borrow of the field symmetricSignature
                            pub fn symmetricSignature(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm> {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => symmetricSignature,
                                }
                            }
                            /// Returns a borrow of the field edkWrapping
                            pub fn edkWrapping(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm> {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => edkWrapping,
                                }
                            }
                        }

                        impl Debug
                            for AlgorithmSuiteInfo {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for AlgorithmSuiteInfo {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteInfo.AlgorithmSuiteInfo(")?;
                                        DafnyPrint::fmt_print(id, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(binaryId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(messageVersion, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encrypt, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kdf, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(commitment, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(signature, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(symmetricSignature, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(edkWrapping, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for AlgorithmSuiteInfo {}

                        impl Hash
                            for AlgorithmSuiteInfo {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    AlgorithmSuiteInfo::AlgorithmSuiteInfo{id, binaryId, messageVersion, encrypt, kdf, commitment, signature, symmetricSignature, edkWrapping, } => {
                                        Hash::hash(id, _state);
                                        Hash::hash(binaryId, _state);
                                        Hash::hash(messageVersion, _state);
                                        Hash::hash(encrypt, _state);
                                        Hash::hash(kdf, _state);
                                        Hash::hash(commitment, _state);
                                        Hash::hash(signature, _state);
                                        Hash::hash(symmetricSignature, _state);
                                        Hash::hash(edkWrapping, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for AlgorithmSuiteInfo {
                            fn default() -> AlgorithmSuiteInfo {
                                AlgorithmSuiteInfo::AlgorithmSuiteInfo {
                                    id: Default::default(),
                                    binaryId: Default::default(),
                                    messageVersion: Default::default(),
                                    encrypt: Default::default(),
                                    kdf: Default::default(),
                                    commitment: Default::default(),
                                    signature: Default::default(),
                                    symmetricSignature: Default::default(),
                                    edkWrapping: Default::default()
                                }
                            }
                        }

                        impl AsRef<AlgorithmSuiteInfo>
                            for AlgorithmSuiteInfo {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(43,3)
                        pub struct IAwsCryptographicMaterialProvidersClientCallHistory {}

                        impl IAwsCryptographicMaterialProvidersClientCallHistory {
                            /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                            pub fn _allocate_object() -> Object<Self> {
                                allocate_object::<Self>()
                            }
                        }

                        impl UpcastObject<DynAny>
                            for crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IAwsCryptographicMaterialProvidersClientCallHistory {
                            UpcastObjectFn!(DynAny);
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(105,3)
                        pub trait IAwsCryptographicMaterialProvidersClient: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(134,5)
                            fn CreateAwsKmsKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(160,5)
                            fn CreateAwsKmsDiscoveryKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsDiscoveryKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(186,5)
                            fn CreateAwsKmsMultiKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMultiKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(213,5)
                            fn CreateAwsKmsDiscoveryMultiKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsDiscoveryMultiKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(240,5)
                            fn CreateAwsKmsMrkKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(266,5)
                            fn CreateAwsKmsMrkMultiKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkMultiKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(293,5)
                            fn CreateAwsKmsMrkDiscoveryKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkDiscoveryKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(319,5)
                            fn CreateAwsKmsMrkDiscoveryMultiKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkDiscoveryMultiKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(346,5)
                            fn CreateAwsKmsHierarchicalKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsHierarchicalKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(401,5)
                            fn CreateAwsKmsRsaKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsRsaKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(428,5)
                            fn CreateAwsKmsEcdhKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsEcdhKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(454,5)
                            fn CreateMultiKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateMultiKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(487,5)
                            fn CreateRawAesKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawAesKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(508,5)
                            fn CreateRawRsaKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawRsaKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(529,5)
                            fn CreateRawEcdhKeyring(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawEcdhKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(550,5)
                            fn CreateDefaultCryptographicMaterialsManager(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultCryptographicMaterialsManagerInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(576,5)
                            fn CreateRequiredEncryptionContextCMM(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRequiredEncryptionContextCMMInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(609,5)
                            fn CreateCryptographicMaterialsCache(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateCryptographicMaterialsCacheInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(652,5)
                            fn CreateDefaultClientSupplier(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultClientSupplierInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(673,5)
                            fn InitializeEncryptionMaterials(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeEncryptionMaterialsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(679,5)
                            fn InitializeDecryptionMaterials(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeDecryptionMaterialsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(685,5)
                            fn ValidEncryptionMaterialsTransition(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidEncryptionMaterialsTransitionInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(691,5)
                            fn ValidDecryptionMaterialsTransition(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidDecryptionMaterialsTransitionInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(697,5)
                            fn EncryptionMaterialsHasPlaintextDataKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(703,5)
                            fn DecryptionMaterialsWithPlaintextDataKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(709,5)
                            fn GetAlgorithmSuiteInfo(&self, input: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(715,5)
                            fn ValidAlgorithmSuiteInfo(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(721,5)
                            fn ValidateCommitmentPolicyOnEncrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(727,5)
                            fn ValidateCommitmentPolicyOnDecrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(732,3)
                        pub struct IBranchKeyIdSupplierCallHistory {}

                        impl IBranchKeyIdSupplierCallHistory {
                            /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                            pub fn _allocate_object() -> Object<Self> {
                                allocate_object::<Self>()
                            }
                        }

                        impl UpcastObject<DynAny>
                            for crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IBranchKeyIdSupplierCallHistory {
                            UpcastObjectFn!(DynAny);
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(738,3)
                        pub trait IBranchKeyIdSupplier: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(767,5)
                            fn GetBranchKeyId(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetBranchKeyIdInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetBranchKeyIdOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                                let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetBranchKeyIdOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetBranchKeyIdOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                _out0 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IBranchKeyIdSupplier::_GetBranchKeyId_k(rd!(Object::<_>::from_ref(self)), input);
                                output = _out0.clone();
                                return output.clone();
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(784,5)
                            fn _GetBranchKeyId_k(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetBranchKeyIdInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetBranchKeyIdOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(797,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CacheType {
                            Default {
                                Default: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DefaultCache>
                            },
                            No {
                                No: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::NoCache>
                            },
                            SingleThreaded {
                                SingleThreaded: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SingleThreadedCache>
                            },
                            MultiThreaded {
                                MultiThreaded: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::MultiThreadedCache>
                            },
                            StormTracking {
                                StormTracking: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::StormTrackingCache>
                            },
                            Shared {
                                Shared: Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache>
                            }
                        }

                        impl CacheType {
                            /// Gets the field Default for all enum members which have it
                            pub fn Default(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DefaultCache> {
                                match self {
                                    CacheType::Default{Default, } => Default,
                                    CacheType::No{No, } => panic!("field does not exist on this variant"),
                                    CacheType::SingleThreaded{SingleThreaded, } => panic!("field does not exist on this variant"),
                                    CacheType::MultiThreaded{MultiThreaded, } => panic!("field does not exist on this variant"),
                                    CacheType::StormTracking{StormTracking, } => panic!("field does not exist on this variant"),
                                    CacheType::Shared{Shared, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field No for all enum members which have it
                            pub fn No(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::NoCache> {
                                match self {
                                    CacheType::Default{Default, } => panic!("field does not exist on this variant"),
                                    CacheType::No{No, } => No,
                                    CacheType::SingleThreaded{SingleThreaded, } => panic!("field does not exist on this variant"),
                                    CacheType::MultiThreaded{MultiThreaded, } => panic!("field does not exist on this variant"),
                                    CacheType::StormTracking{StormTracking, } => panic!("field does not exist on this variant"),
                                    CacheType::Shared{Shared, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field SingleThreaded for all enum members which have it
                            pub fn SingleThreaded(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SingleThreadedCache> {
                                match self {
                                    CacheType::Default{Default, } => panic!("field does not exist on this variant"),
                                    CacheType::No{No, } => panic!("field does not exist on this variant"),
                                    CacheType::SingleThreaded{SingleThreaded, } => SingleThreaded,
                                    CacheType::MultiThreaded{MultiThreaded, } => panic!("field does not exist on this variant"),
                                    CacheType::StormTracking{StormTracking, } => panic!("field does not exist on this variant"),
                                    CacheType::Shared{Shared, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field MultiThreaded for all enum members which have it
                            pub fn MultiThreaded(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::MultiThreadedCache> {
                                match self {
                                    CacheType::Default{Default, } => panic!("field does not exist on this variant"),
                                    CacheType::No{No, } => panic!("field does not exist on this variant"),
                                    CacheType::SingleThreaded{SingleThreaded, } => panic!("field does not exist on this variant"),
                                    CacheType::MultiThreaded{MultiThreaded, } => MultiThreaded,
                                    CacheType::StormTracking{StormTracking, } => panic!("field does not exist on this variant"),
                                    CacheType::Shared{Shared, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field StormTracking for all enum members which have it
                            pub fn StormTracking(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::StormTrackingCache> {
                                match self {
                                    CacheType::Default{Default, } => panic!("field does not exist on this variant"),
                                    CacheType::No{No, } => panic!("field does not exist on this variant"),
                                    CacheType::SingleThreaded{SingleThreaded, } => panic!("field does not exist on this variant"),
                                    CacheType::MultiThreaded{MultiThreaded, } => panic!("field does not exist on this variant"),
                                    CacheType::StormTracking{StormTracking, } => StormTracking,
                                    CacheType::Shared{Shared, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field Shared for all enum members which have it
                            pub fn Shared(&self) -> &Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache> {
                                match self {
                                    CacheType::Default{Default, } => panic!("field does not exist on this variant"),
                                    CacheType::No{No, } => panic!("field does not exist on this variant"),
                                    CacheType::SingleThreaded{SingleThreaded, } => panic!("field does not exist on this variant"),
                                    CacheType::MultiThreaded{MultiThreaded, } => panic!("field does not exist on this variant"),
                                    CacheType::StormTracking{StormTracking, } => panic!("field does not exist on this variant"),
                                    CacheType::Shared{Shared, } => Shared,
                                }
                            }
                        }

                        impl Debug
                            for CacheType {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CacheType {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CacheType::Default{Default, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.Default(")?;
                                        DafnyPrint::fmt_print(Default, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    CacheType::No{No, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.No(")?;
                                        DafnyPrint::fmt_print(No, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    CacheType::SingleThreaded{SingleThreaded, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.SingleThreaded(")?;
                                        DafnyPrint::fmt_print(SingleThreaded, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    CacheType::MultiThreaded{MultiThreaded, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.MultiThreaded(")?;
                                        DafnyPrint::fmt_print(MultiThreaded, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    CacheType::StormTracking{StormTracking, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.StormTracking(")?;
                                        DafnyPrint::fmt_print(StormTracking, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    CacheType::Shared{Shared, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CacheType.Shared(")?;
                                        DafnyPrint::fmt_print(Shared, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CacheType {}

                        impl Hash
                            for CacheType {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CacheType::Default{Default, } => {
                                        Hash::hash(Default, _state)
                                    },
                                    CacheType::No{No, } => {
                                        Hash::hash(No, _state)
                                    },
                                    CacheType::SingleThreaded{SingleThreaded, } => {
                                        Hash::hash(SingleThreaded, _state)
                                    },
                                    CacheType::MultiThreaded{MultiThreaded, } => {
                                        Hash::hash(MultiThreaded, _state)
                                    },
                                    CacheType::StormTracking{StormTracking, } => {
                                        Hash::hash(StormTracking, _state)
                                    },
                                    CacheType::Shared{Shared, } => {
                                        Hash::hash(Shared, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CacheType {
                            fn default() -> CacheType {
                                CacheType::Default {
                                    Default: Default::default()
                                }
                            }
                        }

                        impl AsRef<CacheType>
                            for CacheType {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(804,3)
                        pub struct IClientSupplierCallHistory {}

                        impl IClientSupplierCallHistory {
                            /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                            pub fn _allocate_object() -> Object<Self> {
                                allocate_object::<Self>()
                            }
                        }

                        impl UpcastObject<DynAny>
                            for crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplierCallHistory {
                            UpcastObjectFn!(DynAny);
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(810,3)
                        pub trait IClientSupplier: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(839,5)
                            fn GetClient(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                                let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                _out0 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier::_GetClient_k(rd!(Object::<_>::from_ref(self)), input);
                                output = _out0.clone();
                                return output.clone();
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(862,5)
                            fn _GetClient_k(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(881,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CommitmentPolicy {
                            ESDK {
                                ESDK: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy>
                            },
                            DBE {
                                DBE: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DBECommitmentPolicy>
                            }
                        }

                        impl CommitmentPolicy {
                            /// Gets the field ESDK for all enum members which have it
                            pub fn ESDK(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy> {
                                match self {
                                    CommitmentPolicy::ESDK{ESDK, } => ESDK,
                                    CommitmentPolicy::DBE{DBE, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field DBE for all enum members which have it
                            pub fn DBE(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DBECommitmentPolicy> {
                                match self {
                                    CommitmentPolicy::ESDK{ESDK, } => panic!("field does not exist on this variant"),
                                    CommitmentPolicy::DBE{DBE, } => DBE,
                                }
                            }
                        }

                        impl Debug
                            for CommitmentPolicy {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CommitmentPolicy {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CommitmentPolicy::ESDK{ESDK, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CommitmentPolicy.ESDK(")?;
                                        DafnyPrint::fmt_print(ESDK, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    CommitmentPolicy::DBE{DBE, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CommitmentPolicy.DBE(")?;
                                        DafnyPrint::fmt_print(DBE, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CommitmentPolicy {}

                        impl Hash
                            for CommitmentPolicy {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CommitmentPolicy::ESDK{ESDK, } => {
                                        Hash::hash(ESDK, _state)
                                    },
                                    CommitmentPolicy::DBE{DBE, } => {
                                        Hash::hash(DBE, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CommitmentPolicy {
                            fn default() -> CommitmentPolicy {
                                CommitmentPolicy::ESDK {
                                    ESDK: Default::default()
                                }
                            }
                        }

                        impl AsRef<CommitmentPolicy>
                            for CommitmentPolicy {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(884,3)
                        pub type CountingNumber = i32;

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(888,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsDiscoveryKeyringInput {
                            CreateAwsKmsDiscoveryKeyringInput {
                                kmsClient: Object<dyn IKMSClient>,
                                discoveryFilter: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter>>>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>
                            }
                        }

                        impl CreateAwsKmsDiscoveryKeyringInput {
                            /// Returns a borrow of the field kmsClient
                            pub fn kmsClient(&self) -> &Object<dyn IKMSClient> {
                                match self {
                                    CreateAwsKmsDiscoveryKeyringInput::CreateAwsKmsDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, } => kmsClient,
                                }
                            }
                            /// Returns a borrow of the field discoveryFilter
                            pub fn discoveryFilter(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter>>> {
                                match self {
                                    CreateAwsKmsDiscoveryKeyringInput::CreateAwsKmsDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, } => discoveryFilter,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsDiscoveryKeyringInput::CreateAwsKmsDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, } => grantTokens,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsDiscoveryKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsDiscoveryKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsDiscoveryKeyringInput::CreateAwsKmsDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryKeyringInput.CreateAwsKmsDiscoveryKeyringInput(")?;
                                        DafnyPrint::fmt_print(kmsClient, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(discoveryFilter, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsDiscoveryKeyringInput {}

                        impl Hash
                            for CreateAwsKmsDiscoveryKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsDiscoveryKeyringInput::CreateAwsKmsDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, } => {
                                        Hash::hash(kmsClient, _state);
                                        Hash::hash(discoveryFilter, _state);
                                        Hash::hash(grantTokens, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsDiscoveryKeyringInput {
                            fn default() -> CreateAwsKmsDiscoveryKeyringInput {
                                CreateAwsKmsDiscoveryKeyringInput::CreateAwsKmsDiscoveryKeyringInput {
                                    kmsClient: Default::default(),
                                    discoveryFilter: Default::default(),
                                    grantTokens: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsDiscoveryKeyringInput>
                            for CreateAwsKmsDiscoveryKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(893,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsDiscoveryMultiKeyringInput {
                            CreateAwsKmsDiscoveryMultiKeyringInput {
                                regions: Sequence<Sequence<DafnyCharUTF16>>,
                                discoveryFilter: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter>>>,
                                clientSupplier: Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier>>>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>
                            }
                        }

                        impl CreateAwsKmsDiscoveryMultiKeyringInput {
                            /// Returns a borrow of the field regions
                            pub fn regions(&self) -> &Sequence<Sequence<DafnyCharUTF16>> {
                                match self {
                                    CreateAwsKmsDiscoveryMultiKeyringInput::CreateAwsKmsDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => regions,
                                }
                            }
                            /// Returns a borrow of the field discoveryFilter
                            pub fn discoveryFilter(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter>>> {
                                match self {
                                    CreateAwsKmsDiscoveryMultiKeyringInput::CreateAwsKmsDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => discoveryFilter,
                                }
                            }
                            /// Returns a borrow of the field clientSupplier
                            pub fn clientSupplier(&self) -> &Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier>>> {
                                match self {
                                    CreateAwsKmsDiscoveryMultiKeyringInput::CreateAwsKmsDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => clientSupplier,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsDiscoveryMultiKeyringInput::CreateAwsKmsDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => grantTokens,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsDiscoveryMultiKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsDiscoveryMultiKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsDiscoveryMultiKeyringInput::CreateAwsKmsDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryMultiKeyringInput.CreateAwsKmsDiscoveryMultiKeyringInput(")?;
                                        DafnyPrint::fmt_print(regions, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(discoveryFilter, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(clientSupplier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsDiscoveryMultiKeyringInput {}

                        impl Hash
                            for CreateAwsKmsDiscoveryMultiKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsDiscoveryMultiKeyringInput::CreateAwsKmsDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => {
                                        Hash::hash(regions, _state);
                                        Hash::hash(discoveryFilter, _state);
                                        Hash::hash(clientSupplier, _state);
                                        Hash::hash(grantTokens, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsDiscoveryMultiKeyringInput {
                            fn default() -> CreateAwsKmsDiscoveryMultiKeyringInput {
                                CreateAwsKmsDiscoveryMultiKeyringInput::CreateAwsKmsDiscoveryMultiKeyringInput {
                                    regions: Default::default(),
                                    discoveryFilter: Default::default(),
                                    clientSupplier: Default::default(),
                                    grantTokens: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsDiscoveryMultiKeyringInput>
                            for CreateAwsKmsDiscoveryMultiKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(899,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsEcdhKeyringInput {
                            CreateAwsKmsEcdhKeyringInput {
                                KeyAgreementScheme: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsEcdhStaticConfigurations>,
                                curveSpec: Arc<ECDHCurveSpec>,
                                kmsClient: Object<dyn IKMSClient>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>
                            }
                        }

                        impl CreateAwsKmsEcdhKeyringInput {
                            /// Returns a borrow of the field KeyAgreementScheme
                            pub fn KeyAgreementScheme(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsEcdhStaticConfigurations> {
                                match self {
                                    CreateAwsKmsEcdhKeyringInput::CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme, curveSpec, kmsClient, grantTokens, } => KeyAgreementScheme,
                                }
                            }
                            /// Returns a borrow of the field curveSpec
                            pub fn curveSpec(&self) -> &Arc<ECDHCurveSpec> {
                                match self {
                                    CreateAwsKmsEcdhKeyringInput::CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme, curveSpec, kmsClient, grantTokens, } => curveSpec,
                                }
                            }
                            /// Returns a borrow of the field kmsClient
                            pub fn kmsClient(&self) -> &Object<dyn IKMSClient> {
                                match self {
                                    CreateAwsKmsEcdhKeyringInput::CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme, curveSpec, kmsClient, grantTokens, } => kmsClient,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsEcdhKeyringInput::CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme, curveSpec, kmsClient, grantTokens, } => grantTokens,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsEcdhKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsEcdhKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsEcdhKeyringInput::CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme, curveSpec, kmsClient, grantTokens, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsEcdhKeyringInput.CreateAwsKmsEcdhKeyringInput(")?;
                                        DafnyPrint::fmt_print(KeyAgreementScheme, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(curveSpec, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kmsClient, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsEcdhKeyringInput {}

                        impl Hash
                            for CreateAwsKmsEcdhKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsEcdhKeyringInput::CreateAwsKmsEcdhKeyringInput{KeyAgreementScheme, curveSpec, kmsClient, grantTokens, } => {
                                        Hash::hash(KeyAgreementScheme, _state);
                                        Hash::hash(curveSpec, _state);
                                        Hash::hash(kmsClient, _state);
                                        Hash::hash(grantTokens, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsEcdhKeyringInput {
                            fn default() -> CreateAwsKmsEcdhKeyringInput {
                                CreateAwsKmsEcdhKeyringInput::CreateAwsKmsEcdhKeyringInput {
                                    KeyAgreementScheme: Default::default(),
                                    curveSpec: Default::default(),
                                    kmsClient: Default::default(),
                                    grantTokens: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsEcdhKeyringInput>
                            for CreateAwsKmsEcdhKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(905,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsHierarchicalKeyringInput {
                            CreateAwsKmsHierarchicalKeyringInput {
                                branchKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                branchKeyIdSupplier: Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IBranchKeyIdSupplier>>>,
                                keyStore: Object<dyn IKeyStoreClient>,
                                ttlSeconds: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong,
                                cache: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType>>>,
                                partitionId: Arc<Option<Sequence<DafnyCharUTF16>>>
                            }
                        }

                        impl CreateAwsKmsHierarchicalKeyringInput {
                            /// Returns a borrow of the field branchKeyId
                            pub fn branchKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                match self {
                                    CreateAwsKmsHierarchicalKeyringInput::CreateAwsKmsHierarchicalKeyringInput{branchKeyId, branchKeyIdSupplier, keyStore, ttlSeconds, cache, partitionId, } => branchKeyId,
                                }
                            }
                            /// Returns a borrow of the field branchKeyIdSupplier
                            pub fn branchKeyIdSupplier(&self) -> &Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IBranchKeyIdSupplier>>> {
                                match self {
                                    CreateAwsKmsHierarchicalKeyringInput::CreateAwsKmsHierarchicalKeyringInput{branchKeyId, branchKeyIdSupplier, keyStore, ttlSeconds, cache, partitionId, } => branchKeyIdSupplier,
                                }
                            }
                            /// Returns a borrow of the field keyStore
                            pub fn keyStore(&self) -> &Object<dyn IKeyStoreClient> {
                                match self {
                                    CreateAwsKmsHierarchicalKeyringInput::CreateAwsKmsHierarchicalKeyringInput{branchKeyId, branchKeyIdSupplier, keyStore, ttlSeconds, cache, partitionId, } => keyStore,
                                }
                            }
                            /// Returns a borrow of the field ttlSeconds
                            pub fn ttlSeconds(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong {
                                match self {
                                    CreateAwsKmsHierarchicalKeyringInput::CreateAwsKmsHierarchicalKeyringInput{branchKeyId, branchKeyIdSupplier, keyStore, ttlSeconds, cache, partitionId, } => ttlSeconds,
                                }
                            }
                            /// Returns a borrow of the field cache
                            pub fn cache(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType>>> {
                                match self {
                                    CreateAwsKmsHierarchicalKeyringInput::CreateAwsKmsHierarchicalKeyringInput{branchKeyId, branchKeyIdSupplier, keyStore, ttlSeconds, cache, partitionId, } => cache,
                                }
                            }
                            /// Returns a borrow of the field partitionId
                            pub fn partitionId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                match self {
                                    CreateAwsKmsHierarchicalKeyringInput::CreateAwsKmsHierarchicalKeyringInput{branchKeyId, branchKeyIdSupplier, keyStore, ttlSeconds, cache, partitionId, } => partitionId,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsHierarchicalKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsHierarchicalKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsHierarchicalKeyringInput::CreateAwsKmsHierarchicalKeyringInput{branchKeyId, branchKeyIdSupplier, keyStore, ttlSeconds, cache, partitionId, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsHierarchicalKeyringInput.CreateAwsKmsHierarchicalKeyringInput(")?;
                                        DafnyPrint::fmt_print(branchKeyId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(branchKeyIdSupplier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(keyStore, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(ttlSeconds, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(cache, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(partitionId, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsHierarchicalKeyringInput {}

                        impl Hash
                            for CreateAwsKmsHierarchicalKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsHierarchicalKeyringInput::CreateAwsKmsHierarchicalKeyringInput{branchKeyId, branchKeyIdSupplier, keyStore, ttlSeconds, cache, partitionId, } => {
                                        Hash::hash(branchKeyId, _state);
                                        Hash::hash(branchKeyIdSupplier, _state);
                                        Hash::hash(keyStore, _state);
                                        Hash::hash(ttlSeconds, _state);
                                        Hash::hash(cache, _state);
                                        Hash::hash(partitionId, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsHierarchicalKeyringInput {
                            fn default() -> CreateAwsKmsHierarchicalKeyringInput {
                                CreateAwsKmsHierarchicalKeyringInput::CreateAwsKmsHierarchicalKeyringInput {
                                    branchKeyId: Default::default(),
                                    branchKeyIdSupplier: Default::default(),
                                    keyStore: Default::default(),
                                    ttlSeconds: Default::default(),
                                    cache: Default::default(),
                                    partitionId: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsHierarchicalKeyringInput>
                            for CreateAwsKmsHierarchicalKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(913,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsKeyringInput {
                            CreateAwsKmsKeyringInput {
                                kmsKeyId: Sequence<DafnyCharUTF16>,
                                kmsClient: Object<dyn IKMSClient>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>
                            }
                        }

                        impl CreateAwsKmsKeyringInput {
                            /// Returns a borrow of the field kmsKeyId
                            pub fn kmsKeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    CreateAwsKmsKeyringInput::CreateAwsKmsKeyringInput{kmsKeyId, kmsClient, grantTokens, } => kmsKeyId,
                                }
                            }
                            /// Returns a borrow of the field kmsClient
                            pub fn kmsClient(&self) -> &Object<dyn IKMSClient> {
                                match self {
                                    CreateAwsKmsKeyringInput::CreateAwsKmsKeyringInput{kmsKeyId, kmsClient, grantTokens, } => kmsClient,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsKeyringInput::CreateAwsKmsKeyringInput{kmsKeyId, kmsClient, grantTokens, } => grantTokens,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsKeyringInput::CreateAwsKmsKeyringInput{kmsKeyId, kmsClient, grantTokens, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsKeyringInput.CreateAwsKmsKeyringInput(")?;
                                        DafnyPrint::fmt_print(kmsKeyId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kmsClient, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsKeyringInput {}

                        impl Hash
                            for CreateAwsKmsKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsKeyringInput::CreateAwsKmsKeyringInput{kmsKeyId, kmsClient, grantTokens, } => {
                                        Hash::hash(kmsKeyId, _state);
                                        Hash::hash(kmsClient, _state);
                                        Hash::hash(grantTokens, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsKeyringInput {
                            fn default() -> CreateAwsKmsKeyringInput {
                                CreateAwsKmsKeyringInput::CreateAwsKmsKeyringInput {
                                    kmsKeyId: Default::default(),
                                    kmsClient: Default::default(),
                                    grantTokens: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsKeyringInput>
                            for CreateAwsKmsKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(918,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsMrkDiscoveryKeyringInput {
                            CreateAwsKmsMrkDiscoveryKeyringInput {
                                kmsClient: Object<dyn IKMSClient>,
                                discoveryFilter: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter>>>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>,
                                region: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl CreateAwsKmsMrkDiscoveryKeyringInput {
                            /// Returns a borrow of the field kmsClient
                            pub fn kmsClient(&self) -> &Object<dyn IKMSClient> {
                                match self {
                                    CreateAwsKmsMrkDiscoveryKeyringInput::CreateAwsKmsMrkDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, region, } => kmsClient,
                                }
                            }
                            /// Returns a borrow of the field discoveryFilter
                            pub fn discoveryFilter(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter>>> {
                                match self {
                                    CreateAwsKmsMrkDiscoveryKeyringInput::CreateAwsKmsMrkDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, region, } => discoveryFilter,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsMrkDiscoveryKeyringInput::CreateAwsKmsMrkDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, region, } => grantTokens,
                                }
                            }
                            /// Returns a borrow of the field region
                            pub fn region(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    CreateAwsKmsMrkDiscoveryKeyringInput::CreateAwsKmsMrkDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, region, } => region,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsMrkDiscoveryKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsMrkDiscoveryKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsMrkDiscoveryKeyringInput::CreateAwsKmsMrkDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, region, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryKeyringInput.CreateAwsKmsMrkDiscoveryKeyringInput(")?;
                                        DafnyPrint::fmt_print(kmsClient, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(discoveryFilter, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(region, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsMrkDiscoveryKeyringInput {}

                        impl Hash
                            for CreateAwsKmsMrkDiscoveryKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsMrkDiscoveryKeyringInput::CreateAwsKmsMrkDiscoveryKeyringInput{kmsClient, discoveryFilter, grantTokens, region, } => {
                                        Hash::hash(kmsClient, _state);
                                        Hash::hash(discoveryFilter, _state);
                                        Hash::hash(grantTokens, _state);
                                        Hash::hash(region, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsMrkDiscoveryKeyringInput {
                            fn default() -> CreateAwsKmsMrkDiscoveryKeyringInput {
                                CreateAwsKmsMrkDiscoveryKeyringInput::CreateAwsKmsMrkDiscoveryKeyringInput {
                                    kmsClient: Default::default(),
                                    discoveryFilter: Default::default(),
                                    grantTokens: Default::default(),
                                    region: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsMrkDiscoveryKeyringInput>
                            for CreateAwsKmsMrkDiscoveryKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(924,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsMrkDiscoveryMultiKeyringInput {
                            CreateAwsKmsMrkDiscoveryMultiKeyringInput {
                                regions: Sequence<Sequence<DafnyCharUTF16>>,
                                discoveryFilter: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter>>>,
                                clientSupplier: Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier>>>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>
                            }
                        }

                        impl CreateAwsKmsMrkDiscoveryMultiKeyringInput {
                            /// Returns a borrow of the field regions
                            pub fn regions(&self) -> &Sequence<Sequence<DafnyCharUTF16>> {
                                match self {
                                    CreateAwsKmsMrkDiscoveryMultiKeyringInput::CreateAwsKmsMrkDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => regions,
                                }
                            }
                            /// Returns a borrow of the field discoveryFilter
                            pub fn discoveryFilter(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter>>> {
                                match self {
                                    CreateAwsKmsMrkDiscoveryMultiKeyringInput::CreateAwsKmsMrkDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => discoveryFilter,
                                }
                            }
                            /// Returns a borrow of the field clientSupplier
                            pub fn clientSupplier(&self) -> &Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier>>> {
                                match self {
                                    CreateAwsKmsMrkDiscoveryMultiKeyringInput::CreateAwsKmsMrkDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => clientSupplier,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsMrkDiscoveryMultiKeyringInput::CreateAwsKmsMrkDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => grantTokens,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsMrkDiscoveryMultiKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsMrkDiscoveryMultiKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsMrkDiscoveryMultiKeyringInput::CreateAwsKmsMrkDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryMultiKeyringInput.CreateAwsKmsMrkDiscoveryMultiKeyringInput(")?;
                                        DafnyPrint::fmt_print(regions, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(discoveryFilter, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(clientSupplier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsMrkDiscoveryMultiKeyringInput {}

                        impl Hash
                            for CreateAwsKmsMrkDiscoveryMultiKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsMrkDiscoveryMultiKeyringInput::CreateAwsKmsMrkDiscoveryMultiKeyringInput{regions, discoveryFilter, clientSupplier, grantTokens, } => {
                                        Hash::hash(regions, _state);
                                        Hash::hash(discoveryFilter, _state);
                                        Hash::hash(clientSupplier, _state);
                                        Hash::hash(grantTokens, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsMrkDiscoveryMultiKeyringInput {
                            fn default() -> CreateAwsKmsMrkDiscoveryMultiKeyringInput {
                                CreateAwsKmsMrkDiscoveryMultiKeyringInput::CreateAwsKmsMrkDiscoveryMultiKeyringInput {
                                    regions: Default::default(),
                                    discoveryFilter: Default::default(),
                                    clientSupplier: Default::default(),
                                    grantTokens: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsMrkDiscoveryMultiKeyringInput>
                            for CreateAwsKmsMrkDiscoveryMultiKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(930,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsMrkKeyringInput {
                            CreateAwsKmsMrkKeyringInput {
                                kmsKeyId: Sequence<DafnyCharUTF16>,
                                kmsClient: Object<dyn IKMSClient>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>
                            }
                        }

                        impl CreateAwsKmsMrkKeyringInput {
                            /// Returns a borrow of the field kmsKeyId
                            pub fn kmsKeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    CreateAwsKmsMrkKeyringInput::CreateAwsKmsMrkKeyringInput{kmsKeyId, kmsClient, grantTokens, } => kmsKeyId,
                                }
                            }
                            /// Returns a borrow of the field kmsClient
                            pub fn kmsClient(&self) -> &Object<dyn IKMSClient> {
                                match self {
                                    CreateAwsKmsMrkKeyringInput::CreateAwsKmsMrkKeyringInput{kmsKeyId, kmsClient, grantTokens, } => kmsClient,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsMrkKeyringInput::CreateAwsKmsMrkKeyringInput{kmsKeyId, kmsClient, grantTokens, } => grantTokens,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsMrkKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsMrkKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsMrkKeyringInput::CreateAwsKmsMrkKeyringInput{kmsKeyId, kmsClient, grantTokens, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkKeyringInput.CreateAwsKmsMrkKeyringInput(")?;
                                        DafnyPrint::fmt_print(kmsKeyId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kmsClient, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsMrkKeyringInput {}

                        impl Hash
                            for CreateAwsKmsMrkKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsMrkKeyringInput::CreateAwsKmsMrkKeyringInput{kmsKeyId, kmsClient, grantTokens, } => {
                                        Hash::hash(kmsKeyId, _state);
                                        Hash::hash(kmsClient, _state);
                                        Hash::hash(grantTokens, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsMrkKeyringInput {
                            fn default() -> CreateAwsKmsMrkKeyringInput {
                                CreateAwsKmsMrkKeyringInput::CreateAwsKmsMrkKeyringInput {
                                    kmsKeyId: Default::default(),
                                    kmsClient: Default::default(),
                                    grantTokens: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsMrkKeyringInput>
                            for CreateAwsKmsMrkKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(935,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsMrkMultiKeyringInput {
                            CreateAwsKmsMrkMultiKeyringInput {
                                generator: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                kmsKeyIds: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>,
                                clientSupplier: Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier>>>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>
                            }
                        }

                        impl CreateAwsKmsMrkMultiKeyringInput {
                            /// Returns a borrow of the field generator
                            pub fn generator(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                match self {
                                    CreateAwsKmsMrkMultiKeyringInput::CreateAwsKmsMrkMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => generator,
                                }
                            }
                            /// Returns a borrow of the field kmsKeyIds
                            pub fn kmsKeyIds(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsMrkMultiKeyringInput::CreateAwsKmsMrkMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => kmsKeyIds,
                                }
                            }
                            /// Returns a borrow of the field clientSupplier
                            pub fn clientSupplier(&self) -> &Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier>>> {
                                match self {
                                    CreateAwsKmsMrkMultiKeyringInput::CreateAwsKmsMrkMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => clientSupplier,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsMrkMultiKeyringInput::CreateAwsKmsMrkMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => grantTokens,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsMrkMultiKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsMrkMultiKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsMrkMultiKeyringInput::CreateAwsKmsMrkMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkMultiKeyringInput.CreateAwsKmsMrkMultiKeyringInput(")?;
                                        DafnyPrint::fmt_print(generator, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kmsKeyIds, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(clientSupplier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsMrkMultiKeyringInput {}

                        impl Hash
                            for CreateAwsKmsMrkMultiKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsMrkMultiKeyringInput::CreateAwsKmsMrkMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => {
                                        Hash::hash(generator, _state);
                                        Hash::hash(kmsKeyIds, _state);
                                        Hash::hash(clientSupplier, _state);
                                        Hash::hash(grantTokens, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsMrkMultiKeyringInput {
                            fn default() -> CreateAwsKmsMrkMultiKeyringInput {
                                CreateAwsKmsMrkMultiKeyringInput::CreateAwsKmsMrkMultiKeyringInput {
                                    generator: Default::default(),
                                    kmsKeyIds: Default::default(),
                                    clientSupplier: Default::default(),
                                    grantTokens: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsMrkMultiKeyringInput>
                            for CreateAwsKmsMrkMultiKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(941,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsMultiKeyringInput {
                            CreateAwsKmsMultiKeyringInput {
                                generator: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                kmsKeyIds: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>,
                                clientSupplier: Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier>>>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>
                            }
                        }

                        impl CreateAwsKmsMultiKeyringInput {
                            /// Returns a borrow of the field generator
                            pub fn generator(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                match self {
                                    CreateAwsKmsMultiKeyringInput::CreateAwsKmsMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => generator,
                                }
                            }
                            /// Returns a borrow of the field kmsKeyIds
                            pub fn kmsKeyIds(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsMultiKeyringInput::CreateAwsKmsMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => kmsKeyIds,
                                }
                            }
                            /// Returns a borrow of the field clientSupplier
                            pub fn clientSupplier(&self) -> &Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier>>> {
                                match self {
                                    CreateAwsKmsMultiKeyringInput::CreateAwsKmsMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => clientSupplier,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsMultiKeyringInput::CreateAwsKmsMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => grantTokens,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsMultiKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsMultiKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsMultiKeyringInput::CreateAwsKmsMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMultiKeyringInput.CreateAwsKmsMultiKeyringInput(")?;
                                        DafnyPrint::fmt_print(generator, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kmsKeyIds, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(clientSupplier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsMultiKeyringInput {}

                        impl Hash
                            for CreateAwsKmsMultiKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsMultiKeyringInput::CreateAwsKmsMultiKeyringInput{generator, kmsKeyIds, clientSupplier, grantTokens, } => {
                                        Hash::hash(generator, _state);
                                        Hash::hash(kmsKeyIds, _state);
                                        Hash::hash(clientSupplier, _state);
                                        Hash::hash(grantTokens, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsMultiKeyringInput {
                            fn default() -> CreateAwsKmsMultiKeyringInput {
                                CreateAwsKmsMultiKeyringInput::CreateAwsKmsMultiKeyringInput {
                                    generator: Default::default(),
                                    kmsKeyIds: Default::default(),
                                    clientSupplier: Default::default(),
                                    grantTokens: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsMultiKeyringInput>
                            for CreateAwsKmsMultiKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(947,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateAwsKmsRsaKeyringInput {
                            CreateAwsKmsRsaKeyringInput {
                                publicKey: Arc<Option<Sequence<u8>>>,
                                kmsKeyId: Sequence<DafnyCharUTF16>,
                                encryptionAlgorithm: Arc<EncryptionAlgorithmSpec>,
                                kmsClient: Arc<Option<Object<dyn IKMSClient>>>,
                                grantTokens: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>
                            }
                        }

                        impl CreateAwsKmsRsaKeyringInput {
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    CreateAwsKmsRsaKeyringInput::CreateAwsKmsRsaKeyringInput{publicKey, kmsKeyId, encryptionAlgorithm, kmsClient, grantTokens, } => publicKey,
                                }
                            }
                            /// Returns a borrow of the field kmsKeyId
                            pub fn kmsKeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    CreateAwsKmsRsaKeyringInput::CreateAwsKmsRsaKeyringInput{publicKey, kmsKeyId, encryptionAlgorithm, kmsClient, grantTokens, } => kmsKeyId,
                                }
                            }
                            /// Returns a borrow of the field encryptionAlgorithm
                            pub fn encryptionAlgorithm(&self) -> &Arc<EncryptionAlgorithmSpec> {
                                match self {
                                    CreateAwsKmsRsaKeyringInput::CreateAwsKmsRsaKeyringInput{publicKey, kmsKeyId, encryptionAlgorithm, kmsClient, grantTokens, } => encryptionAlgorithm,
                                }
                            }
                            /// Returns a borrow of the field kmsClient
                            pub fn kmsClient(&self) -> &Arc<Option<Object<dyn IKMSClient>>> {
                                match self {
                                    CreateAwsKmsRsaKeyringInput::CreateAwsKmsRsaKeyringInput{publicKey, kmsKeyId, encryptionAlgorithm, kmsClient, grantTokens, } => kmsClient,
                                }
                            }
                            /// Returns a borrow of the field grantTokens
                            pub fn grantTokens(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                match self {
                                    CreateAwsKmsRsaKeyringInput::CreateAwsKmsRsaKeyringInput{publicKey, kmsKeyId, encryptionAlgorithm, kmsClient, grantTokens, } => grantTokens,
                                }
                            }
                        }

                        impl Debug
                            for CreateAwsKmsRsaKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateAwsKmsRsaKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateAwsKmsRsaKeyringInput::CreateAwsKmsRsaKeyringInput{publicKey, kmsKeyId, encryptionAlgorithm, kmsClient, grantTokens, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsRsaKeyringInput.CreateAwsKmsRsaKeyringInput(")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kmsKeyId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionAlgorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(kmsClient, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateAwsKmsRsaKeyringInput {}

                        impl Hash
                            for CreateAwsKmsRsaKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateAwsKmsRsaKeyringInput::CreateAwsKmsRsaKeyringInput{publicKey, kmsKeyId, encryptionAlgorithm, kmsClient, grantTokens, } => {
                                        Hash::hash(publicKey, _state);
                                        Hash::hash(kmsKeyId, _state);
                                        Hash::hash(encryptionAlgorithm, _state);
                                        Hash::hash(kmsClient, _state);
                                        Hash::hash(grantTokens, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateAwsKmsRsaKeyringInput {
                            fn default() -> CreateAwsKmsRsaKeyringInput {
                                CreateAwsKmsRsaKeyringInput::CreateAwsKmsRsaKeyringInput {
                                    publicKey: Default::default(),
                                    kmsKeyId: Default::default(),
                                    encryptionAlgorithm: Default::default(),
                                    kmsClient: Default::default(),
                                    grantTokens: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateAwsKmsRsaKeyringInput>
                            for CreateAwsKmsRsaKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(954,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateCryptographicMaterialsCacheInput {
                            CreateCryptographicMaterialsCacheInput {
                                cache: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType>
                            }
                        }

                        impl CreateCryptographicMaterialsCacheInput {
                            /// Returns a borrow of the field cache
                            pub fn cache(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType> {
                                match self {
                                    CreateCryptographicMaterialsCacheInput::CreateCryptographicMaterialsCacheInput{cache, } => cache,
                                }
                            }
                        }

                        impl Debug
                            for CreateCryptographicMaterialsCacheInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateCryptographicMaterialsCacheInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateCryptographicMaterialsCacheInput::CreateCryptographicMaterialsCacheInput{cache, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateCryptographicMaterialsCacheInput.CreateCryptographicMaterialsCacheInput(")?;
                                        DafnyPrint::fmt_print(cache, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateCryptographicMaterialsCacheInput {}

                        impl Hash
                            for CreateCryptographicMaterialsCacheInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateCryptographicMaterialsCacheInput::CreateCryptographicMaterialsCacheInput{cache, } => {
                                        Hash::hash(cache, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateCryptographicMaterialsCacheInput {
                            fn default() -> CreateCryptographicMaterialsCacheInput {
                                CreateCryptographicMaterialsCacheInput::CreateCryptographicMaterialsCacheInput {
                                    cache: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateCryptographicMaterialsCacheInput>
                            for CreateCryptographicMaterialsCacheInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(957,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateDefaultClientSupplierInput {
                            CreateDefaultClientSupplierInput {}
                        }

                        impl CreateDefaultClientSupplierInput {}

                        impl Debug
                            for CreateDefaultClientSupplierInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateDefaultClientSupplierInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultClientSupplierInput.CreateDefaultClientSupplierInput")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl CreateDefaultClientSupplierInput {
                            /// Enumerates all possible values of CreateDefaultClientSupplierInput
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<CreateDefaultClientSupplierInput>> {
                                seq![Arc::new(CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput {})].iter()
                            }
                        }

                        impl Eq
                            for CreateDefaultClientSupplierInput {}

                        impl Hash
                            for CreateDefaultClientSupplierInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateDefaultClientSupplierInput {
                            fn default() -> CreateDefaultClientSupplierInput {
                                CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput {}
                            }
                        }

                        impl AsRef<CreateDefaultClientSupplierInput>
                            for CreateDefaultClientSupplierInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(960,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateDefaultCryptographicMaterialsManagerInput {
                            CreateDefaultCryptographicMaterialsManagerInput {
                                keyring: Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>
                            }
                        }

                        impl CreateDefaultCryptographicMaterialsManagerInput {
                            /// Returns a borrow of the field keyring
                            pub fn keyring(&self) -> &Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring> {
                                match self {
                                    CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput{keyring, } => keyring,
                                }
                            }
                        }

                        impl Debug
                            for CreateDefaultCryptographicMaterialsManagerInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateDefaultCryptographicMaterialsManagerInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput{keyring, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultCryptographicMaterialsManagerInput.CreateDefaultCryptographicMaterialsManagerInput(")?;
                                        DafnyPrint::fmt_print(keyring, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateDefaultCryptographicMaterialsManagerInput {}

                        impl Hash
                            for CreateDefaultCryptographicMaterialsManagerInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput{keyring, } => {
                                        Hash::hash(keyring, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateDefaultCryptographicMaterialsManagerInput {
                            fn default() -> CreateDefaultCryptographicMaterialsManagerInput {
                                CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                                    keyring: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateDefaultCryptographicMaterialsManagerInput>
                            for CreateDefaultCryptographicMaterialsManagerInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(963,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateMultiKeyringInput {
                            CreateMultiKeyringInput {
                                generator: Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>>>,
                                childKeyrings: Sequence<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>>
                            }
                        }

                        impl CreateMultiKeyringInput {
                            /// Returns a borrow of the field generator
                            pub fn generator(&self) -> &Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>>> {
                                match self {
                                    CreateMultiKeyringInput::CreateMultiKeyringInput{generator, childKeyrings, } => generator,
                                }
                            }
                            /// Returns a borrow of the field childKeyrings
                            pub fn childKeyrings(&self) -> &Sequence<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>> {
                                match self {
                                    CreateMultiKeyringInput::CreateMultiKeyringInput{generator, childKeyrings, } => childKeyrings,
                                }
                            }
                        }

                        impl Debug
                            for CreateMultiKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateMultiKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateMultiKeyringInput::CreateMultiKeyringInput{generator, childKeyrings, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateMultiKeyringInput.CreateMultiKeyringInput(")?;
                                        DafnyPrint::fmt_print(generator, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(childKeyrings, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateMultiKeyringInput {}

                        impl Hash
                            for CreateMultiKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateMultiKeyringInput::CreateMultiKeyringInput{generator, childKeyrings, } => {
                                        Hash::hash(generator, _state);
                                        Hash::hash(childKeyrings, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateMultiKeyringInput {
                            fn default() -> CreateMultiKeyringInput {
                                CreateMultiKeyringInput::CreateMultiKeyringInput {
                                    generator: Default::default(),
                                    childKeyrings: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateMultiKeyringInput>
                            for CreateMultiKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(967,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateRawAesKeyringInput {
                            CreateRawAesKeyringInput {
                                keyNamespace: Sequence<DafnyCharUTF16>,
                                keyName: Sequence<DafnyCharUTF16>,
                                wrappingKey: Sequence<u8>,
                                wrappingAlg: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AesWrappingAlg>
                            }
                        }

                        impl CreateRawAesKeyringInput {
                            /// Returns a borrow of the field keyNamespace
                            pub fn keyNamespace(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    CreateRawAesKeyringInput::CreateRawAesKeyringInput{keyNamespace, keyName, wrappingKey, wrappingAlg, } => keyNamespace,
                                }
                            }
                            /// Returns a borrow of the field keyName
                            pub fn keyName(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    CreateRawAesKeyringInput::CreateRawAesKeyringInput{keyNamespace, keyName, wrappingKey, wrappingAlg, } => keyName,
                                }
                            }
                            /// Returns a borrow of the field wrappingKey
                            pub fn wrappingKey(&self) -> &Sequence<u8> {
                                match self {
                                    CreateRawAesKeyringInput::CreateRawAesKeyringInput{keyNamespace, keyName, wrappingKey, wrappingAlg, } => wrappingKey,
                                }
                            }
                            /// Returns a borrow of the field wrappingAlg
                            pub fn wrappingAlg(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AesWrappingAlg> {
                                match self {
                                    CreateRawAesKeyringInput::CreateRawAesKeyringInput{keyNamespace, keyName, wrappingKey, wrappingAlg, } => wrappingAlg,
                                }
                            }
                        }

                        impl Debug
                            for CreateRawAesKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateRawAesKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateRawAesKeyringInput::CreateRawAesKeyringInput{keyNamespace, keyName, wrappingKey, wrappingAlg, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawAesKeyringInput.CreateRawAesKeyringInput(")?;
                                        DafnyPrint::fmt_print(keyNamespace, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(keyName, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(wrappingKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(wrappingAlg, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateRawAesKeyringInput {}

                        impl Hash
                            for CreateRawAesKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateRawAesKeyringInput::CreateRawAesKeyringInput{keyNamespace, keyName, wrappingKey, wrappingAlg, } => {
                                        Hash::hash(keyNamespace, _state);
                                        Hash::hash(keyName, _state);
                                        Hash::hash(wrappingKey, _state);
                                        Hash::hash(wrappingAlg, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateRawAesKeyringInput {
                            fn default() -> CreateRawAesKeyringInput {
                                CreateRawAesKeyringInput::CreateRawAesKeyringInput {
                                    keyNamespace: Default::default(),
                                    keyName: Default::default(),
                                    wrappingKey: Default::default(),
                                    wrappingAlg: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateRawAesKeyringInput>
                            for CreateRawAesKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(973,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateRawEcdhKeyringInput {
                            CreateRawEcdhKeyringInput {
                                KeyAgreementScheme: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations>,
                                curveSpec: Arc<ECDHCurveSpec>
                            }
                        }

                        impl CreateRawEcdhKeyringInput {
                            /// Returns a borrow of the field KeyAgreementScheme
                            pub fn KeyAgreementScheme(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations> {
                                match self {
                                    CreateRawEcdhKeyringInput::CreateRawEcdhKeyringInput{KeyAgreementScheme, curveSpec, } => KeyAgreementScheme,
                                }
                            }
                            /// Returns a borrow of the field curveSpec
                            pub fn curveSpec(&self) -> &Arc<ECDHCurveSpec> {
                                match self {
                                    CreateRawEcdhKeyringInput::CreateRawEcdhKeyringInput{KeyAgreementScheme, curveSpec, } => curveSpec,
                                }
                            }
                        }

                        impl Debug
                            for CreateRawEcdhKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateRawEcdhKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateRawEcdhKeyringInput::CreateRawEcdhKeyringInput{KeyAgreementScheme, curveSpec, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawEcdhKeyringInput.CreateRawEcdhKeyringInput(")?;
                                        DafnyPrint::fmt_print(KeyAgreementScheme, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(curveSpec, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateRawEcdhKeyringInput {}

                        impl Hash
                            for CreateRawEcdhKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateRawEcdhKeyringInput::CreateRawEcdhKeyringInput{KeyAgreementScheme, curveSpec, } => {
                                        Hash::hash(KeyAgreementScheme, _state);
                                        Hash::hash(curveSpec, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateRawEcdhKeyringInput {
                            fn default() -> CreateRawEcdhKeyringInput {
                                CreateRawEcdhKeyringInput::CreateRawEcdhKeyringInput {
                                    KeyAgreementScheme: Default::default(),
                                    curveSpec: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateRawEcdhKeyringInput>
                            for CreateRawEcdhKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(977,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateRawRsaKeyringInput {
                            CreateRawRsaKeyringInput {
                                keyNamespace: Sequence<DafnyCharUTF16>,
                                keyName: Sequence<DafnyCharUTF16>,
                                paddingScheme: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PaddingScheme>,
                                publicKey: Arc<Option<Sequence<u8>>>,
                                privateKey: Arc<Option<Sequence<u8>>>
                            }
                        }

                        impl CreateRawRsaKeyringInput {
                            /// Returns a borrow of the field keyNamespace
                            pub fn keyNamespace(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    CreateRawRsaKeyringInput::CreateRawRsaKeyringInput{keyNamespace, keyName, paddingScheme, publicKey, privateKey, } => keyNamespace,
                                }
                            }
                            /// Returns a borrow of the field keyName
                            pub fn keyName(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    CreateRawRsaKeyringInput::CreateRawRsaKeyringInput{keyNamespace, keyName, paddingScheme, publicKey, privateKey, } => keyName,
                                }
                            }
                            /// Returns a borrow of the field paddingScheme
                            pub fn paddingScheme(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PaddingScheme> {
                                match self {
                                    CreateRawRsaKeyringInput::CreateRawRsaKeyringInput{keyNamespace, keyName, paddingScheme, publicKey, privateKey, } => paddingScheme,
                                }
                            }
                            /// Returns a borrow of the field publicKey
                            pub fn publicKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    CreateRawRsaKeyringInput::CreateRawRsaKeyringInput{keyNamespace, keyName, paddingScheme, publicKey, privateKey, } => publicKey,
                                }
                            }
                            /// Returns a borrow of the field privateKey
                            pub fn privateKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    CreateRawRsaKeyringInput::CreateRawRsaKeyringInput{keyNamespace, keyName, paddingScheme, publicKey, privateKey, } => privateKey,
                                }
                            }
                        }

                        impl Debug
                            for CreateRawRsaKeyringInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateRawRsaKeyringInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateRawRsaKeyringInput::CreateRawRsaKeyringInput{keyNamespace, keyName, paddingScheme, publicKey, privateKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawRsaKeyringInput.CreateRawRsaKeyringInput(")?;
                                        DafnyPrint::fmt_print(keyNamespace, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(keyName, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(paddingScheme, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(privateKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateRawRsaKeyringInput {}

                        impl Hash
                            for CreateRawRsaKeyringInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateRawRsaKeyringInput::CreateRawRsaKeyringInput{keyNamespace, keyName, paddingScheme, publicKey, privateKey, } => {
                                        Hash::hash(keyNamespace, _state);
                                        Hash::hash(keyName, _state);
                                        Hash::hash(paddingScheme, _state);
                                        Hash::hash(publicKey, _state);
                                        Hash::hash(privateKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateRawRsaKeyringInput {
                            fn default() -> CreateRawRsaKeyringInput {
                                CreateRawRsaKeyringInput::CreateRawRsaKeyringInput {
                                    keyNamespace: Default::default(),
                                    keyName: Default::default(),
                                    paddingScheme: Default::default(),
                                    publicKey: Default::default(),
                                    privateKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateRawRsaKeyringInput>
                            for CreateRawRsaKeyringInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(984,3)
                        #[derive(PartialEq, Clone)]
                        pub enum CreateRequiredEncryptionContextCMMInput {
                            CreateRequiredEncryptionContextCMMInput {
                                underlyingCMM: Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager>>>,
                                keyring: Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>>>,
                                requiredEncryptionContextKeys: Sequence<ValidUTF8Bytes>
                            }
                        }

                        impl CreateRequiredEncryptionContextCMMInput {
                            /// Returns a borrow of the field underlyingCMM
                            pub fn underlyingCMM(&self) -> &Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager>>> {
                                match self {
                                    CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput{underlyingCMM, keyring, requiredEncryptionContextKeys, } => underlyingCMM,
                                }
                            }
                            /// Returns a borrow of the field keyring
                            pub fn keyring(&self) -> &Arc<Option<Object<dyn crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring>>> {
                                match self {
                                    CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput{underlyingCMM, keyring, requiredEncryptionContextKeys, } => keyring,
                                }
                            }
                            /// Returns a borrow of the field requiredEncryptionContextKeys
                            pub fn requiredEncryptionContextKeys(&self) -> &Sequence<ValidUTF8Bytes> {
                                match self {
                                    CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput{underlyingCMM, keyring, requiredEncryptionContextKeys, } => requiredEncryptionContextKeys,
                                }
                            }
                        }

                        impl Debug
                            for CreateRequiredEncryptionContextCMMInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for CreateRequiredEncryptionContextCMMInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput{underlyingCMM, keyring, requiredEncryptionContextKeys, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.CreateRequiredEncryptionContextCMMInput.CreateRequiredEncryptionContextCMMInput(")?;
                                        DafnyPrint::fmt_print(underlyingCMM, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(keyring, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(requiredEncryptionContextKeys, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for CreateRequiredEncryptionContextCMMInput {}

                        impl Hash
                            for CreateRequiredEncryptionContextCMMInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput{underlyingCMM, keyring, requiredEncryptionContextKeys, } => {
                                        Hash::hash(underlyingCMM, _state);
                                        Hash::hash(keyring, _state);
                                        Hash::hash(requiredEncryptionContextKeys, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for CreateRequiredEncryptionContextCMMInput {
                            fn default() -> CreateRequiredEncryptionContextCMMInput {
                                CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                                    underlyingCMM: Default::default(),
                                    keyring: Default::default(),
                                    requiredEncryptionContextKeys: Default::default()
                                }
                            }
                        }

                        impl AsRef<CreateRequiredEncryptionContextCMMInput>
                            for CreateRequiredEncryptionContextCMMInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(989,3)
                        pub struct ICryptographicMaterialsCacheCallHistory {}

                        impl ICryptographicMaterialsCacheCallHistory {
                            /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                            pub fn _allocate_object() -> Object<Self> {
                                allocate_object::<Self>()
                            }
                        }

                        impl UpcastObject<DynAny>
                            for crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCacheCallHistory {
                            UpcastObjectFn!(DynAny);
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1001,3)
                        pub trait ICryptographicMaterialsCache: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1041,5)
                            fn PutCacheEntry(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PutCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                                let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                _out0 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache::_PutCacheEntry_k(rd!(Object::<_>::from_ref(self)), input);
                                output = _out0.clone();
                                return output.clone();
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1064,5)
                            fn _PutCacheEntry_k(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PutCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1078,5)
                            fn UpdateUsageMetadata(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::UpdateUsageMetadataInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                                let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                _out0 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache::_UpdateUsageMetadata_k(rd!(Object::<_>::from_ref(self)), input);
                                output = _out0.clone();
                                return output.clone();
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1101,5)
                            fn _UpdateUsageMetadata_k(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::UpdateUsageMetadataInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1115,5)
                            fn GetCacheEntry(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                                let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                _out0 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache::_GetCacheEntry_k(rd!(Object::<_>::from_ref(self)), input);
                                output = _out0.clone();
                                return output.clone();
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1138,5)
                            fn _GetCacheEntry_k(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1152,5)
                            fn DeleteCacheEntry(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DeleteCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                                let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                _out0 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache::_DeleteCacheEntry_k(rd!(Object::<_>::from_ref(self)), input);
                                output = _out0.clone();
                                return output.clone();
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1175,5)
                            fn _DeleteCacheEntry_k(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DeleteCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1188,3)
                        pub struct ICryptographicMaterialsManagerCallHistory {}

                        impl ICryptographicMaterialsManagerCallHistory {
                            /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                            pub fn _allocate_object() -> Object<Self> {
                                allocate_object::<Self>()
                            }
                        }

                        impl UpcastObject<DynAny>
                            for crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManagerCallHistory {
                            UpcastObjectFn!(DynAny);
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1196,3)
                        pub trait ICryptographicMaterialsManager: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1225,5)
                            fn GetEncryptionMaterials(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                                let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                _out0 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager::_GetEncryptionMaterials_k(rd!(Object::<_>::from_ref(self)), input);
                                output = _out0.clone();
                                return output.clone();
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1242,5)
                            fn _GetEncryptionMaterials_k(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1256,5)
                            fn DecryptMaterials(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                                let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                _out0 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager::_DecryptMaterials_k(rd!(Object::<_>::from_ref(self)), input);
                                output = _out0.clone();
                                return output.clone();
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1273,5)
                            fn _DecryptMaterials_k(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1286,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DBEAlgorithmSuiteId {
                            ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384 {},
                            ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384 {}
                        }

                        impl DBEAlgorithmSuiteId {}

                        impl Debug
                            for DBEAlgorithmSuiteId {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DBEAlgorithmSuiteId {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DBEAlgorithmSuiteId.ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__SYMSIG__HMAC__SHA384")?;
                                        Ok(())
                                    },
                                    DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DBEAlgorithmSuiteId.ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384__SYMSIG__HMAC__SHA384")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl DBEAlgorithmSuiteId {
                            /// Enumerates all possible values of DBEAlgorithmSuiteId
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DBEAlgorithmSuiteId>> {
                                seq![Arc::new(DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384 {}), Arc::new(DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384 {})].iter()
                            }
                        }

                        impl Eq
                            for DBEAlgorithmSuiteId {}

                        impl Hash
                            for DBEAlgorithmSuiteId {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384{} => {

                                    },
                                    DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for DBEAlgorithmSuiteId {
                            fn default() -> DBEAlgorithmSuiteId {
                                DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384 {}
                            }
                        }

                        impl AsRef<DBEAlgorithmSuiteId>
                            for DBEAlgorithmSuiteId {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1289,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DBECommitmentPolicy {
                            REQUIRE_ENCRYPT_REQUIRE_DECRYPT {}
                        }

                        impl DBECommitmentPolicy {}

                        impl Debug
                            for DBECommitmentPolicy {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DBECommitmentPolicy {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DBECommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DBECommitmentPolicy.REQUIRE__ENCRYPT__REQUIRE__DECRYPT")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl DBECommitmentPolicy {
                            /// Enumerates all possible values of DBECommitmentPolicy
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DBECommitmentPolicy>> {
                                seq![Arc::new(DBECommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT {})].iter()
                            }
                        }

                        impl Eq
                            for DBECommitmentPolicy {}

                        impl Hash
                            for DBECommitmentPolicy {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DBECommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for DBECommitmentPolicy {
                            fn default() -> DBECommitmentPolicy {
                                DBECommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT {}
                            }
                        }

                        impl AsRef<DBECommitmentPolicy>
                            for DBECommitmentPolicy {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1292,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DecryptionMaterials {
                            DecryptionMaterials {
                                algorithmSuite: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo>,
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
                                requiredEncryptionContextKeys: Sequence<ValidUTF8Bytes>,
                                plaintextDataKey: Arc<Option<Sequence<u8>>>,
                                verificationKey: Arc<Option<Sequence<u8>>>,
                                symmetricSigningKey: Arc<Option<Sequence<u8>>>
                            }
                        }

                        impl DecryptionMaterials {
                            /// Returns a borrow of the field algorithmSuite
                            pub fn algorithmSuite(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo> {
                                match self {
                                    DecryptionMaterials::DecryptionMaterials{algorithmSuite, encryptionContext, requiredEncryptionContextKeys, plaintextDataKey, verificationKey, symmetricSigningKey, } => algorithmSuite,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    DecryptionMaterials::DecryptionMaterials{algorithmSuite, encryptionContext, requiredEncryptionContextKeys, plaintextDataKey, verificationKey, symmetricSigningKey, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field requiredEncryptionContextKeys
                            pub fn requiredEncryptionContextKeys(&self) -> &Sequence<ValidUTF8Bytes> {
                                match self {
                                    DecryptionMaterials::DecryptionMaterials{algorithmSuite, encryptionContext, requiredEncryptionContextKeys, plaintextDataKey, verificationKey, symmetricSigningKey, } => requiredEncryptionContextKeys,
                                }
                            }
                            /// Returns a borrow of the field plaintextDataKey
                            pub fn plaintextDataKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    DecryptionMaterials::DecryptionMaterials{algorithmSuite, encryptionContext, requiredEncryptionContextKeys, plaintextDataKey, verificationKey, symmetricSigningKey, } => plaintextDataKey,
                                }
                            }
                            /// Returns a borrow of the field verificationKey
                            pub fn verificationKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    DecryptionMaterials::DecryptionMaterials{algorithmSuite, encryptionContext, requiredEncryptionContextKeys, plaintextDataKey, verificationKey, symmetricSigningKey, } => verificationKey,
                                }
                            }
                            /// Returns a borrow of the field symmetricSigningKey
                            pub fn symmetricSigningKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    DecryptionMaterials::DecryptionMaterials{algorithmSuite, encryptionContext, requiredEncryptionContextKeys, plaintextDataKey, verificationKey, symmetricSigningKey, } => symmetricSigningKey,
                                }
                            }
                        }

                        impl Debug
                            for DecryptionMaterials {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DecryptionMaterials {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DecryptionMaterials::DecryptionMaterials{algorithmSuite, encryptionContext, requiredEncryptionContextKeys, plaintextDataKey, verificationKey, symmetricSigningKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DecryptionMaterials.DecryptionMaterials(")?;
                                        DafnyPrint::fmt_print(algorithmSuite, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(requiredEncryptionContextKeys, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(plaintextDataKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(verificationKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(symmetricSigningKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DecryptionMaterials {}

                        impl Hash
                            for DecryptionMaterials {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DecryptionMaterials::DecryptionMaterials{algorithmSuite, encryptionContext, requiredEncryptionContextKeys, plaintextDataKey, verificationKey, symmetricSigningKey, } => {
                                        Hash::hash(algorithmSuite, _state);
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(requiredEncryptionContextKeys, _state);
                                        Hash::hash(plaintextDataKey, _state);
                                        Hash::hash(verificationKey, _state);
                                        Hash::hash(symmetricSigningKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DecryptionMaterials {
                            fn default() -> DecryptionMaterials {
                                DecryptionMaterials::DecryptionMaterials {
                                    algorithmSuite: Default::default(),
                                    encryptionContext: Default::default(),
                                    requiredEncryptionContextKeys: Default::default(),
                                    plaintextDataKey: Default::default(),
                                    verificationKey: Default::default(),
                                    symmetricSigningKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<DecryptionMaterials>
                            for DecryptionMaterials {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1300,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DecryptMaterialsInput {
                            DecryptMaterialsInput {
                                algorithmSuiteId: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId>,
                                commitmentPolicy: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy>,
                                encryptedDataKeys: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey>>,
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
                                reproducedEncryptionContext: Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>>
                            }
                        }

                        impl DecryptMaterialsInput {
                            /// Returns a borrow of the field algorithmSuiteId
                            pub fn algorithmSuiteId(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId> {
                                match self {
                                    DecryptMaterialsInput::DecryptMaterialsInput{algorithmSuiteId, commitmentPolicy, encryptedDataKeys, encryptionContext, reproducedEncryptionContext, } => algorithmSuiteId,
                                }
                            }
                            /// Returns a borrow of the field commitmentPolicy
                            pub fn commitmentPolicy(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy> {
                                match self {
                                    DecryptMaterialsInput::DecryptMaterialsInput{algorithmSuiteId, commitmentPolicy, encryptedDataKeys, encryptionContext, reproducedEncryptionContext, } => commitmentPolicy,
                                }
                            }
                            /// Returns a borrow of the field encryptedDataKeys
                            pub fn encryptedDataKeys(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey>> {
                                match self {
                                    DecryptMaterialsInput::DecryptMaterialsInput{algorithmSuiteId, commitmentPolicy, encryptedDataKeys, encryptionContext, reproducedEncryptionContext, } => encryptedDataKeys,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    DecryptMaterialsInput::DecryptMaterialsInput{algorithmSuiteId, commitmentPolicy, encryptedDataKeys, encryptionContext, reproducedEncryptionContext, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field reproducedEncryptionContext
                            pub fn reproducedEncryptionContext(&self) -> &Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>> {
                                match self {
                                    DecryptMaterialsInput::DecryptMaterialsInput{algorithmSuiteId, commitmentPolicy, encryptedDataKeys, encryptionContext, reproducedEncryptionContext, } => reproducedEncryptionContext,
                                }
                            }
                        }

                        impl Debug
                            for DecryptMaterialsInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DecryptMaterialsInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DecryptMaterialsInput::DecryptMaterialsInput{algorithmSuiteId, commitmentPolicy, encryptedDataKeys, encryptionContext, reproducedEncryptionContext, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsInput.DecryptMaterialsInput(")?;
                                        DafnyPrint::fmt_print(algorithmSuiteId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(commitmentPolicy, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptedDataKeys, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(reproducedEncryptionContext, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DecryptMaterialsInput {}

                        impl Hash
                            for DecryptMaterialsInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DecryptMaterialsInput::DecryptMaterialsInput{algorithmSuiteId, commitmentPolicy, encryptedDataKeys, encryptionContext, reproducedEncryptionContext, } => {
                                        Hash::hash(algorithmSuiteId, _state);
                                        Hash::hash(commitmentPolicy, _state);
                                        Hash::hash(encryptedDataKeys, _state);
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(reproducedEncryptionContext, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DecryptMaterialsInput {
                            fn default() -> DecryptMaterialsInput {
                                DecryptMaterialsInput::DecryptMaterialsInput {
                                    algorithmSuiteId: Default::default(),
                                    commitmentPolicy: Default::default(),
                                    encryptedDataKeys: Default::default(),
                                    encryptionContext: Default::default(),
                                    reproducedEncryptionContext: Default::default()
                                }
                            }
                        }

                        impl AsRef<DecryptMaterialsInput>
                            for DecryptMaterialsInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1307,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DecryptMaterialsOutput {
                            DecryptMaterialsOutput {
                                decryptionMaterials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials>
                            }
                        }

                        impl DecryptMaterialsOutput {
                            /// Returns a borrow of the field decryptionMaterials
                            pub fn decryptionMaterials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials> {
                                match self {
                                    DecryptMaterialsOutput::DecryptMaterialsOutput{decryptionMaterials, } => decryptionMaterials,
                                }
                            }
                        }

                        impl Debug
                            for DecryptMaterialsOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DecryptMaterialsOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DecryptMaterialsOutput::DecryptMaterialsOutput{decryptionMaterials, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DecryptMaterialsOutput.DecryptMaterialsOutput(")?;
                                        DafnyPrint::fmt_print(decryptionMaterials, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DecryptMaterialsOutput {}

                        impl Hash
                            for DecryptMaterialsOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DecryptMaterialsOutput::DecryptMaterialsOutput{decryptionMaterials, } => {
                                        Hash::hash(decryptionMaterials, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DecryptMaterialsOutput {
                            fn default() -> DecryptMaterialsOutput {
                                DecryptMaterialsOutput::DecryptMaterialsOutput {
                                    decryptionMaterials: Default::default()
                                }
                            }
                        }

                        impl AsRef<DecryptMaterialsOutput>
                            for DecryptMaterialsOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1310,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DefaultCache {
                            DefaultCache {
                                entryCapacity: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber
                            }
                        }

                        impl DefaultCache {
                            /// Returns a borrow of the field entryCapacity
                            pub fn entryCapacity(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber {
                                match self {
                                    DefaultCache::DefaultCache{entryCapacity, } => entryCapacity,
                                }
                            }
                        }

                        impl Debug
                            for DefaultCache {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DefaultCache {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DefaultCache::DefaultCache{entryCapacity, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DefaultCache.DefaultCache(")?;
                                        DafnyPrint::fmt_print(entryCapacity, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DefaultCache {}

                        impl Hash
                            for DefaultCache {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DefaultCache::DefaultCache{entryCapacity, } => {
                                        Hash::hash(entryCapacity, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DefaultCache {
                            fn default() -> DefaultCache {
                                DefaultCache::DefaultCache {
                                    entryCapacity: Default::default()
                                }
                            }
                        }

                        impl AsRef<DefaultCache>
                            for DefaultCache {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1313,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DeleteCacheEntryInput {
                            DeleteCacheEntryInput {
                                identifier: Sequence<u8>
                            }
                        }

                        impl DeleteCacheEntryInput {
                            /// Returns a borrow of the field identifier
                            pub fn identifier(&self) -> &Sequence<u8> {
                                match self {
                                    DeleteCacheEntryInput::DeleteCacheEntryInput{identifier, } => identifier,
                                }
                            }
                        }

                        impl Debug
                            for DeleteCacheEntryInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DeleteCacheEntryInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DeleteCacheEntryInput::DeleteCacheEntryInput{identifier, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DeleteCacheEntryInput.DeleteCacheEntryInput(")?;
                                        DafnyPrint::fmt_print(identifier, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DeleteCacheEntryInput {}

                        impl Hash
                            for DeleteCacheEntryInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DeleteCacheEntryInput::DeleteCacheEntryInput{identifier, } => {
                                        Hash::hash(identifier, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DeleteCacheEntryInput {
                            fn default() -> DeleteCacheEntryInput {
                                DeleteCacheEntryInput::DeleteCacheEntryInput {
                                    identifier: Default::default()
                                }
                            }
                        }

                        impl AsRef<DeleteCacheEntryInput>
                            for DeleteCacheEntryInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1316,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DerivationAlgorithm {
                            HKDF {
                                HKDF: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::HKDF>
                            },
                            IDENTITY {
                                IDENTITY: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IDENTITY>
                            },
                            None {
                                _None: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None>
                            }
                        }

                        impl DerivationAlgorithm {
                            /// Gets the field HKDF for all enum members which have it
                            pub fn HKDF(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::HKDF> {
                                match self {
                                    DerivationAlgorithm::HKDF{HKDF, } => HKDF,
                                    DerivationAlgorithm::IDENTITY{IDENTITY, } => panic!("field does not exist on this variant"),
                                    DerivationAlgorithm::None{_None, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field IDENTITY for all enum members which have it
                            pub fn IDENTITY(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IDENTITY> {
                                match self {
                                    DerivationAlgorithm::HKDF{HKDF, } => panic!("field does not exist on this variant"),
                                    DerivationAlgorithm::IDENTITY{IDENTITY, } => IDENTITY,
                                    DerivationAlgorithm::None{_None, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field _None for all enum members which have it
                            pub fn _None(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None> {
                                match self {
                                    DerivationAlgorithm::HKDF{HKDF, } => panic!("field does not exist on this variant"),
                                    DerivationAlgorithm::IDENTITY{IDENTITY, } => panic!("field does not exist on this variant"),
                                    DerivationAlgorithm::None{_None, } => _None,
                                }
                            }
                        }

                        impl Debug
                            for DerivationAlgorithm {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DerivationAlgorithm {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DerivationAlgorithm::HKDF{HKDF, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DerivationAlgorithm.HKDF(")?;
                                        DafnyPrint::fmt_print(HKDF, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    DerivationAlgorithm::IDENTITY{IDENTITY, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DerivationAlgorithm.IDENTITY(")?;
                                        DafnyPrint::fmt_print(IDENTITY, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    DerivationAlgorithm::None{_None, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DerivationAlgorithm.None(")?;
                                        DafnyPrint::fmt_print(_None, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DerivationAlgorithm {}

                        impl Hash
                            for DerivationAlgorithm {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DerivationAlgorithm::HKDF{HKDF, } => {
                                        Hash::hash(HKDF, _state)
                                    },
                                    DerivationAlgorithm::IDENTITY{IDENTITY, } => {
                                        Hash::hash(IDENTITY, _state)
                                    },
                                    DerivationAlgorithm::None{_None, } => {
                                        Hash::hash(_None, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DerivationAlgorithm {
                            fn default() -> DerivationAlgorithm {
                                DerivationAlgorithm::HKDF {
                                    HKDF: Default::default()
                                }
                            }
                        }

                        impl AsRef<DerivationAlgorithm>
                            for DerivationAlgorithm {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1320,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DIRECT_KEY_WRAPPING {
                            DIRECT_KEY_WRAPPING {}
                        }

                        impl DIRECT_KEY_WRAPPING {}

                        impl Debug
                            for DIRECT_KEY_WRAPPING {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DIRECT_KEY_WRAPPING {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DIRECT__KEY__WRAPPING.DIRECT__KEY__WRAPPING")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl DIRECT_KEY_WRAPPING {
                            /// Enumerates all possible values of DIRECT_KEY_WRAPPING
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DIRECT_KEY_WRAPPING>> {
                                seq![Arc::new(DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {})].iter()
                            }
                        }

                        impl Eq
                            for DIRECT_KEY_WRAPPING {}

                        impl Hash
                            for DIRECT_KEY_WRAPPING {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for DIRECT_KEY_WRAPPING {
                            fn default() -> DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING::DIRECT_KEY_WRAPPING {}
                            }
                        }

                        impl AsRef<DIRECT_KEY_WRAPPING>
                            for DIRECT_KEY_WRAPPING {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1323,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DiscoveryFilter {
                            DiscoveryFilter {
                                accountIds: Sequence<Sequence<DafnyCharUTF16>>,
                                partition: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl DiscoveryFilter {
                            /// Returns a borrow of the field accountIds
                            pub fn accountIds(&self) -> &Sequence<Sequence<DafnyCharUTF16>> {
                                match self {
                                    DiscoveryFilter::DiscoveryFilter{accountIds, partition, } => accountIds,
                                }
                            }
                            /// Returns a borrow of the field partition
                            pub fn partition(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    DiscoveryFilter::DiscoveryFilter{accountIds, partition, } => partition,
                                }
                            }
                        }

                        impl Debug
                            for DiscoveryFilter {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DiscoveryFilter {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DiscoveryFilter::DiscoveryFilter{accountIds, partition, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.DiscoveryFilter.DiscoveryFilter(")?;
                                        DafnyPrint::fmt_print(accountIds, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(partition, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for DiscoveryFilter {}

                        impl Hash
                            for DiscoveryFilter {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DiscoveryFilter::DiscoveryFilter{accountIds, partition, } => {
                                        Hash::hash(accountIds, _state);
                                        Hash::hash(partition, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for DiscoveryFilter {
                            fn default() -> DiscoveryFilter {
                                DiscoveryFilter::DiscoveryFilter {
                                    accountIds: Default::default(),
                                    partition: Default::default()
                                }
                            }
                        }

                        impl AsRef<DiscoveryFilter>
                            for DiscoveryFilter {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1327,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ECDSA {
                            ECDSA {
                                curve: Arc<ECDSASignatureAlgorithm>
                            }
                        }

                        impl ECDSA {
                            /// Returns a borrow of the field curve
                            pub fn curve(&self) -> &Arc<ECDSASignatureAlgorithm> {
                                match self {
                                    ECDSA::ECDSA{curve, } => curve,
                                }
                            }
                        }

                        impl Debug
                            for ECDSA {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ECDSA {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ECDSA::ECDSA{curve, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ECDSA.ECDSA(")?;
                                        DafnyPrint::fmt_print(curve, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ECDSA {}

                        impl Hash
                            for ECDSA {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ECDSA::ECDSA{curve, } => {
                                        Hash::hash(curve, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ECDSA {
                            fn default() -> ECDSA {
                                ECDSA::ECDSA {
                                    curve: Default::default()
                                }
                            }
                        }

                        impl AsRef<ECDSA>
                            for ECDSA {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1330,3)
                        #[derive(PartialEq, Clone)]
                        pub enum EdkWrappingAlgorithm {
                            DIRECT_KEY_WRAPPING {
                                DIRECT_KEY_WRAPPING: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING>
                            },
                            IntermediateKeyWrapping {
                                IntermediateKeyWrapping: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IntermediateKeyWrapping>
                            }
                        }

                        impl EdkWrappingAlgorithm {
                            /// Gets the field DIRECT_KEY_WRAPPING for all enum members which have it
                            pub fn DIRECT_KEY_WRAPPING(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DIRECT_KEY_WRAPPING> {
                                match self {
                                    EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{DIRECT_KEY_WRAPPING, } => DIRECT_KEY_WRAPPING,
                                    EdkWrappingAlgorithm::IntermediateKeyWrapping{IntermediateKeyWrapping, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field IntermediateKeyWrapping for all enum members which have it
                            pub fn IntermediateKeyWrapping(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IntermediateKeyWrapping> {
                                match self {
                                    EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{DIRECT_KEY_WRAPPING, } => panic!("field does not exist on this variant"),
                                    EdkWrappingAlgorithm::IntermediateKeyWrapping{IntermediateKeyWrapping, } => IntermediateKeyWrapping,
                                }
                            }
                        }

                        impl Debug
                            for EdkWrappingAlgorithm {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for EdkWrappingAlgorithm {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{DIRECT_KEY_WRAPPING, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.EdkWrappingAlgorithm.DIRECT__KEY__WRAPPING(")?;
                                        DafnyPrint::fmt_print(DIRECT_KEY_WRAPPING, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    EdkWrappingAlgorithm::IntermediateKeyWrapping{IntermediateKeyWrapping, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.EdkWrappingAlgorithm.IntermediateKeyWrapping(")?;
                                        DafnyPrint::fmt_print(IntermediateKeyWrapping, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for EdkWrappingAlgorithm {}

                        impl Hash
                            for EdkWrappingAlgorithm {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING{DIRECT_KEY_WRAPPING, } => {
                                        Hash::hash(DIRECT_KEY_WRAPPING, _state)
                                    },
                                    EdkWrappingAlgorithm::IntermediateKeyWrapping{IntermediateKeyWrapping, } => {
                                        Hash::hash(IntermediateKeyWrapping, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for EdkWrappingAlgorithm {
                            fn default() -> EdkWrappingAlgorithm {
                                EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING {
                                    DIRECT_KEY_WRAPPING: Default::default()
                                }
                            }
                        }

                        impl AsRef<EdkWrappingAlgorithm>
                            for EdkWrappingAlgorithm {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1333,3)
                        #[derive(PartialEq, Clone)]
                        pub enum Encrypt {
                            AES_GCM {
                                AES_GCM: Arc<AES_GCM>
                            }
                        }

                        impl Encrypt {
                            /// Returns a borrow of the field AES_GCM
                            pub fn AES_GCM(&self) -> &Arc<AES_GCM> {
                                match self {
                                    Encrypt::AES_GCM{AES_GCM, } => AES_GCM,
                                }
                            }
                        }

                        impl Debug
                            for Encrypt {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for Encrypt {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    Encrypt::AES_GCM{AES_GCM, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Encrypt.AES__GCM(")?;
                                        DafnyPrint::fmt_print(AES_GCM, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for Encrypt {}

                        impl Hash
                            for Encrypt {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    Encrypt::AES_GCM{AES_GCM, } => {
                                        Hash::hash(AES_GCM, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for Encrypt {
                            fn default() -> Encrypt {
                                Encrypt::AES_GCM {
                                    AES_GCM: Default::default()
                                }
                            }
                        }

                        impl AsRef<Encrypt>
                            for Encrypt {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1335,3)
                        #[derive(PartialEq, Clone)]
                        pub enum EncryptedDataKey {
                            EncryptedDataKey {
                                keyProviderId: ValidUTF8Bytes,
                                keyProviderInfo: Sequence<u8>,
                                ciphertext: Sequence<u8>
                            }
                        }

                        impl EncryptedDataKey {
                            /// Returns a borrow of the field keyProviderId
                            pub fn keyProviderId(&self) -> &ValidUTF8Bytes {
                                match self {
                                    EncryptedDataKey::EncryptedDataKey{keyProviderId, keyProviderInfo, ciphertext, } => keyProviderId,
                                }
                            }
                            /// Returns a borrow of the field keyProviderInfo
                            pub fn keyProviderInfo(&self) -> &Sequence<u8> {
                                match self {
                                    EncryptedDataKey::EncryptedDataKey{keyProviderId, keyProviderInfo, ciphertext, } => keyProviderInfo,
                                }
                            }
                            /// Returns a borrow of the field ciphertext
                            pub fn ciphertext(&self) -> &Sequence<u8> {
                                match self {
                                    EncryptedDataKey::EncryptedDataKey{keyProviderId, keyProviderInfo, ciphertext, } => ciphertext,
                                }
                            }
                        }

                        impl Debug
                            for EncryptedDataKey {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for EncryptedDataKey {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    EncryptedDataKey::EncryptedDataKey{keyProviderId, keyProviderInfo, ciphertext, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.EncryptedDataKey.EncryptedDataKey(")?;
                                        DafnyPrint::fmt_print(keyProviderId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(keyProviderInfo, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(ciphertext, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for EncryptedDataKey {}

                        impl Hash
                            for EncryptedDataKey {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    EncryptedDataKey::EncryptedDataKey{keyProviderId, keyProviderInfo, ciphertext, } => {
                                        Hash::hash(keyProviderId, _state);
                                        Hash::hash(keyProviderInfo, _state);
                                        Hash::hash(ciphertext, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for EncryptedDataKey {
                            fn default() -> EncryptedDataKey {
                                EncryptedDataKey::EncryptedDataKey {
                                    keyProviderId: Default::default(),
                                    keyProviderInfo: Default::default(),
                                    ciphertext: Default::default()
                                }
                            }
                        }

                        impl AsRef<EncryptedDataKey>
                            for EncryptedDataKey {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1343,3)
                        #[derive(PartialEq, Clone)]
                        pub enum EncryptionMaterials {
                            EncryptionMaterials {
                                algorithmSuite: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo>,
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
                                encryptedDataKeys: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey>>,
                                requiredEncryptionContextKeys: Sequence<ValidUTF8Bytes>,
                                plaintextDataKey: Arc<Option<Sequence<u8>>>,
                                signingKey: Arc<Option<Sequence<u8>>>,
                                symmetricSigningKeys: Arc<Option<Sequence<Sequence<u8>>>>
                            }
                        }

                        impl EncryptionMaterials {
                            /// Returns a borrow of the field algorithmSuite
                            pub fn algorithmSuite(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo> {
                                match self {
                                    EncryptionMaterials::EncryptionMaterials{algorithmSuite, encryptionContext, encryptedDataKeys, requiredEncryptionContextKeys, plaintextDataKey, signingKey, symmetricSigningKeys, } => algorithmSuite,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    EncryptionMaterials::EncryptionMaterials{algorithmSuite, encryptionContext, encryptedDataKeys, requiredEncryptionContextKeys, plaintextDataKey, signingKey, symmetricSigningKeys, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field encryptedDataKeys
                            pub fn encryptedDataKeys(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey>> {
                                match self {
                                    EncryptionMaterials::EncryptionMaterials{algorithmSuite, encryptionContext, encryptedDataKeys, requiredEncryptionContextKeys, plaintextDataKey, signingKey, symmetricSigningKeys, } => encryptedDataKeys,
                                }
                            }
                            /// Returns a borrow of the field requiredEncryptionContextKeys
                            pub fn requiredEncryptionContextKeys(&self) -> &Sequence<ValidUTF8Bytes> {
                                match self {
                                    EncryptionMaterials::EncryptionMaterials{algorithmSuite, encryptionContext, encryptedDataKeys, requiredEncryptionContextKeys, plaintextDataKey, signingKey, symmetricSigningKeys, } => requiredEncryptionContextKeys,
                                }
                            }
                            /// Returns a borrow of the field plaintextDataKey
                            pub fn plaintextDataKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    EncryptionMaterials::EncryptionMaterials{algorithmSuite, encryptionContext, encryptedDataKeys, requiredEncryptionContextKeys, plaintextDataKey, signingKey, symmetricSigningKeys, } => plaintextDataKey,
                                }
                            }
                            /// Returns a borrow of the field signingKey
                            pub fn signingKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    EncryptionMaterials::EncryptionMaterials{algorithmSuite, encryptionContext, encryptedDataKeys, requiredEncryptionContextKeys, plaintextDataKey, signingKey, symmetricSigningKeys, } => signingKey,
                                }
                            }
                            /// Returns a borrow of the field symmetricSigningKeys
                            pub fn symmetricSigningKeys(&self) -> &Arc<Option<Sequence<Sequence<u8>>>> {
                                match self {
                                    EncryptionMaterials::EncryptionMaterials{algorithmSuite, encryptionContext, encryptedDataKeys, requiredEncryptionContextKeys, plaintextDataKey, signingKey, symmetricSigningKeys, } => symmetricSigningKeys,
                                }
                            }
                        }

                        impl Debug
                            for EncryptionMaterials {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for EncryptionMaterials {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    EncryptionMaterials::EncryptionMaterials{algorithmSuite, encryptionContext, encryptedDataKeys, requiredEncryptionContextKeys, plaintextDataKey, signingKey, symmetricSigningKeys, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.EncryptionMaterials.EncryptionMaterials(")?;
                                        DafnyPrint::fmt_print(algorithmSuite, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptedDataKeys, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(requiredEncryptionContextKeys, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(plaintextDataKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(signingKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(symmetricSigningKeys, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for EncryptionMaterials {}

                        impl Hash
                            for EncryptionMaterials {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    EncryptionMaterials::EncryptionMaterials{algorithmSuite, encryptionContext, encryptedDataKeys, requiredEncryptionContextKeys, plaintextDataKey, signingKey, symmetricSigningKeys, } => {
                                        Hash::hash(algorithmSuite, _state);
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(encryptedDataKeys, _state);
                                        Hash::hash(requiredEncryptionContextKeys, _state);
                                        Hash::hash(plaintextDataKey, _state);
                                        Hash::hash(signingKey, _state);
                                        Hash::hash(symmetricSigningKeys, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for EncryptionMaterials {
                            fn default() -> EncryptionMaterials {
                                EncryptionMaterials::EncryptionMaterials {
                                    algorithmSuite: Default::default(),
                                    encryptionContext: Default::default(),
                                    encryptedDataKeys: Default::default(),
                                    requiredEncryptionContextKeys: Default::default(),
                                    plaintextDataKey: Default::default(),
                                    signingKey: Default::default(),
                                    symmetricSigningKeys: Default::default()
                                }
                            }
                        }

                        impl AsRef<EncryptionMaterials>
                            for EncryptionMaterials {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1352,3)
                        #[derive(PartialEq, Clone)]
                        pub enum EphemeralPrivateKeyToStaticPublicKeyInput {
                            EphemeralPrivateKeyToStaticPublicKeyInput {
                                recipientPublicKey: Sequence<u8>
                            }
                        }

                        impl EphemeralPrivateKeyToStaticPublicKeyInput {
                            /// Returns a borrow of the field recipientPublicKey
                            pub fn recipientPublicKey(&self) -> &Sequence<u8> {
                                match self {
                                    EphemeralPrivateKeyToStaticPublicKeyInput::EphemeralPrivateKeyToStaticPublicKeyInput{recipientPublicKey, } => recipientPublicKey,
                                }
                            }
                        }

                        impl Debug
                            for EphemeralPrivateKeyToStaticPublicKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for EphemeralPrivateKeyToStaticPublicKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    EphemeralPrivateKeyToStaticPublicKeyInput::EphemeralPrivateKeyToStaticPublicKeyInput{recipientPublicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.EphemeralPrivateKeyToStaticPublicKeyInput.EphemeralPrivateKeyToStaticPublicKeyInput(")?;
                                        DafnyPrint::fmt_print(recipientPublicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for EphemeralPrivateKeyToStaticPublicKeyInput {}

                        impl Hash
                            for EphemeralPrivateKeyToStaticPublicKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    EphemeralPrivateKeyToStaticPublicKeyInput::EphemeralPrivateKeyToStaticPublicKeyInput{recipientPublicKey, } => {
                                        Hash::hash(recipientPublicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for EphemeralPrivateKeyToStaticPublicKeyInput {
                            fn default() -> EphemeralPrivateKeyToStaticPublicKeyInput {
                                EphemeralPrivateKeyToStaticPublicKeyInput::EphemeralPrivateKeyToStaticPublicKeyInput {
                                    recipientPublicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<EphemeralPrivateKeyToStaticPublicKeyInput>
                            for EphemeralPrivateKeyToStaticPublicKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1355,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ESDKAlgorithmSuiteId {
                            ALG_AES_128_GCM_IV12_TAG16_NO_KDF {},
                            ALG_AES_192_GCM_IV12_TAG16_NO_KDF {},
                            ALG_AES_256_GCM_IV12_TAG16_NO_KDF {},
                            ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256 {},
                            ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256 {},
                            ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256 {},
                            ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256 {},
                            ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384 {},
                            ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384 {},
                            ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY {},
                            ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384 {}
                        }

                        impl ESDKAlgorithmSuiteId {}

                        impl Debug
                            for ESDKAlgorithmSuiteId {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ESDKAlgorithmSuiteId {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_NO_KDF{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__128__GCM__IV12__TAG16__NO__KDF")?;
                                        Ok(())
                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_NO_KDF{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__192__GCM__IV12__TAG16__NO__KDF")?;
                                        Ok(())
                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_NO_KDF{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__256__GCM__IV12__TAG16__NO__KDF")?;
                                        Ok(())
                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256")?;
                                        Ok(())
                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA256")?;
                                        Ok(())
                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA256")?;
                                        Ok(())
                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256__ECDSA__P256")?;
                                        Ok(())
                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384")?;
                                        Ok(())
                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384")?;
                                        Ok(())
                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY")?;
                                        Ok(())
                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKAlgorithmSuiteId.ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl ESDKAlgorithmSuiteId {
                            /// Enumerates all possible values of ESDKAlgorithmSuiteId
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ESDKAlgorithmSuiteId>> {
                                seq![Arc::new(ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_NO_KDF {}), Arc::new(ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_NO_KDF {}), Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_NO_KDF {}), Arc::new(ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256 {}), Arc::new(ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256 {}), Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256 {}), Arc::new(ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256 {}), Arc::new(ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384 {}), Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384 {}), Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY {}), Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384 {})].iter()
                            }
                        }

                        impl Eq
                            for ESDKAlgorithmSuiteId {}

                        impl Hash
                            for ESDKAlgorithmSuiteId {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_NO_KDF{} => {

                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_NO_KDF{} => {

                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_NO_KDF{} => {

                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256{} => {

                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA256{} => {

                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA256{} => {

                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_HKDF_SHA256_ECDSA_P256{} => {

                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_192_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384{} => {

                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384{} => {

                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY{} => {

                                    },
                                    ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for ESDKAlgorithmSuiteId {
                            fn default() -> ESDKAlgorithmSuiteId {
                                ESDKAlgorithmSuiteId::ALG_AES_128_GCM_IV12_TAG16_NO_KDF {}
                            }
                        }

                        impl AsRef<ESDKAlgorithmSuiteId>
                            for ESDKAlgorithmSuiteId {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1367,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ESDKCommitmentPolicy {
                            FORBID_ENCRYPT_ALLOW_DECRYPT {},
                            REQUIRE_ENCRYPT_ALLOW_DECRYPT {},
                            REQUIRE_ENCRYPT_REQUIRE_DECRYPT {}
                        }

                        impl ESDKCommitmentPolicy {}

                        impl Debug
                            for ESDKCommitmentPolicy {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ESDKCommitmentPolicy {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ESDKCommitmentPolicy::FORBID_ENCRYPT_ALLOW_DECRYPT{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKCommitmentPolicy.FORBID__ENCRYPT__ALLOW__DECRYPT")?;
                                        Ok(())
                                    },
                                    ESDKCommitmentPolicy::REQUIRE_ENCRYPT_ALLOW_DECRYPT{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKCommitmentPolicy.REQUIRE__ENCRYPT__ALLOW__DECRYPT")?;
                                        Ok(())
                                    },
                                    ESDKCommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ESDKCommitmentPolicy.REQUIRE__ENCRYPT__REQUIRE__DECRYPT")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl ESDKCommitmentPolicy {
                            /// Enumerates all possible values of ESDKCommitmentPolicy
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ESDKCommitmentPolicy>> {
                                seq![Arc::new(ESDKCommitmentPolicy::FORBID_ENCRYPT_ALLOW_DECRYPT {}), Arc::new(ESDKCommitmentPolicy::REQUIRE_ENCRYPT_ALLOW_DECRYPT {}), Arc::new(ESDKCommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT {})].iter()
                            }
                        }

                        impl Eq
                            for ESDKCommitmentPolicy {}

                        impl Hash
                            for ESDKCommitmentPolicy {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ESDKCommitmentPolicy::FORBID_ENCRYPT_ALLOW_DECRYPT{} => {

                                    },
                                    ESDKCommitmentPolicy::REQUIRE_ENCRYPT_ALLOW_DECRYPT{} => {

                                    },
                                    ESDKCommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for ESDKCommitmentPolicy {
                            fn default() -> ESDKCommitmentPolicy {
                                ESDKCommitmentPolicy::FORBID_ENCRYPT_ALLOW_DECRYPT {}
                            }
                        }

                        impl AsRef<ESDKCommitmentPolicy>
                            for ESDKCommitmentPolicy {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1371,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetBranchKeyIdInput {
                            GetBranchKeyIdInput {
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>
                            }
                        }

                        impl GetBranchKeyIdInput {
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    GetBranchKeyIdInput::GetBranchKeyIdInput{encryptionContext, } => encryptionContext,
                                }
                            }
                        }

                        impl Debug
                            for GetBranchKeyIdInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetBranchKeyIdInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetBranchKeyIdInput::GetBranchKeyIdInput{encryptionContext, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdInput.GetBranchKeyIdInput(")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetBranchKeyIdInput {}

                        impl Hash
                            for GetBranchKeyIdInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetBranchKeyIdInput::GetBranchKeyIdInput{encryptionContext, } => {
                                        Hash::hash(encryptionContext, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetBranchKeyIdInput {
                            fn default() -> GetBranchKeyIdInput {
                                GetBranchKeyIdInput::GetBranchKeyIdInput {
                                    encryptionContext: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetBranchKeyIdInput>
                            for GetBranchKeyIdInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1374,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetBranchKeyIdOutput {
                            GetBranchKeyIdOutput {
                                branchKeyId: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl GetBranchKeyIdOutput {
                            /// Returns a borrow of the field branchKeyId
                            pub fn branchKeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    GetBranchKeyIdOutput::GetBranchKeyIdOutput{branchKeyId, } => branchKeyId,
                                }
                            }
                        }

                        impl Debug
                            for GetBranchKeyIdOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetBranchKeyIdOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetBranchKeyIdOutput::GetBranchKeyIdOutput{branchKeyId, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.GetBranchKeyIdOutput.GetBranchKeyIdOutput(")?;
                                        DafnyPrint::fmt_print(branchKeyId, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetBranchKeyIdOutput {}

                        impl Hash
                            for GetBranchKeyIdOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetBranchKeyIdOutput::GetBranchKeyIdOutput{branchKeyId, } => {
                                        Hash::hash(branchKeyId, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetBranchKeyIdOutput {
                            fn default() -> GetBranchKeyIdOutput {
                                GetBranchKeyIdOutput::GetBranchKeyIdOutput {
                                    branchKeyId: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetBranchKeyIdOutput>
                            for GetBranchKeyIdOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1377,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetCacheEntryInput {
                            GetCacheEntryInput {
                                identifier: Sequence<u8>,
                                bytesUsed: Arc<Option<i64>>
                            }
                        }

                        impl GetCacheEntryInput {
                            /// Returns a borrow of the field identifier
                            pub fn identifier(&self) -> &Sequence<u8> {
                                match self {
                                    GetCacheEntryInput::GetCacheEntryInput{identifier, bytesUsed, } => identifier,
                                }
                            }
                            /// Returns a borrow of the field bytesUsed
                            pub fn bytesUsed(&self) -> &Arc<Option<i64>> {
                                match self {
                                    GetCacheEntryInput::GetCacheEntryInput{identifier, bytesUsed, } => bytesUsed,
                                }
                            }
                        }

                        impl Debug
                            for GetCacheEntryInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetCacheEntryInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetCacheEntryInput::GetCacheEntryInput{identifier, bytesUsed, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryInput.GetCacheEntryInput(")?;
                                        DafnyPrint::fmt_print(identifier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(bytesUsed, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetCacheEntryInput {}

                        impl Hash
                            for GetCacheEntryInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetCacheEntryInput::GetCacheEntryInput{identifier, bytesUsed, } => {
                                        Hash::hash(identifier, _state);
                                        Hash::hash(bytesUsed, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetCacheEntryInput {
                            fn default() -> GetCacheEntryInput {
                                GetCacheEntryInput::GetCacheEntryInput {
                                    identifier: Default::default(),
                                    bytesUsed: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetCacheEntryInput>
                            for GetCacheEntryInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1381,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetCacheEntryOutput {
                            GetCacheEntryOutput {
                                materials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Materials>,
                                creationTime: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong,
                                expiryTime: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong,
                                messagesUsed: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger,
                                bytesUsed: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger
                            }
                        }

                        impl GetCacheEntryOutput {
                            /// Returns a borrow of the field materials
                            pub fn materials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Materials> {
                                match self {
                                    GetCacheEntryOutput::GetCacheEntryOutput{materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => materials,
                                }
                            }
                            /// Returns a borrow of the field creationTime
                            pub fn creationTime(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong {
                                match self {
                                    GetCacheEntryOutput::GetCacheEntryOutput{materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => creationTime,
                                }
                            }
                            /// Returns a borrow of the field expiryTime
                            pub fn expiryTime(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong {
                                match self {
                                    GetCacheEntryOutput::GetCacheEntryOutput{materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => expiryTime,
                                }
                            }
                            /// Returns a borrow of the field messagesUsed
                            pub fn messagesUsed(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger {
                                match self {
                                    GetCacheEntryOutput::GetCacheEntryOutput{materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => messagesUsed,
                                }
                            }
                            /// Returns a borrow of the field bytesUsed
                            pub fn bytesUsed(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger {
                                match self {
                                    GetCacheEntryOutput::GetCacheEntryOutput{materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => bytesUsed,
                                }
                            }
                        }

                        impl Debug
                            for GetCacheEntryOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetCacheEntryOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetCacheEntryOutput::GetCacheEntryOutput{materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.GetCacheEntryOutput.GetCacheEntryOutput(")?;
                                        DafnyPrint::fmt_print(materials, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(creationTime, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(expiryTime, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(messagesUsed, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(bytesUsed, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetCacheEntryOutput {}

                        impl Hash
                            for GetCacheEntryOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetCacheEntryOutput::GetCacheEntryOutput{materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => {
                                        Hash::hash(materials, _state);
                                        Hash::hash(creationTime, _state);
                                        Hash::hash(expiryTime, _state);
                                        Hash::hash(messagesUsed, _state);
                                        Hash::hash(bytesUsed, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetCacheEntryOutput {
                            fn default() -> GetCacheEntryOutput {
                                GetCacheEntryOutput::GetCacheEntryOutput {
                                    materials: Default::default(),
                                    creationTime: Default::default(),
                                    expiryTime: Default::default(),
                                    messagesUsed: Default::default(),
                                    bytesUsed: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetCacheEntryOutput>
                            for GetCacheEntryOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1388,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetClientInput {
                            GetClientInput {
                                region: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl GetClientInput {
                            /// Returns a borrow of the field region
                            pub fn region(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    GetClientInput::GetClientInput{region, } => region,
                                }
                            }
                        }

                        impl Debug
                            for GetClientInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetClientInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetClientInput::GetClientInput{region, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.GetClientInput.GetClientInput(")?;
                                        DafnyPrint::fmt_print(region, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetClientInput {}

                        impl Hash
                            for GetClientInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetClientInput::GetClientInput{region, } => {
                                        Hash::hash(region, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetClientInput {
                            fn default() -> GetClientInput {
                                GetClientInput::GetClientInput {
                                    region: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetClientInput>
                            for GetClientInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1391,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetEncryptionMaterialsInput {
                            GetEncryptionMaterialsInput {
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
                                commitmentPolicy: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy>,
                                algorithmSuiteId: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId>>>,
                                maxPlaintextLength: Arc<Option<i64>>,
                                requiredEncryptionContextKeys: Arc<Option<Sequence<ValidUTF8Bytes>>>
                            }
                        }

                        impl GetEncryptionMaterialsInput {
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    GetEncryptionMaterialsInput::GetEncryptionMaterialsInput{encryptionContext, commitmentPolicy, algorithmSuiteId, maxPlaintextLength, requiredEncryptionContextKeys, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field commitmentPolicy
                            pub fn commitmentPolicy(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy> {
                                match self {
                                    GetEncryptionMaterialsInput::GetEncryptionMaterialsInput{encryptionContext, commitmentPolicy, algorithmSuiteId, maxPlaintextLength, requiredEncryptionContextKeys, } => commitmentPolicy,
                                }
                            }
                            /// Returns a borrow of the field algorithmSuiteId
                            pub fn algorithmSuiteId(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId>>> {
                                match self {
                                    GetEncryptionMaterialsInput::GetEncryptionMaterialsInput{encryptionContext, commitmentPolicy, algorithmSuiteId, maxPlaintextLength, requiredEncryptionContextKeys, } => algorithmSuiteId,
                                }
                            }
                            /// Returns a borrow of the field maxPlaintextLength
                            pub fn maxPlaintextLength(&self) -> &Arc<Option<i64>> {
                                match self {
                                    GetEncryptionMaterialsInput::GetEncryptionMaterialsInput{encryptionContext, commitmentPolicy, algorithmSuiteId, maxPlaintextLength, requiredEncryptionContextKeys, } => maxPlaintextLength,
                                }
                            }
                            /// Returns a borrow of the field requiredEncryptionContextKeys
                            pub fn requiredEncryptionContextKeys(&self) -> &Arc<Option<Sequence<ValidUTF8Bytes>>> {
                                match self {
                                    GetEncryptionMaterialsInput::GetEncryptionMaterialsInput{encryptionContext, commitmentPolicy, algorithmSuiteId, maxPlaintextLength, requiredEncryptionContextKeys, } => requiredEncryptionContextKeys,
                                }
                            }
                        }

                        impl Debug
                            for GetEncryptionMaterialsInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetEncryptionMaterialsInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetEncryptionMaterialsInput::GetEncryptionMaterialsInput{encryptionContext, commitmentPolicy, algorithmSuiteId, maxPlaintextLength, requiredEncryptionContextKeys, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsInput.GetEncryptionMaterialsInput(")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(commitmentPolicy, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(algorithmSuiteId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(maxPlaintextLength, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(requiredEncryptionContextKeys, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetEncryptionMaterialsInput {}

                        impl Hash
                            for GetEncryptionMaterialsInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetEncryptionMaterialsInput::GetEncryptionMaterialsInput{encryptionContext, commitmentPolicy, algorithmSuiteId, maxPlaintextLength, requiredEncryptionContextKeys, } => {
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(commitmentPolicy, _state);
                                        Hash::hash(algorithmSuiteId, _state);
                                        Hash::hash(maxPlaintextLength, _state);
                                        Hash::hash(requiredEncryptionContextKeys, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetEncryptionMaterialsInput {
                            fn default() -> GetEncryptionMaterialsInput {
                                GetEncryptionMaterialsInput::GetEncryptionMaterialsInput {
                                    encryptionContext: Default::default(),
                                    commitmentPolicy: Default::default(),
                                    algorithmSuiteId: Default::default(),
                                    maxPlaintextLength: Default::default(),
                                    requiredEncryptionContextKeys: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetEncryptionMaterialsInput>
                            for GetEncryptionMaterialsInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1398,3)
                        #[derive(PartialEq, Clone)]
                        pub enum GetEncryptionMaterialsOutput {
                            GetEncryptionMaterialsOutput {
                                encryptionMaterials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials>
                            }
                        }

                        impl GetEncryptionMaterialsOutput {
                            /// Returns a borrow of the field encryptionMaterials
                            pub fn encryptionMaterials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials> {
                                match self {
                                    GetEncryptionMaterialsOutput::GetEncryptionMaterialsOutput{encryptionMaterials, } => encryptionMaterials,
                                }
                            }
                        }

                        impl Debug
                            for GetEncryptionMaterialsOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for GetEncryptionMaterialsOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    GetEncryptionMaterialsOutput::GetEncryptionMaterialsOutput{encryptionMaterials, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.GetEncryptionMaterialsOutput.GetEncryptionMaterialsOutput(")?;
                                        DafnyPrint::fmt_print(encryptionMaterials, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for GetEncryptionMaterialsOutput {}

                        impl Hash
                            for GetEncryptionMaterialsOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    GetEncryptionMaterialsOutput::GetEncryptionMaterialsOutput{encryptionMaterials, } => {
                                        Hash::hash(encryptionMaterials, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for GetEncryptionMaterialsOutput {
                            fn default() -> GetEncryptionMaterialsOutput {
                                GetEncryptionMaterialsOutput::GetEncryptionMaterialsOutput {
                                    encryptionMaterials: Default::default()
                                }
                            }
                        }

                        impl AsRef<GetEncryptionMaterialsOutput>
                            for GetEncryptionMaterialsOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1402,3)
                        #[derive(PartialEq, Clone)]
                        pub enum HKDF {
                            HKDF {
                                hmac: Arc<DigestAlgorithm>,
                                saltLength: crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger,
                                inputKeyLength: SymmetricKeyLength,
                                outputKeyLength: SymmetricKeyLength
                            }
                        }

                        impl HKDF {
                            /// Returns a borrow of the field hmac
                            pub fn hmac(&self) -> &Arc<DigestAlgorithm> {
                                match self {
                                    HKDF::HKDF{hmac, saltLength, inputKeyLength, outputKeyLength, } => hmac,
                                }
                            }
                            /// Returns a borrow of the field saltLength
                            pub fn saltLength(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger {
                                match self {
                                    HKDF::HKDF{hmac, saltLength, inputKeyLength, outputKeyLength, } => saltLength,
                                }
                            }
                            /// Returns a borrow of the field inputKeyLength
                            pub fn inputKeyLength(&self) -> &SymmetricKeyLength {
                                match self {
                                    HKDF::HKDF{hmac, saltLength, inputKeyLength, outputKeyLength, } => inputKeyLength,
                                }
                            }
                            /// Returns a borrow of the field outputKeyLength
                            pub fn outputKeyLength(&self) -> &SymmetricKeyLength {
                                match self {
                                    HKDF::HKDF{hmac, saltLength, inputKeyLength, outputKeyLength, } => outputKeyLength,
                                }
                            }
                        }

                        impl Debug
                            for HKDF {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for HKDF {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    HKDF::HKDF{hmac, saltLength, inputKeyLength, outputKeyLength, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.HKDF.HKDF(")?;
                                        DafnyPrint::fmt_print(hmac, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(saltLength, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(inputKeyLength, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(outputKeyLength, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for HKDF {}

                        impl Hash
                            for HKDF {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    HKDF::HKDF{hmac, saltLength, inputKeyLength, outputKeyLength, } => {
                                        Hash::hash(hmac, _state);
                                        Hash::hash(saltLength, _state);
                                        Hash::hash(inputKeyLength, _state);
                                        Hash::hash(outputKeyLength, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for HKDF {
                            fn default() -> HKDF {
                                HKDF::HKDF {
                                    hmac: Default::default(),
                                    saltLength: Default::default(),
                                    inputKeyLength: Default::default(),
                                    outputKeyLength: Default::default()
                                }
                            }
                        }

                        impl AsRef<HKDF>
                            for HKDF {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1408,3)
                        #[derive(PartialEq, Clone)]
                        pub enum IDENTITY {
                            IDENTITY {}
                        }

                        impl IDENTITY {}

                        impl Debug
                            for IDENTITY {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for IDENTITY {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    IDENTITY::IDENTITY{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.IDENTITY.IDENTITY")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl IDENTITY {
                            /// Enumerates all possible values of IDENTITY
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<IDENTITY>> {
                                seq![Arc::new(IDENTITY::IDENTITY {})].iter()
                            }
                        }

                        impl Eq
                            for IDENTITY {}

                        impl Hash
                            for IDENTITY {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    IDENTITY::IDENTITY{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for IDENTITY {
                            fn default() -> IDENTITY {
                                IDENTITY::IDENTITY {}
                            }
                        }

                        impl AsRef<IDENTITY>
                            for IDENTITY {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1411,3)
                        #[derive(PartialEq, Clone)]
                        pub enum InitializeDecryptionMaterialsInput {
                            InitializeDecryptionMaterialsInput {
                                algorithmSuiteId: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId>,
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
                                requiredEncryptionContextKeys: Sequence<ValidUTF8Bytes>
                            }
                        }

                        impl InitializeDecryptionMaterialsInput {
                            /// Returns a borrow of the field algorithmSuiteId
                            pub fn algorithmSuiteId(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId> {
                                match self {
                                    InitializeDecryptionMaterialsInput::InitializeDecryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, } => algorithmSuiteId,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    InitializeDecryptionMaterialsInput::InitializeDecryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field requiredEncryptionContextKeys
                            pub fn requiredEncryptionContextKeys(&self) -> &Sequence<ValidUTF8Bytes> {
                                match self {
                                    InitializeDecryptionMaterialsInput::InitializeDecryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, } => requiredEncryptionContextKeys,
                                }
                            }
                        }

                        impl Debug
                            for InitializeDecryptionMaterialsInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for InitializeDecryptionMaterialsInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    InitializeDecryptionMaterialsInput::InitializeDecryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.InitializeDecryptionMaterialsInput.InitializeDecryptionMaterialsInput(")?;
                                        DafnyPrint::fmt_print(algorithmSuiteId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(requiredEncryptionContextKeys, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for InitializeDecryptionMaterialsInput {}

                        impl Hash
                            for InitializeDecryptionMaterialsInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    InitializeDecryptionMaterialsInput::InitializeDecryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, } => {
                                        Hash::hash(algorithmSuiteId, _state);
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(requiredEncryptionContextKeys, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for InitializeDecryptionMaterialsInput {
                            fn default() -> InitializeDecryptionMaterialsInput {
                                InitializeDecryptionMaterialsInput::InitializeDecryptionMaterialsInput {
                                    algorithmSuiteId: Default::default(),
                                    encryptionContext: Default::default(),
                                    requiredEncryptionContextKeys: Default::default()
                                }
                            }
                        }

                        impl AsRef<InitializeDecryptionMaterialsInput>
                            for InitializeDecryptionMaterialsInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1416,3)
                        #[derive(PartialEq, Clone)]
                        pub enum InitializeEncryptionMaterialsInput {
                            InitializeEncryptionMaterialsInput {
                                algorithmSuiteId: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId>,
                                encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
                                requiredEncryptionContextKeys: Sequence<ValidUTF8Bytes>,
                                signingKey: Arc<Option<Sequence<u8>>>,
                                verificationKey: Arc<Option<Sequence<u8>>>
                            }
                        }

                        impl InitializeEncryptionMaterialsInput {
                            /// Returns a borrow of the field algorithmSuiteId
                            pub fn algorithmSuiteId(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId> {
                                match self {
                                    InitializeEncryptionMaterialsInput::InitializeEncryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, signingKey, verificationKey, } => algorithmSuiteId,
                                }
                            }
                            /// Returns a borrow of the field encryptionContext
                            pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
                                match self {
                                    InitializeEncryptionMaterialsInput::InitializeEncryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, signingKey, verificationKey, } => encryptionContext,
                                }
                            }
                            /// Returns a borrow of the field requiredEncryptionContextKeys
                            pub fn requiredEncryptionContextKeys(&self) -> &Sequence<ValidUTF8Bytes> {
                                match self {
                                    InitializeEncryptionMaterialsInput::InitializeEncryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, signingKey, verificationKey, } => requiredEncryptionContextKeys,
                                }
                            }
                            /// Returns a borrow of the field signingKey
                            pub fn signingKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    InitializeEncryptionMaterialsInput::InitializeEncryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, signingKey, verificationKey, } => signingKey,
                                }
                            }
                            /// Returns a borrow of the field verificationKey
                            pub fn verificationKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    InitializeEncryptionMaterialsInput::InitializeEncryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, signingKey, verificationKey, } => verificationKey,
                                }
                            }
                        }

                        impl Debug
                            for InitializeEncryptionMaterialsInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for InitializeEncryptionMaterialsInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    InitializeEncryptionMaterialsInput::InitializeEncryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, signingKey, verificationKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.InitializeEncryptionMaterialsInput.InitializeEncryptionMaterialsInput(")?;
                                        DafnyPrint::fmt_print(algorithmSuiteId, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(requiredEncryptionContextKeys, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(signingKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(verificationKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for InitializeEncryptionMaterialsInput {}

                        impl Hash
                            for InitializeEncryptionMaterialsInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    InitializeEncryptionMaterialsInput::InitializeEncryptionMaterialsInput{algorithmSuiteId, encryptionContext, requiredEncryptionContextKeys, signingKey, verificationKey, } => {
                                        Hash::hash(algorithmSuiteId, _state);
                                        Hash::hash(encryptionContext, _state);
                                        Hash::hash(requiredEncryptionContextKeys, _state);
                                        Hash::hash(signingKey, _state);
                                        Hash::hash(verificationKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for InitializeEncryptionMaterialsInput {
                            fn default() -> InitializeEncryptionMaterialsInput {
                                InitializeEncryptionMaterialsInput::InitializeEncryptionMaterialsInput {
                                    algorithmSuiteId: Default::default(),
                                    encryptionContext: Default::default(),
                                    requiredEncryptionContextKeys: Default::default(),
                                    signingKey: Default::default(),
                                    verificationKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<InitializeEncryptionMaterialsInput>
                            for InitializeEncryptionMaterialsInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1423,3)
                        #[derive(PartialEq, Clone)]
                        pub enum IntermediateKeyWrapping {
                            IntermediateKeyWrapping {
                                keyEncryptionKeyKdf: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm>,
                                macKeyKdf: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm>,
                                pdkEncryptAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Encrypt>
                            }
                        }

                        impl IntermediateKeyWrapping {
                            /// Returns a borrow of the field keyEncryptionKeyKdf
                            pub fn keyEncryptionKeyKdf(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm> {
                                match self {
                                    IntermediateKeyWrapping::IntermediateKeyWrapping{keyEncryptionKeyKdf, macKeyKdf, pdkEncryptAlgorithm, } => keyEncryptionKeyKdf,
                                }
                            }
                            /// Returns a borrow of the field macKeyKdf
                            pub fn macKeyKdf(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm> {
                                match self {
                                    IntermediateKeyWrapping::IntermediateKeyWrapping{keyEncryptionKeyKdf, macKeyKdf, pdkEncryptAlgorithm, } => macKeyKdf,
                                }
                            }
                            /// Returns a borrow of the field pdkEncryptAlgorithm
                            pub fn pdkEncryptAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Encrypt> {
                                match self {
                                    IntermediateKeyWrapping::IntermediateKeyWrapping{keyEncryptionKeyKdf, macKeyKdf, pdkEncryptAlgorithm, } => pdkEncryptAlgorithm,
                                }
                            }
                        }

                        impl Debug
                            for IntermediateKeyWrapping {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for IntermediateKeyWrapping {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    IntermediateKeyWrapping::IntermediateKeyWrapping{keyEncryptionKeyKdf, macKeyKdf, pdkEncryptAlgorithm, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.IntermediateKeyWrapping.IntermediateKeyWrapping(")?;
                                        DafnyPrint::fmt_print(keyEncryptionKeyKdf, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(macKeyKdf, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(pdkEncryptAlgorithm, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for IntermediateKeyWrapping {}

                        impl Hash
                            for IntermediateKeyWrapping {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    IntermediateKeyWrapping::IntermediateKeyWrapping{keyEncryptionKeyKdf, macKeyKdf, pdkEncryptAlgorithm, } => {
                                        Hash::hash(keyEncryptionKeyKdf, _state);
                                        Hash::hash(macKeyKdf, _state);
                                        Hash::hash(pdkEncryptAlgorithm, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for IntermediateKeyWrapping {
                            fn default() -> IntermediateKeyWrapping {
                                IntermediateKeyWrapping::IntermediateKeyWrapping {
                                    keyEncryptionKeyKdf: Default::default(),
                                    macKeyKdf: Default::default(),
                                    pdkEncryptAlgorithm: Default::default()
                                }
                            }
                        }

                        impl AsRef<IntermediateKeyWrapping>
                            for IntermediateKeyWrapping {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1428,3)
                        #[derive(PartialEq, Clone)]
                        pub enum KeyAgreementScheme {
                            StaticConfiguration {
                                StaticConfiguration: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::StaticConfigurations>
                            }
                        }

                        impl KeyAgreementScheme {
                            /// Returns a borrow of the field StaticConfiguration
                            pub fn StaticConfiguration(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::StaticConfigurations> {
                                match self {
                                    KeyAgreementScheme::StaticConfiguration{StaticConfiguration, } => StaticConfiguration,
                                }
                            }
                        }

                        impl Debug
                            for KeyAgreementScheme {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for KeyAgreementScheme {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    KeyAgreementScheme::StaticConfiguration{StaticConfiguration, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.KeyAgreementScheme.StaticConfiguration(")?;
                                        DafnyPrint::fmt_print(StaticConfiguration, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for KeyAgreementScheme {}

                        impl Hash
                            for KeyAgreementScheme {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    KeyAgreementScheme::StaticConfiguration{StaticConfiguration, } => {
                                        Hash::hash(StaticConfiguration, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for KeyAgreementScheme {
                            fn default() -> KeyAgreementScheme {
                                KeyAgreementScheme::StaticConfiguration {
                                    StaticConfiguration: Default::default()
                                }
                            }
                        }

                        impl AsRef<KeyAgreementScheme>
                            for KeyAgreementScheme {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1431,3)
                        pub struct IKeyringCallHistory {}

                        impl IKeyringCallHistory {
                            /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                            pub fn _allocate_object() -> Object<Self> {
                                allocate_object::<Self>()
                            }
                        }

                        impl UpcastObject<DynAny>
                            for crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyringCallHistory {
                            UpcastObjectFn!(DynAny);
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1439,3)
                        pub trait IKeyring: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1468,5)
                            fn OnEncrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                                let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                _out0 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring::_OnEncrypt_k(rd!(Object::<_>::from_ref(self)), input);
                                output = _out0.clone();
                                return output.clone();
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1485,5)
                            fn _OnEncrypt_k(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1499,5)
                            fn OnDecrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
                                let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                _out0 = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring::_OnDecrypt_k(rd!(Object::<_>::from_ref(self)), input);
                                output = _out0.clone();
                                return output.clone();
                            }
                            /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1516,5)
                            fn _OnDecrypt_k(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1529,3)
                        #[derive(PartialEq, Clone)]
                        pub enum KmsEcdhStaticConfigurations {
                            KmsPublicKeyDiscovery {
                                KmsPublicKeyDiscovery: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsPublicKeyDiscoveryInput>
                            },
                            KmsPrivateKeyToStaticPublicKey {
                                KmsPrivateKeyToStaticPublicKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsPrivateKeyToStaticPublicKeyInput>
                            }
                        }

                        impl KmsEcdhStaticConfigurations {
                            /// Gets the field KmsPublicKeyDiscovery for all enum members which have it
                            pub fn KmsPublicKeyDiscovery(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsPublicKeyDiscoveryInput> {
                                match self {
                                    KmsEcdhStaticConfigurations::KmsPublicKeyDiscovery{KmsPublicKeyDiscovery, } => KmsPublicKeyDiscovery,
                                    KmsEcdhStaticConfigurations::KmsPrivateKeyToStaticPublicKey{KmsPrivateKeyToStaticPublicKey, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field KmsPrivateKeyToStaticPublicKey for all enum members which have it
                            pub fn KmsPrivateKeyToStaticPublicKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsPrivateKeyToStaticPublicKeyInput> {
                                match self {
                                    KmsEcdhStaticConfigurations::KmsPublicKeyDiscovery{KmsPublicKeyDiscovery, } => panic!("field does not exist on this variant"),
                                    KmsEcdhStaticConfigurations::KmsPrivateKeyToStaticPublicKey{KmsPrivateKeyToStaticPublicKey, } => KmsPrivateKeyToStaticPublicKey,
                                }
                            }
                        }

                        impl Debug
                            for KmsEcdhStaticConfigurations {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for KmsEcdhStaticConfigurations {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    KmsEcdhStaticConfigurations::KmsPublicKeyDiscovery{KmsPublicKeyDiscovery, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.KmsEcdhStaticConfigurations.KmsPublicKeyDiscovery(")?;
                                        DafnyPrint::fmt_print(KmsPublicKeyDiscovery, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    KmsEcdhStaticConfigurations::KmsPrivateKeyToStaticPublicKey{KmsPrivateKeyToStaticPublicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.KmsEcdhStaticConfigurations.KmsPrivateKeyToStaticPublicKey(")?;
                                        DafnyPrint::fmt_print(KmsPrivateKeyToStaticPublicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for KmsEcdhStaticConfigurations {}

                        impl Hash
                            for KmsEcdhStaticConfigurations {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    KmsEcdhStaticConfigurations::KmsPublicKeyDiscovery{KmsPublicKeyDiscovery, } => {
                                        Hash::hash(KmsPublicKeyDiscovery, _state)
                                    },
                                    KmsEcdhStaticConfigurations::KmsPrivateKeyToStaticPublicKey{KmsPrivateKeyToStaticPublicKey, } => {
                                        Hash::hash(KmsPrivateKeyToStaticPublicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for KmsEcdhStaticConfigurations {
                            fn default() -> KmsEcdhStaticConfigurations {
                                KmsEcdhStaticConfigurations::KmsPublicKeyDiscovery {
                                    KmsPublicKeyDiscovery: Default::default()
                                }
                            }
                        }

                        impl AsRef<KmsEcdhStaticConfigurations>
                            for KmsEcdhStaticConfigurations {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1534,3)
                        #[derive(PartialEq, Clone)]
                        pub enum KmsPrivateKeyToStaticPublicKeyInput {
                            KmsPrivateKeyToStaticPublicKeyInput {
                                senderKmsIdentifier: Sequence<DafnyCharUTF16>,
                                senderPublicKey: Arc<Option<Sequence<u8>>>,
                                recipientPublicKey: Sequence<u8>
                            }
                        }

                        impl KmsPrivateKeyToStaticPublicKeyInput {
                            /// Returns a borrow of the field senderKmsIdentifier
                            pub fn senderKmsIdentifier(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    KmsPrivateKeyToStaticPublicKeyInput::KmsPrivateKeyToStaticPublicKeyInput{senderKmsIdentifier, senderPublicKey, recipientPublicKey, } => senderKmsIdentifier,
                                }
                            }
                            /// Returns a borrow of the field senderPublicKey
                            pub fn senderPublicKey(&self) -> &Arc<Option<Sequence<u8>>> {
                                match self {
                                    KmsPrivateKeyToStaticPublicKeyInput::KmsPrivateKeyToStaticPublicKeyInput{senderKmsIdentifier, senderPublicKey, recipientPublicKey, } => senderPublicKey,
                                }
                            }
                            /// Returns a borrow of the field recipientPublicKey
                            pub fn recipientPublicKey(&self) -> &Sequence<u8> {
                                match self {
                                    KmsPrivateKeyToStaticPublicKeyInput::KmsPrivateKeyToStaticPublicKeyInput{senderKmsIdentifier, senderPublicKey, recipientPublicKey, } => recipientPublicKey,
                                }
                            }
                        }

                        impl Debug
                            for KmsPrivateKeyToStaticPublicKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for KmsPrivateKeyToStaticPublicKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    KmsPrivateKeyToStaticPublicKeyInput::KmsPrivateKeyToStaticPublicKeyInput{senderKmsIdentifier, senderPublicKey, recipientPublicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.KmsPrivateKeyToStaticPublicKeyInput.KmsPrivateKeyToStaticPublicKeyInput(")?;
                                        DafnyPrint::fmt_print(senderKmsIdentifier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(senderPublicKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(recipientPublicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for KmsPrivateKeyToStaticPublicKeyInput {}

                        impl Hash
                            for KmsPrivateKeyToStaticPublicKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    KmsPrivateKeyToStaticPublicKeyInput::KmsPrivateKeyToStaticPublicKeyInput{senderKmsIdentifier, senderPublicKey, recipientPublicKey, } => {
                                        Hash::hash(senderKmsIdentifier, _state);
                                        Hash::hash(senderPublicKey, _state);
                                        Hash::hash(recipientPublicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for KmsPrivateKeyToStaticPublicKeyInput {
                            fn default() -> KmsPrivateKeyToStaticPublicKeyInput {
                                KmsPrivateKeyToStaticPublicKeyInput::KmsPrivateKeyToStaticPublicKeyInput {
                                    senderKmsIdentifier: Default::default(),
                                    senderPublicKey: Default::default(),
                                    recipientPublicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<KmsPrivateKeyToStaticPublicKeyInput>
                            for KmsPrivateKeyToStaticPublicKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1539,3)
                        #[derive(PartialEq, Clone)]
                        pub enum KmsPublicKeyDiscoveryInput {
                            KmsPublicKeyDiscoveryInput {
                                recipientKmsIdentifier: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl KmsPublicKeyDiscoveryInput {
                            /// Returns a borrow of the field recipientKmsIdentifier
                            pub fn recipientKmsIdentifier(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    KmsPublicKeyDiscoveryInput::KmsPublicKeyDiscoveryInput{recipientKmsIdentifier, } => recipientKmsIdentifier,
                                }
                            }
                        }

                        impl Debug
                            for KmsPublicKeyDiscoveryInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for KmsPublicKeyDiscoveryInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    KmsPublicKeyDiscoveryInput::KmsPublicKeyDiscoveryInput{recipientKmsIdentifier, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.KmsPublicKeyDiscoveryInput.KmsPublicKeyDiscoveryInput(")?;
                                        DafnyPrint::fmt_print(recipientKmsIdentifier, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for KmsPublicKeyDiscoveryInput {}

                        impl Hash
                            for KmsPublicKeyDiscoveryInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    KmsPublicKeyDiscoveryInput::KmsPublicKeyDiscoveryInput{recipientKmsIdentifier, } => {
                                        Hash::hash(recipientKmsIdentifier, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for KmsPublicKeyDiscoveryInput {
                            fn default() -> KmsPublicKeyDiscoveryInput {
                                KmsPublicKeyDiscoveryInput::KmsPublicKeyDiscoveryInput {
                                    recipientKmsIdentifier: Default::default()
                                }
                            }
                        }

                        impl AsRef<KmsPublicKeyDiscoveryInput>
                            for KmsPublicKeyDiscoveryInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1542,3)
                        #[derive(PartialEq, Clone)]
                        pub enum MaterialProvidersConfig {
                            MaterialProvidersConfig {}
                        }

                        impl MaterialProvidersConfig {}

                        impl Debug
                            for MaterialProvidersConfig {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for MaterialProvidersConfig {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    MaterialProvidersConfig::MaterialProvidersConfig{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.MaterialProvidersConfig.MaterialProvidersConfig")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl MaterialProvidersConfig {
                            /// Enumerates all possible values of MaterialProvidersConfig
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<MaterialProvidersConfig>> {
                                seq![Arc::new(MaterialProvidersConfig::MaterialProvidersConfig {})].iter()
                            }
                        }

                        impl Eq
                            for MaterialProvidersConfig {}

                        impl Hash
                            for MaterialProvidersConfig {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    MaterialProvidersConfig::MaterialProvidersConfig{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for MaterialProvidersConfig {
                            fn default() -> MaterialProvidersConfig {
                                MaterialProvidersConfig::MaterialProvidersConfig {}
                            }
                        }

                        impl AsRef<MaterialProvidersConfig>
                            for MaterialProvidersConfig {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1545,3)
                        #[derive(PartialEq, Clone)]
                        pub enum Materials {
                            Encryption {
                                Encryption: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials>
                            },
                            Decryption {
                                Decryption: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials>
                            },
                            BranchKey {
                                BranchKey: Arc<BranchKeyMaterials>
                            },
                            BeaconKey {
                                BeaconKey: Arc<BeaconKeyMaterials>
                            }
                        }

                        impl Materials {
                            /// Gets the field Encryption for all enum members which have it
                            pub fn Encryption(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials> {
                                match self {
                                    Materials::Encryption{Encryption, } => Encryption,
                                    Materials::Decryption{Decryption, } => panic!("field does not exist on this variant"),
                                    Materials::BranchKey{BranchKey, } => panic!("field does not exist on this variant"),
                                    Materials::BeaconKey{BeaconKey, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field Decryption for all enum members which have it
                            pub fn Decryption(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials> {
                                match self {
                                    Materials::Encryption{Encryption, } => panic!("field does not exist on this variant"),
                                    Materials::Decryption{Decryption, } => Decryption,
                                    Materials::BranchKey{BranchKey, } => panic!("field does not exist on this variant"),
                                    Materials::BeaconKey{BeaconKey, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field BranchKey for all enum members which have it
                            pub fn BranchKey(&self) -> &Arc<BranchKeyMaterials> {
                                match self {
                                    Materials::Encryption{Encryption, } => panic!("field does not exist on this variant"),
                                    Materials::Decryption{Decryption, } => panic!("field does not exist on this variant"),
                                    Materials::BranchKey{BranchKey, } => BranchKey,
                                    Materials::BeaconKey{BeaconKey, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field BeaconKey for all enum members which have it
                            pub fn BeaconKey(&self) -> &Arc<BeaconKeyMaterials> {
                                match self {
                                    Materials::Encryption{Encryption, } => panic!("field does not exist on this variant"),
                                    Materials::Decryption{Decryption, } => panic!("field does not exist on this variant"),
                                    Materials::BranchKey{BranchKey, } => panic!("field does not exist on this variant"),
                                    Materials::BeaconKey{BeaconKey, } => BeaconKey,
                                }
                            }
                        }

                        impl Debug
                            for Materials {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for Materials {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    Materials::Encryption{Encryption, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Materials.Encryption(")?;
                                        DafnyPrint::fmt_print(Encryption, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Materials::Decryption{Decryption, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Materials.Decryption(")?;
                                        DafnyPrint::fmt_print(Decryption, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Materials::BranchKey{BranchKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Materials.BranchKey(")?;
                                        DafnyPrint::fmt_print(BranchKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Materials::BeaconKey{BeaconKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Materials.BeaconKey(")?;
                                        DafnyPrint::fmt_print(BeaconKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for Materials {}

                        impl Hash
                            for Materials {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    Materials::Encryption{Encryption, } => {
                                        Hash::hash(Encryption, _state)
                                    },
                                    Materials::Decryption{Decryption, } => {
                                        Hash::hash(Decryption, _state)
                                    },
                                    Materials::BranchKey{BranchKey, } => {
                                        Hash::hash(BranchKey, _state)
                                    },
                                    Materials::BeaconKey{BeaconKey, } => {
                                        Hash::hash(BeaconKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for Materials {
                            fn default() -> Materials {
                                Materials::Encryption {
                                    Encryption: Default::default()
                                }
                            }
                        }

                        impl AsRef<Materials>
                            for Materials {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1550,3)
                        #[derive(PartialEq, Clone)]
                        pub enum MultiThreadedCache {
                            MultiThreadedCache {
                                entryCapacity: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber,
                                entryPruningTailSize: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber>>
                            }
                        }

                        impl MultiThreadedCache {
                            /// Returns a borrow of the field entryCapacity
                            pub fn entryCapacity(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber {
                                match self {
                                    MultiThreadedCache::MultiThreadedCache{entryCapacity, entryPruningTailSize, } => entryCapacity,
                                }
                            }
                            /// Returns a borrow of the field entryPruningTailSize
                            pub fn entryPruningTailSize(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber>> {
                                match self {
                                    MultiThreadedCache::MultiThreadedCache{entryCapacity, entryPruningTailSize, } => entryPruningTailSize,
                                }
                            }
                        }

                        impl Debug
                            for MultiThreadedCache {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for MultiThreadedCache {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    MultiThreadedCache::MultiThreadedCache{entryCapacity, entryPruningTailSize, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.MultiThreadedCache.MultiThreadedCache(")?;
                                        DafnyPrint::fmt_print(entryCapacity, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(entryPruningTailSize, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for MultiThreadedCache {}

                        impl Hash
                            for MultiThreadedCache {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    MultiThreadedCache::MultiThreadedCache{entryCapacity, entryPruningTailSize, } => {
                                        Hash::hash(entryCapacity, _state);
                                        Hash::hash(entryPruningTailSize, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for MultiThreadedCache {
                            fn default() -> MultiThreadedCache {
                                MultiThreadedCache::MultiThreadedCache {
                                    entryCapacity: Default::default(),
                                    entryPruningTailSize: Default::default()
                                }
                            }
                        }

                        impl AsRef<MultiThreadedCache>
                            for MultiThreadedCache {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1554,3)
                        #[derive(PartialEq, Clone)]
                        pub enum NoCache {
                            NoCache {}
                        }

                        impl NoCache {}

                        impl Debug
                            for NoCache {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for NoCache {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    NoCache::NoCache{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.NoCache.NoCache")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl NoCache {
                            /// Enumerates all possible values of NoCache
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<NoCache>> {
                                seq![Arc::new(NoCache::NoCache {})].iter()
                            }
                        }

                        impl Eq
                            for NoCache {}

                        impl Hash
                            for NoCache {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    NoCache::NoCache{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for NoCache {
                            fn default() -> NoCache {
                                NoCache::NoCache {}
                            }
                        }

                        impl AsRef<NoCache>
                            for NoCache {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1557,3)
                        #[derive(PartialEq, Clone)]
                        pub enum None {
                            None {}
                        }

                        impl None {}

                        impl Debug
                            for None {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for None {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    None::None{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.None.None")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl None {
                            /// Enumerates all possible values of None
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<None>> {
                                seq![Arc::new(None::None {})].iter()
                            }
                        }

                        impl Eq
                            for None {}

                        impl Hash
                            for None {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    None::None{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for None {
                            fn default() -> None {
                                None::None {}
                            }
                        }

                        impl AsRef<None>
                            for None {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1560,3)
                        #[derive(PartialEq, Clone)]
                        pub enum OnDecryptInput {
                            OnDecryptInput {
                                materials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials>,
                                encryptedDataKeys: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey>>
                            }
                        }

                        impl OnDecryptInput {
                            /// Returns a borrow of the field materials
                            pub fn materials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials> {
                                match self {
                                    OnDecryptInput::OnDecryptInput{materials, encryptedDataKeys, } => materials,
                                }
                            }
                            /// Returns a borrow of the field encryptedDataKeys
                            pub fn encryptedDataKeys(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey>> {
                                match self {
                                    OnDecryptInput::OnDecryptInput{materials, encryptedDataKeys, } => encryptedDataKeys,
                                }
                            }
                        }

                        impl Debug
                            for OnDecryptInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for OnDecryptInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    OnDecryptInput::OnDecryptInput{materials, encryptedDataKeys, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptInput.OnDecryptInput(")?;
                                        DafnyPrint::fmt_print(materials, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(encryptedDataKeys, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for OnDecryptInput {}

                        impl Hash
                            for OnDecryptInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    OnDecryptInput::OnDecryptInput{materials, encryptedDataKeys, } => {
                                        Hash::hash(materials, _state);
                                        Hash::hash(encryptedDataKeys, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for OnDecryptInput {
                            fn default() -> OnDecryptInput {
                                OnDecryptInput::OnDecryptInput {
                                    materials: Default::default(),
                                    encryptedDataKeys: Default::default()
                                }
                            }
                        }

                        impl AsRef<OnDecryptInput>
                            for OnDecryptInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1564,3)
                        #[derive(PartialEq, Clone)]
                        pub enum OnDecryptOutput {
                            OnDecryptOutput {
                                materials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials>
                            }
                        }

                        impl OnDecryptOutput {
                            /// Returns a borrow of the field materials
                            pub fn materials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials> {
                                match self {
                                    OnDecryptOutput::OnDecryptOutput{materials, } => materials,
                                }
                            }
                        }

                        impl Debug
                            for OnDecryptOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for OnDecryptOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    OnDecryptOutput::OnDecryptOutput{materials, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.OnDecryptOutput.OnDecryptOutput(")?;
                                        DafnyPrint::fmt_print(materials, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for OnDecryptOutput {}

                        impl Hash
                            for OnDecryptOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    OnDecryptOutput::OnDecryptOutput{materials, } => {
                                        Hash::hash(materials, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for OnDecryptOutput {
                            fn default() -> OnDecryptOutput {
                                OnDecryptOutput::OnDecryptOutput {
                                    materials: Default::default()
                                }
                            }
                        }

                        impl AsRef<OnDecryptOutput>
                            for OnDecryptOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1567,3)
                        #[derive(PartialEq, Clone)]
                        pub enum OnEncryptInput {
                            OnEncryptInput {
                                materials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials>
                            }
                        }

                        impl OnEncryptInput {
                            /// Returns a borrow of the field materials
                            pub fn materials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials> {
                                match self {
                                    OnEncryptInput::OnEncryptInput{materials, } => materials,
                                }
                            }
                        }

                        impl Debug
                            for OnEncryptInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for OnEncryptInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    OnEncryptInput::OnEncryptInput{materials, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptInput.OnEncryptInput(")?;
                                        DafnyPrint::fmt_print(materials, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for OnEncryptInput {}

                        impl Hash
                            for OnEncryptInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    OnEncryptInput::OnEncryptInput{materials, } => {
                                        Hash::hash(materials, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for OnEncryptInput {
                            fn default() -> OnEncryptInput {
                                OnEncryptInput::OnEncryptInput {
                                    materials: Default::default()
                                }
                            }
                        }

                        impl AsRef<OnEncryptInput>
                            for OnEncryptInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1570,3)
                        #[derive(PartialEq, Clone)]
                        pub enum OnEncryptOutput {
                            OnEncryptOutput {
                                materials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials>
                            }
                        }

                        impl OnEncryptOutput {
                            /// Returns a borrow of the field materials
                            pub fn materials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials> {
                                match self {
                                    OnEncryptOutput::OnEncryptOutput{materials, } => materials,
                                }
                            }
                        }

                        impl Debug
                            for OnEncryptOutput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for OnEncryptOutput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    OnEncryptOutput::OnEncryptOutput{materials, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.OnEncryptOutput.OnEncryptOutput(")?;
                                        DafnyPrint::fmt_print(materials, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for OnEncryptOutput {}

                        impl Hash
                            for OnEncryptOutput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    OnEncryptOutput::OnEncryptOutput{materials, } => {
                                        Hash::hash(materials, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for OnEncryptOutput {
                            fn default() -> OnEncryptOutput {
                                OnEncryptOutput::OnEncryptOutput {
                                    materials: Default::default()
                                }
                            }
                        }

                        impl AsRef<OnEncryptOutput>
                            for OnEncryptOutput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1573,3)
                        #[derive(PartialEq, Clone)]
                        pub enum PaddingScheme {
                            PKCS1 {},
                            OAEP_SHA1_MGF1 {},
                            OAEP_SHA256_MGF1 {},
                            OAEP_SHA384_MGF1 {},
                            OAEP_SHA512_MGF1 {}
                        }

                        impl PaddingScheme {}

                        impl Debug
                            for PaddingScheme {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for PaddingScheme {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    PaddingScheme::PKCS1{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.PaddingScheme.PKCS1")?;
                                        Ok(())
                                    },
                                    PaddingScheme::OAEP_SHA1_MGF1{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.PaddingScheme.OAEP__SHA1__MGF1")?;
                                        Ok(())
                                    },
                                    PaddingScheme::OAEP_SHA256_MGF1{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.PaddingScheme.OAEP__SHA256__MGF1")?;
                                        Ok(())
                                    },
                                    PaddingScheme::OAEP_SHA384_MGF1{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.PaddingScheme.OAEP__SHA384__MGF1")?;
                                        Ok(())
                                    },
                                    PaddingScheme::OAEP_SHA512_MGF1{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.PaddingScheme.OAEP__SHA512__MGF1")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl PaddingScheme {
                            /// Enumerates all possible values of PaddingScheme
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<PaddingScheme>> {
                                seq![Arc::new(PaddingScheme::PKCS1 {}), Arc::new(PaddingScheme::OAEP_SHA1_MGF1 {}), Arc::new(PaddingScheme::OAEP_SHA256_MGF1 {}), Arc::new(PaddingScheme::OAEP_SHA384_MGF1 {}), Arc::new(PaddingScheme::OAEP_SHA512_MGF1 {})].iter()
                            }
                        }

                        impl Eq
                            for PaddingScheme {}

                        impl Hash
                            for PaddingScheme {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    PaddingScheme::PKCS1{} => {

                                    },
                                    PaddingScheme::OAEP_SHA1_MGF1{} => {

                                    },
                                    PaddingScheme::OAEP_SHA256_MGF1{} => {

                                    },
                                    PaddingScheme::OAEP_SHA384_MGF1{} => {

                                    },
                                    PaddingScheme::OAEP_SHA512_MGF1{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for PaddingScheme {
                            fn default() -> PaddingScheme {
                                PaddingScheme::PKCS1 {}
                            }
                        }

                        impl AsRef<PaddingScheme>
                            for PaddingScheme {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1579,3)
                        pub type PositiveInteger = i32;

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1583,3)
                        pub type PositiveLong = i64;

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1587,3)
                        #[derive(PartialEq, Clone)]
                        pub enum PublicKeyDiscoveryInput {
                            PublicKeyDiscoveryInput {
                                recipientStaticPrivateKey: Sequence<u8>
                            }
                        }

                        impl PublicKeyDiscoveryInput {
                            /// Returns a borrow of the field recipientStaticPrivateKey
                            pub fn recipientStaticPrivateKey(&self) -> &Sequence<u8> {
                                match self {
                                    PublicKeyDiscoveryInput::PublicKeyDiscoveryInput{recipientStaticPrivateKey, } => recipientStaticPrivateKey,
                                }
                            }
                        }

                        impl Debug
                            for PublicKeyDiscoveryInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for PublicKeyDiscoveryInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    PublicKeyDiscoveryInput::PublicKeyDiscoveryInput{recipientStaticPrivateKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.PublicKeyDiscoveryInput.PublicKeyDiscoveryInput(")?;
                                        DafnyPrint::fmt_print(recipientStaticPrivateKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for PublicKeyDiscoveryInput {}

                        impl Hash
                            for PublicKeyDiscoveryInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    PublicKeyDiscoveryInput::PublicKeyDiscoveryInput{recipientStaticPrivateKey, } => {
                                        Hash::hash(recipientStaticPrivateKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for PublicKeyDiscoveryInput {
                            fn default() -> PublicKeyDiscoveryInput {
                                PublicKeyDiscoveryInput::PublicKeyDiscoveryInput {
                                    recipientStaticPrivateKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<PublicKeyDiscoveryInput>
                            for PublicKeyDiscoveryInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1590,3)
                        #[derive(PartialEq, Clone)]
                        pub enum PutCacheEntryInput {
                            PutCacheEntryInput {
                                identifier: Sequence<u8>,
                                materials: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Materials>,
                                creationTime: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong,
                                expiryTime: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong,
                                messagesUsed: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger>>,
                                bytesUsed: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger>>
                            }
                        }

                        impl PutCacheEntryInput {
                            /// Returns a borrow of the field identifier
                            pub fn identifier(&self) -> &Sequence<u8> {
                                match self {
                                    PutCacheEntryInput::PutCacheEntryInput{identifier, materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => identifier,
                                }
                            }
                            /// Returns a borrow of the field materials
                            pub fn materials(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Materials> {
                                match self {
                                    PutCacheEntryInput::PutCacheEntryInput{identifier, materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => materials,
                                }
                            }
                            /// Returns a borrow of the field creationTime
                            pub fn creationTime(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong {
                                match self {
                                    PutCacheEntryInput::PutCacheEntryInput{identifier, materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => creationTime,
                                }
                            }
                            /// Returns a borrow of the field expiryTime
                            pub fn expiryTime(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong {
                                match self {
                                    PutCacheEntryInput::PutCacheEntryInput{identifier, materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => expiryTime,
                                }
                            }
                            /// Returns a borrow of the field messagesUsed
                            pub fn messagesUsed(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger>> {
                                match self {
                                    PutCacheEntryInput::PutCacheEntryInput{identifier, materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => messagesUsed,
                                }
                            }
                            /// Returns a borrow of the field bytesUsed
                            pub fn bytesUsed(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger>> {
                                match self {
                                    PutCacheEntryInput::PutCacheEntryInput{identifier, materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => bytesUsed,
                                }
                            }
                        }

                        impl Debug
                            for PutCacheEntryInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for PutCacheEntryInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    PutCacheEntryInput::PutCacheEntryInput{identifier, materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.PutCacheEntryInput.PutCacheEntryInput(")?;
                                        DafnyPrint::fmt_print(identifier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(materials, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(creationTime, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(expiryTime, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(messagesUsed, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(bytesUsed, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for PutCacheEntryInput {}

                        impl Hash
                            for PutCacheEntryInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    PutCacheEntryInput::PutCacheEntryInput{identifier, materials, creationTime, expiryTime, messagesUsed, bytesUsed, } => {
                                        Hash::hash(identifier, _state);
                                        Hash::hash(materials, _state);
                                        Hash::hash(creationTime, _state);
                                        Hash::hash(expiryTime, _state);
                                        Hash::hash(messagesUsed, _state);
                                        Hash::hash(bytesUsed, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for PutCacheEntryInput {
                            fn default() -> PutCacheEntryInput {
                                PutCacheEntryInput::PutCacheEntryInput {
                                    identifier: Default::default(),
                                    materials: Default::default(),
                                    creationTime: Default::default(),
                                    expiryTime: Default::default(),
                                    messagesUsed: Default::default(),
                                    bytesUsed: Default::default()
                                }
                            }
                        }

                        impl AsRef<PutCacheEntryInput>
                            for PutCacheEntryInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1598,3)
                        #[derive(PartialEq, Clone)]
                        pub enum RawEcdhStaticConfigurations {
                            PublicKeyDiscovery {
                                PublicKeyDiscovery: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PublicKeyDiscoveryInput>
                            },
                            RawPrivateKeyToStaticPublicKey {
                                RawPrivateKeyToStaticPublicKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawPrivateKeyToStaticPublicKeyInput>
                            },
                            EphemeralPrivateKeyToStaticPublicKey {
                                EphemeralPrivateKeyToStaticPublicKey: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EphemeralPrivateKeyToStaticPublicKeyInput>
                            }
                        }

                        impl RawEcdhStaticConfigurations {
                            /// Gets the field PublicKeyDiscovery for all enum members which have it
                            pub fn PublicKeyDiscovery(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PublicKeyDiscoveryInput> {
                                match self {
                                    RawEcdhStaticConfigurations::PublicKeyDiscovery{PublicKeyDiscovery, } => PublicKeyDiscovery,
                                    RawEcdhStaticConfigurations::RawPrivateKeyToStaticPublicKey{RawPrivateKeyToStaticPublicKey, } => panic!("field does not exist on this variant"),
                                    RawEcdhStaticConfigurations::EphemeralPrivateKeyToStaticPublicKey{EphemeralPrivateKeyToStaticPublicKey, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field RawPrivateKeyToStaticPublicKey for all enum members which have it
                            pub fn RawPrivateKeyToStaticPublicKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawPrivateKeyToStaticPublicKeyInput> {
                                match self {
                                    RawEcdhStaticConfigurations::PublicKeyDiscovery{PublicKeyDiscovery, } => panic!("field does not exist on this variant"),
                                    RawEcdhStaticConfigurations::RawPrivateKeyToStaticPublicKey{RawPrivateKeyToStaticPublicKey, } => RawPrivateKeyToStaticPublicKey,
                                    RawEcdhStaticConfigurations::EphemeralPrivateKeyToStaticPublicKey{EphemeralPrivateKeyToStaticPublicKey, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field EphemeralPrivateKeyToStaticPublicKey for all enum members which have it
                            pub fn EphemeralPrivateKeyToStaticPublicKey(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EphemeralPrivateKeyToStaticPublicKeyInput> {
                                match self {
                                    RawEcdhStaticConfigurations::PublicKeyDiscovery{PublicKeyDiscovery, } => panic!("field does not exist on this variant"),
                                    RawEcdhStaticConfigurations::RawPrivateKeyToStaticPublicKey{RawPrivateKeyToStaticPublicKey, } => panic!("field does not exist on this variant"),
                                    RawEcdhStaticConfigurations::EphemeralPrivateKeyToStaticPublicKey{EphemeralPrivateKeyToStaticPublicKey, } => EphemeralPrivateKeyToStaticPublicKey,
                                }
                            }
                        }

                        impl Debug
                            for RawEcdhStaticConfigurations {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for RawEcdhStaticConfigurations {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    RawEcdhStaticConfigurations::PublicKeyDiscovery{PublicKeyDiscovery, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.RawEcdhStaticConfigurations.PublicKeyDiscovery(")?;
                                        DafnyPrint::fmt_print(PublicKeyDiscovery, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    RawEcdhStaticConfigurations::RawPrivateKeyToStaticPublicKey{RawPrivateKeyToStaticPublicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.RawEcdhStaticConfigurations.RawPrivateKeyToStaticPublicKey(")?;
                                        DafnyPrint::fmt_print(RawPrivateKeyToStaticPublicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    RawEcdhStaticConfigurations::EphemeralPrivateKeyToStaticPublicKey{EphemeralPrivateKeyToStaticPublicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.RawEcdhStaticConfigurations.EphemeralPrivateKeyToStaticPublicKey(")?;
                                        DafnyPrint::fmt_print(EphemeralPrivateKeyToStaticPublicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for RawEcdhStaticConfigurations {}

                        impl Hash
                            for RawEcdhStaticConfigurations {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    RawEcdhStaticConfigurations::PublicKeyDiscovery{PublicKeyDiscovery, } => {
                                        Hash::hash(PublicKeyDiscovery, _state)
                                    },
                                    RawEcdhStaticConfigurations::RawPrivateKeyToStaticPublicKey{RawPrivateKeyToStaticPublicKey, } => {
                                        Hash::hash(RawPrivateKeyToStaticPublicKey, _state)
                                    },
                                    RawEcdhStaticConfigurations::EphemeralPrivateKeyToStaticPublicKey{EphemeralPrivateKeyToStaticPublicKey, } => {
                                        Hash::hash(EphemeralPrivateKeyToStaticPublicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for RawEcdhStaticConfigurations {
                            fn default() -> RawEcdhStaticConfigurations {
                                RawEcdhStaticConfigurations::PublicKeyDiscovery {
                                    PublicKeyDiscovery: Default::default()
                                }
                            }
                        }

                        impl AsRef<RawEcdhStaticConfigurations>
                            for RawEcdhStaticConfigurations {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1602,3)
                        #[derive(PartialEq, Clone)]
                        pub enum RawPrivateKeyToStaticPublicKeyInput {
                            RawPrivateKeyToStaticPublicKeyInput {
                                senderStaticPrivateKey: Sequence<u8>,
                                recipientPublicKey: Sequence<u8>
                            }
                        }

                        impl RawPrivateKeyToStaticPublicKeyInput {
                            /// Returns a borrow of the field senderStaticPrivateKey
                            pub fn senderStaticPrivateKey(&self) -> &Sequence<u8> {
                                match self {
                                    RawPrivateKeyToStaticPublicKeyInput::RawPrivateKeyToStaticPublicKeyInput{senderStaticPrivateKey, recipientPublicKey, } => senderStaticPrivateKey,
                                }
                            }
                            /// Returns a borrow of the field recipientPublicKey
                            pub fn recipientPublicKey(&self) -> &Sequence<u8> {
                                match self {
                                    RawPrivateKeyToStaticPublicKeyInput::RawPrivateKeyToStaticPublicKeyInput{senderStaticPrivateKey, recipientPublicKey, } => recipientPublicKey,
                                }
                            }
                        }

                        impl Debug
                            for RawPrivateKeyToStaticPublicKeyInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for RawPrivateKeyToStaticPublicKeyInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    RawPrivateKeyToStaticPublicKeyInput::RawPrivateKeyToStaticPublicKeyInput{senderStaticPrivateKey, recipientPublicKey, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.RawPrivateKeyToStaticPublicKeyInput.RawPrivateKeyToStaticPublicKeyInput(")?;
                                        DafnyPrint::fmt_print(senderStaticPrivateKey, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(recipientPublicKey, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for RawPrivateKeyToStaticPublicKeyInput {}

                        impl Hash
                            for RawPrivateKeyToStaticPublicKeyInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    RawPrivateKeyToStaticPublicKeyInput::RawPrivateKeyToStaticPublicKeyInput{senderStaticPrivateKey, recipientPublicKey, } => {
                                        Hash::hash(senderStaticPrivateKey, _state);
                                        Hash::hash(recipientPublicKey, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for RawPrivateKeyToStaticPublicKeyInput {
                            fn default() -> RawPrivateKeyToStaticPublicKeyInput {
                                RawPrivateKeyToStaticPublicKeyInput::RawPrivateKeyToStaticPublicKeyInput {
                                    senderStaticPrivateKey: Default::default(),
                                    recipientPublicKey: Default::default()
                                }
                            }
                        }

                        impl AsRef<RawPrivateKeyToStaticPublicKeyInput>
                            for RawPrivateKeyToStaticPublicKeyInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1609,3)
                        #[derive(PartialEq, Clone)]
                        pub enum SignatureAlgorithm {
                            ECDSA {
                                ECDSA: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ECDSA>
                            },
                            None {
                                _None: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None>
                            }
                        }

                        impl SignatureAlgorithm {
                            /// Gets the field ECDSA for all enum members which have it
                            pub fn ECDSA(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ECDSA> {
                                match self {
                                    SignatureAlgorithm::ECDSA{ECDSA, } => ECDSA,
                                    SignatureAlgorithm::None{_None, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field _None for all enum members which have it
                            pub fn _None(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None> {
                                match self {
                                    SignatureAlgorithm::ECDSA{ECDSA, } => panic!("field does not exist on this variant"),
                                    SignatureAlgorithm::None{_None, } => _None,
                                }
                            }
                        }

                        impl Debug
                            for SignatureAlgorithm {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for SignatureAlgorithm {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    SignatureAlgorithm::ECDSA{ECDSA, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.SignatureAlgorithm.ECDSA(")?;
                                        DafnyPrint::fmt_print(ECDSA, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    SignatureAlgorithm::None{_None, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.SignatureAlgorithm.None(")?;
                                        DafnyPrint::fmt_print(_None, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for SignatureAlgorithm {}

                        impl Hash
                            for SignatureAlgorithm {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    SignatureAlgorithm::ECDSA{ECDSA, } => {
                                        Hash::hash(ECDSA, _state)
                                    },
                                    SignatureAlgorithm::None{_None, } => {
                                        Hash::hash(_None, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for SignatureAlgorithm {
                            fn default() -> SignatureAlgorithm {
                                SignatureAlgorithm::ECDSA {
                                    ECDSA: Default::default()
                                }
                            }
                        }

                        impl AsRef<SignatureAlgorithm>
                            for SignatureAlgorithm {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1612,3)
                        #[derive(PartialEq, Clone)]
                        pub enum SingleThreadedCache {
                            SingleThreadedCache {
                                entryCapacity: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber,
                                entryPruningTailSize: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber>>
                            }
                        }

                        impl SingleThreadedCache {
                            /// Returns a borrow of the field entryCapacity
                            pub fn entryCapacity(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber {
                                match self {
                                    SingleThreadedCache::SingleThreadedCache{entryCapacity, entryPruningTailSize, } => entryCapacity,
                                }
                            }
                            /// Returns a borrow of the field entryPruningTailSize
                            pub fn entryPruningTailSize(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber>> {
                                match self {
                                    SingleThreadedCache::SingleThreadedCache{entryCapacity, entryPruningTailSize, } => entryPruningTailSize,
                                }
                            }
                        }

                        impl Debug
                            for SingleThreadedCache {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for SingleThreadedCache {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    SingleThreadedCache::SingleThreadedCache{entryCapacity, entryPruningTailSize, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.SingleThreadedCache.SingleThreadedCache(")?;
                                        DafnyPrint::fmt_print(entryCapacity, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(entryPruningTailSize, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for SingleThreadedCache {}

                        impl Hash
                            for SingleThreadedCache {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    SingleThreadedCache::SingleThreadedCache{entryCapacity, entryPruningTailSize, } => {
                                        Hash::hash(entryCapacity, _state);
                                        Hash::hash(entryPruningTailSize, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for SingleThreadedCache {
                            fn default() -> SingleThreadedCache {
                                SingleThreadedCache::SingleThreadedCache {
                                    entryCapacity: Default::default(),
                                    entryPruningTailSize: Default::default()
                                }
                            }
                        }

                        impl AsRef<SingleThreadedCache>
                            for SingleThreadedCache {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1616,3)
                        #[derive(PartialEq, Clone)]
                        pub enum StaticConfigurations {
                            AWS_KMS_ECDH {
                                AWS_KMS_ECDH: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsEcdhStaticConfigurations>
                            },
                            RAW_ECDH {
                                RAW_ECDH: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations>
                            }
                        }

                        impl StaticConfigurations {
                            /// Gets the field AWS_KMS_ECDH for all enum members which have it
                            pub fn AWS_KMS_ECDH(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsEcdhStaticConfigurations> {
                                match self {
                                    StaticConfigurations::AWS_KMS_ECDH{AWS_KMS_ECDH, } => AWS_KMS_ECDH,
                                    StaticConfigurations::RAW_ECDH{RAW_ECDH, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field RAW_ECDH for all enum members which have it
                            pub fn RAW_ECDH(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations> {
                                match self {
                                    StaticConfigurations::AWS_KMS_ECDH{AWS_KMS_ECDH, } => panic!("field does not exist on this variant"),
                                    StaticConfigurations::RAW_ECDH{RAW_ECDH, } => RAW_ECDH,
                                }
                            }
                        }

                        impl Debug
                            for StaticConfigurations {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for StaticConfigurations {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    StaticConfigurations::AWS_KMS_ECDH{AWS_KMS_ECDH, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.StaticConfigurations.AWS__KMS__ECDH(")?;
                                        DafnyPrint::fmt_print(AWS_KMS_ECDH, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    StaticConfigurations::RAW_ECDH{RAW_ECDH, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.StaticConfigurations.RAW__ECDH(")?;
                                        DafnyPrint::fmt_print(RAW_ECDH, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for StaticConfigurations {}

                        impl Hash
                            for StaticConfigurations {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    StaticConfigurations::AWS_KMS_ECDH{AWS_KMS_ECDH, } => {
                                        Hash::hash(AWS_KMS_ECDH, _state)
                                    },
                                    StaticConfigurations::RAW_ECDH{RAW_ECDH, } => {
                                        Hash::hash(RAW_ECDH, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for StaticConfigurations {
                            fn default() -> StaticConfigurations {
                                StaticConfigurations::AWS_KMS_ECDH {
                                    AWS_KMS_ECDH: Default::default()
                                }
                            }
                        }

                        impl AsRef<StaticConfigurations>
                            for StaticConfigurations {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1619,3)
                        #[derive(PartialEq, Clone)]
                        pub enum StormTrackingCache {
                            StormTrackingCache {
                                entryCapacity: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber,
                                entryPruningTailSize: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber>>,
                                gracePeriod: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber,
                                graceInterval: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber,
                                fanOut: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber,
                                inFlightTTL: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber,
                                sleepMilli: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber,
                                timeUnits: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::TimeUnits>>>
                            }
                        }

                        impl StormTrackingCache {
                            /// Returns a borrow of the field entryCapacity
                            pub fn entryCapacity(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber {
                                match self {
                                    StormTrackingCache::StormTrackingCache{entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli, timeUnits, } => entryCapacity,
                                }
                            }
                            /// Returns a borrow of the field entryPruningTailSize
                            pub fn entryPruningTailSize(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber>> {
                                match self {
                                    StormTrackingCache::StormTrackingCache{entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli, timeUnits, } => entryPruningTailSize,
                                }
                            }
                            /// Returns a borrow of the field gracePeriod
                            pub fn gracePeriod(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber {
                                match self {
                                    StormTrackingCache::StormTrackingCache{entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli, timeUnits, } => gracePeriod,
                                }
                            }
                            /// Returns a borrow of the field graceInterval
                            pub fn graceInterval(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber {
                                match self {
                                    StormTrackingCache::StormTrackingCache{entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli, timeUnits, } => graceInterval,
                                }
                            }
                            /// Returns a borrow of the field fanOut
                            pub fn fanOut(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber {
                                match self {
                                    StormTrackingCache::StormTrackingCache{entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli, timeUnits, } => fanOut,
                                }
                            }
                            /// Returns a borrow of the field inFlightTTL
                            pub fn inFlightTTL(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber {
                                match self {
                                    StormTrackingCache::StormTrackingCache{entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli, timeUnits, } => inFlightTTL,
                                }
                            }
                            /// Returns a borrow of the field sleepMilli
                            pub fn sleepMilli(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber {
                                match self {
                                    StormTrackingCache::StormTrackingCache{entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli, timeUnits, } => sleepMilli,
                                }
                            }
                            /// Returns a borrow of the field timeUnits
                            pub fn timeUnits(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::TimeUnits>>> {
                                match self {
                                    StormTrackingCache::StormTrackingCache{entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli, timeUnits, } => timeUnits,
                                }
                            }
                        }

                        impl Debug
                            for StormTrackingCache {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for StormTrackingCache {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    StormTrackingCache::StormTrackingCache{entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli, timeUnits, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.StormTrackingCache.StormTrackingCache(")?;
                                        DafnyPrint::fmt_print(entryCapacity, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(entryPruningTailSize, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(gracePeriod, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(graceInterval, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(fanOut, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(inFlightTTL, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(sleepMilli, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(timeUnits, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for StormTrackingCache {}

                        impl Hash
                            for StormTrackingCache {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    StormTrackingCache::StormTrackingCache{entryCapacity, entryPruningTailSize, gracePeriod, graceInterval, fanOut, inFlightTTL, sleepMilli, timeUnits, } => {
                                        Hash::hash(entryCapacity, _state);
                                        Hash::hash(entryPruningTailSize, _state);
                                        Hash::hash(gracePeriod, _state);
                                        Hash::hash(graceInterval, _state);
                                        Hash::hash(fanOut, _state);
                                        Hash::hash(inFlightTTL, _state);
                                        Hash::hash(sleepMilli, _state);
                                        Hash::hash(timeUnits, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for StormTrackingCache {
                            fn default() -> StormTrackingCache {
                                StormTrackingCache::StormTrackingCache {
                                    entryCapacity: Default::default(),
                                    entryPruningTailSize: Default::default(),
                                    gracePeriod: Default::default(),
                                    graceInterval: Default::default(),
                                    fanOut: Default::default(),
                                    inFlightTTL: Default::default(),
                                    sleepMilli: Default::default(),
                                    timeUnits: Default::default()
                                }
                            }
                        }

                        impl AsRef<StormTrackingCache>
                            for StormTrackingCache {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1629,3)
                        #[derive(PartialEq, Clone)]
                        pub enum SymmetricSignatureAlgorithm {
                            HMAC {
                                HMAC: Arc<DigestAlgorithm>
                            },
                            None {
                                _None: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None>
                            }
                        }

                        impl SymmetricSignatureAlgorithm {
                            /// Gets the field HMAC for all enum members which have it
                            pub fn HMAC(&self) -> &Arc<DigestAlgorithm> {
                                match self {
                                    SymmetricSignatureAlgorithm::HMAC{HMAC, } => HMAC,
                                    SymmetricSignatureAlgorithm::None{_None, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field _None for all enum members which have it
                            pub fn _None(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None> {
                                match self {
                                    SymmetricSignatureAlgorithm::HMAC{HMAC, } => panic!("field does not exist on this variant"),
                                    SymmetricSignatureAlgorithm::None{_None, } => _None,
                                }
                            }
                        }

                        impl Debug
                            for SymmetricSignatureAlgorithm {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for SymmetricSignatureAlgorithm {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    SymmetricSignatureAlgorithm::HMAC{HMAC, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.SymmetricSignatureAlgorithm.HMAC(")?;
                                        DafnyPrint::fmt_print(HMAC, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    SymmetricSignatureAlgorithm::None{_None, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.SymmetricSignatureAlgorithm.None(")?;
                                        DafnyPrint::fmt_print(_None, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for SymmetricSignatureAlgorithm {}

                        impl Hash
                            for SymmetricSignatureAlgorithm {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    SymmetricSignatureAlgorithm::HMAC{HMAC, } => {
                                        Hash::hash(HMAC, _state)
                                    },
                                    SymmetricSignatureAlgorithm::None{_None, } => {
                                        Hash::hash(_None, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for SymmetricSignatureAlgorithm {
                            fn default() -> SymmetricSignatureAlgorithm {
                                SymmetricSignatureAlgorithm::HMAC {
                                    HMAC: Default::default()
                                }
                            }
                        }

                        impl AsRef<SymmetricSignatureAlgorithm>
                            for SymmetricSignatureAlgorithm {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1633,3)
                        #[derive(PartialEq, Clone)]
                        pub enum TimeUnits {
                            Seconds {},
                            Milliseconds {}
                        }

                        impl TimeUnits {}

                        impl Debug
                            for TimeUnits {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for TimeUnits {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    TimeUnits::Seconds{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.TimeUnits.Seconds")?;
                                        Ok(())
                                    },
                                    TimeUnits::Milliseconds{} => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.TimeUnits.Milliseconds")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl TimeUnits {
                            /// Enumerates all possible values of TimeUnits
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<TimeUnits>> {
                                seq![Arc::new(TimeUnits::Seconds {}), Arc::new(TimeUnits::Milliseconds {})].iter()
                            }
                        }

                        impl Eq
                            for TimeUnits {}

                        impl Hash
                            for TimeUnits {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    TimeUnits::Seconds{} => {

                                    },
                                    TimeUnits::Milliseconds{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for TimeUnits {
                            fn default() -> TimeUnits {
                                TimeUnits::Seconds {}
                            }
                        }

                        impl AsRef<TimeUnits>
                            for TimeUnits {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1636,3)
                        #[derive(PartialEq, Clone)]
                        pub enum UpdateUsageMetadataInput {
                            UpdateUsageMetadataInput {
                                identifier: Sequence<u8>,
                                bytesUsed: crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger
                            }
                        }

                        impl UpdateUsageMetadataInput {
                            /// Returns a borrow of the field identifier
                            pub fn identifier(&self) -> &Sequence<u8> {
                                match self {
                                    UpdateUsageMetadataInput::UpdateUsageMetadataInput{identifier, bytesUsed, } => identifier,
                                }
                            }
                            /// Returns a borrow of the field bytesUsed
                            pub fn bytesUsed(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger {
                                match self {
                                    UpdateUsageMetadataInput::UpdateUsageMetadataInput{identifier, bytesUsed, } => bytesUsed,
                                }
                            }
                        }

                        impl Debug
                            for UpdateUsageMetadataInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for UpdateUsageMetadataInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    UpdateUsageMetadataInput::UpdateUsageMetadataInput{identifier, bytesUsed, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.UpdateUsageMetadataInput.UpdateUsageMetadataInput(")?;
                                        DafnyPrint::fmt_print(identifier, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(bytesUsed, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for UpdateUsageMetadataInput {}

                        impl Hash
                            for UpdateUsageMetadataInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    UpdateUsageMetadataInput::UpdateUsageMetadataInput{identifier, bytesUsed, } => {
                                        Hash::hash(identifier, _state);
                                        Hash::hash(bytesUsed, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for UpdateUsageMetadataInput {
                            fn default() -> UpdateUsageMetadataInput {
                                UpdateUsageMetadataInput::UpdateUsageMetadataInput {
                                    identifier: Default::default(),
                                    bytesUsed: Default::default()
                                }
                            }
                        }

                        impl AsRef<UpdateUsageMetadataInput>
                            for UpdateUsageMetadataInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1641,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ValidateCommitmentPolicyOnDecryptInput {
                            ValidateCommitmentPolicyOnDecryptInput {
                                algorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId>,
                                commitmentPolicy: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy>
                            }
                        }

                        impl ValidateCommitmentPolicyOnDecryptInput {
                            /// Returns a borrow of the field algorithm
                            pub fn algorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId> {
                                match self {
                                    ValidateCommitmentPolicyOnDecryptInput::ValidateCommitmentPolicyOnDecryptInput{algorithm, commitmentPolicy, } => algorithm,
                                }
                            }
                            /// Returns a borrow of the field commitmentPolicy
                            pub fn commitmentPolicy(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy> {
                                match self {
                                    ValidateCommitmentPolicyOnDecryptInput::ValidateCommitmentPolicyOnDecryptInput{algorithm, commitmentPolicy, } => commitmentPolicy,
                                }
                            }
                        }

                        impl Debug
                            for ValidateCommitmentPolicyOnDecryptInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ValidateCommitmentPolicyOnDecryptInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ValidateCommitmentPolicyOnDecryptInput::ValidateCommitmentPolicyOnDecryptInput{algorithm, commitmentPolicy, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ValidateCommitmentPolicyOnDecryptInput.ValidateCommitmentPolicyOnDecryptInput(")?;
                                        DafnyPrint::fmt_print(algorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(commitmentPolicy, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ValidateCommitmentPolicyOnDecryptInput {}

                        impl Hash
                            for ValidateCommitmentPolicyOnDecryptInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ValidateCommitmentPolicyOnDecryptInput::ValidateCommitmentPolicyOnDecryptInput{algorithm, commitmentPolicy, } => {
                                        Hash::hash(algorithm, _state);
                                        Hash::hash(commitmentPolicy, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ValidateCommitmentPolicyOnDecryptInput {
                            fn default() -> ValidateCommitmentPolicyOnDecryptInput {
                                ValidateCommitmentPolicyOnDecryptInput::ValidateCommitmentPolicyOnDecryptInput {
                                    algorithm: Default::default(),
                                    commitmentPolicy: Default::default()
                                }
                            }
                        }

                        impl AsRef<ValidateCommitmentPolicyOnDecryptInput>
                            for ValidateCommitmentPolicyOnDecryptInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1645,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ValidateCommitmentPolicyOnEncryptInput {
                            ValidateCommitmentPolicyOnEncryptInput {
                                algorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId>,
                                commitmentPolicy: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy>
                            }
                        }

                        impl ValidateCommitmentPolicyOnEncryptInput {
                            /// Returns a borrow of the field algorithm
                            pub fn algorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId> {
                                match self {
                                    ValidateCommitmentPolicyOnEncryptInput::ValidateCommitmentPolicyOnEncryptInput{algorithm, commitmentPolicy, } => algorithm,
                                }
                            }
                            /// Returns a borrow of the field commitmentPolicy
                            pub fn commitmentPolicy(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy> {
                                match self {
                                    ValidateCommitmentPolicyOnEncryptInput::ValidateCommitmentPolicyOnEncryptInput{algorithm, commitmentPolicy, } => commitmentPolicy,
                                }
                            }
                        }

                        impl Debug
                            for ValidateCommitmentPolicyOnEncryptInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ValidateCommitmentPolicyOnEncryptInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ValidateCommitmentPolicyOnEncryptInput::ValidateCommitmentPolicyOnEncryptInput{algorithm, commitmentPolicy, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ValidateCommitmentPolicyOnEncryptInput.ValidateCommitmentPolicyOnEncryptInput(")?;
                                        DafnyPrint::fmt_print(algorithm, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(commitmentPolicy, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ValidateCommitmentPolicyOnEncryptInput {}

                        impl Hash
                            for ValidateCommitmentPolicyOnEncryptInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ValidateCommitmentPolicyOnEncryptInput::ValidateCommitmentPolicyOnEncryptInput{algorithm, commitmentPolicy, } => {
                                        Hash::hash(algorithm, _state);
                                        Hash::hash(commitmentPolicy, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ValidateCommitmentPolicyOnEncryptInput {
                            fn default() -> ValidateCommitmentPolicyOnEncryptInput {
                                ValidateCommitmentPolicyOnEncryptInput::ValidateCommitmentPolicyOnEncryptInput {
                                    algorithm: Default::default(),
                                    commitmentPolicy: Default::default()
                                }
                            }
                        }

                        impl AsRef<ValidateCommitmentPolicyOnEncryptInput>
                            for ValidateCommitmentPolicyOnEncryptInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1649,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ValidDecryptionMaterialsTransitionInput {
                            ValidDecryptionMaterialsTransitionInput {
                                start: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials>,
                                stop: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials>
                            }
                        }

                        impl ValidDecryptionMaterialsTransitionInput {
                            /// Returns a borrow of the field start
                            pub fn start(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials> {
                                match self {
                                    ValidDecryptionMaterialsTransitionInput::ValidDecryptionMaterialsTransitionInput{start, stop, } => start,
                                }
                            }
                            /// Returns a borrow of the field stop
                            pub fn stop(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials> {
                                match self {
                                    ValidDecryptionMaterialsTransitionInput::ValidDecryptionMaterialsTransitionInput{start, stop, } => stop,
                                }
                            }
                        }

                        impl Debug
                            for ValidDecryptionMaterialsTransitionInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ValidDecryptionMaterialsTransitionInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ValidDecryptionMaterialsTransitionInput::ValidDecryptionMaterialsTransitionInput{start, stop, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ValidDecryptionMaterialsTransitionInput.ValidDecryptionMaterialsTransitionInput(")?;
                                        DafnyPrint::fmt_print(start, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(stop, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ValidDecryptionMaterialsTransitionInput {}

                        impl Hash
                            for ValidDecryptionMaterialsTransitionInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ValidDecryptionMaterialsTransitionInput::ValidDecryptionMaterialsTransitionInput{start, stop, } => {
                                        Hash::hash(start, _state);
                                        Hash::hash(stop, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ValidDecryptionMaterialsTransitionInput {
                            fn default() -> ValidDecryptionMaterialsTransitionInput {
                                ValidDecryptionMaterialsTransitionInput::ValidDecryptionMaterialsTransitionInput {
                                    start: Default::default(),
                                    stop: Default::default()
                                }
                            }
                        }

                        impl AsRef<ValidDecryptionMaterialsTransitionInput>
                            for ValidDecryptionMaterialsTransitionInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1653,3)
                        #[derive(PartialEq, Clone)]
                        pub enum ValidEncryptionMaterialsTransitionInput {
                            ValidEncryptionMaterialsTransitionInput {
                                start: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials>,
                                stop: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials>
                            }
                        }

                        impl ValidEncryptionMaterialsTransitionInput {
                            /// Returns a borrow of the field start
                            pub fn start(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials> {
                                match self {
                                    ValidEncryptionMaterialsTransitionInput::ValidEncryptionMaterialsTransitionInput{start, stop, } => start,
                                }
                            }
                            /// Returns a borrow of the field stop
                            pub fn stop(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials> {
                                match self {
                                    ValidEncryptionMaterialsTransitionInput::ValidEncryptionMaterialsTransitionInput{start, stop, } => stop,
                                }
                            }
                        }

                        impl Debug
                            for ValidEncryptionMaterialsTransitionInput {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for ValidEncryptionMaterialsTransitionInput {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    ValidEncryptionMaterialsTransitionInput::ValidEncryptionMaterialsTransitionInput{start, stop, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.ValidEncryptionMaterialsTransitionInput.ValidEncryptionMaterialsTransitionInput(")?;
                                        DafnyPrint::fmt_print(start, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(stop, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for ValidEncryptionMaterialsTransitionInput {}

                        impl Hash
                            for ValidEncryptionMaterialsTransitionInput {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    ValidEncryptionMaterialsTransitionInput::ValidEncryptionMaterialsTransitionInput{start, stop, } => {
                                        Hash::hash(start, _state);
                                        Hash::hash(stop, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for ValidEncryptionMaterialsTransitionInput {
                            fn default() -> ValidEncryptionMaterialsTransitionInput {
                                ValidEncryptionMaterialsTransitionInput::ValidEncryptionMaterialsTransitionInput {
                                    start: Default::default(),
                                    stop: Default::default()
                                }
                            }
                        }

                        impl AsRef<ValidEncryptionMaterialsTransitionInput>
                            for ValidEncryptionMaterialsTransitionInput {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1657,3)
                        #[derive(PartialEq, Clone)]
                        pub enum Error {
                            AwsCryptographicMaterialProvidersException {
                                message: Sequence<DafnyCharUTF16>
                            },
                            EntryAlreadyExists {
                                message: Sequence<DafnyCharUTF16>
                            },
                            EntryDoesNotExist {
                                message: Sequence<DafnyCharUTF16>
                            },
                            InFlightTTLExceeded {
                                message: Sequence<DafnyCharUTF16>
                            },
                            InvalidAlgorithmSuiteInfo {
                                message: Sequence<DafnyCharUTF16>
                            },
                            InvalidAlgorithmSuiteInfoOnDecrypt {
                                message: Sequence<DafnyCharUTF16>
                            },
                            InvalidAlgorithmSuiteInfoOnEncrypt {
                                message: Sequence<DafnyCharUTF16>
                            },
                            InvalidDecryptionMaterials {
                                message: Sequence<DafnyCharUTF16>
                            },
                            InvalidDecryptionMaterialsTransition {
                                message: Sequence<DafnyCharUTF16>
                            },
                            InvalidEncryptionMaterials {
                                message: Sequence<DafnyCharUTF16>
                            },
                            InvalidEncryptionMaterialsTransition {
                                message: Sequence<DafnyCharUTF16>
                            },
                            AwsCryptographyKeyStore {
                                AwsCryptographyKeyStore: Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>
                            },
                            AwsCryptographyPrimitives {
                                AwsCryptographyPrimitives: Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>
                            },
                            ComAmazonawsDynamodb {
                                ComAmazonawsDynamodb: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>
                            },
                            ComAmazonawsKms {
                                ComAmazonawsKms: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>
                            },
                            CollectionOfErrors {
                                list: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>,
                                message: Sequence<DafnyCharUTF16>
                            },
                            Opaque {
                                obj: Object<dyn Any + Sync + Send>
                            },
                            OpaqueWithText {
                                obj: Object<dyn Any + Sync + Send>,
                                objMessage: Sequence<DafnyCharUTF16>
                            }
                        }

                        impl Error {
                            /// Gets the field message for all enum members which have it
                            pub fn message(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    Error::AwsCryptographicMaterialProvidersException{message, } => message,
                                    Error::EntryAlreadyExists{message, } => message,
                                    Error::EntryDoesNotExist{message, } => message,
                                    Error::InFlightTTLExceeded{message, } => message,
                                    Error::InvalidAlgorithmSuiteInfo{message, } => message,
                                    Error::InvalidAlgorithmSuiteInfoOnDecrypt{message, } => message,
                                    Error::InvalidAlgorithmSuiteInfoOnEncrypt{message, } => message,
                                    Error::InvalidDecryptionMaterials{message, } => message,
                                    Error::InvalidDecryptionMaterialsTransition{message, } => message,
                                    Error::InvalidEncryptionMaterials{message, } => message,
                                    Error::InvalidEncryptionMaterialsTransition{message, } => message,
                                    Error::AwsCryptographyKeyStore{AwsCryptographyKeyStore, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => message,
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field AwsCryptographyKeyStore for all enum members which have it
                            pub fn AwsCryptographyKeyStore(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error> {
                                match self {
                                    Error::AwsCryptographicMaterialProvidersException{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryAlreadyExists{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryDoesNotExist{message, } => panic!("field does not exist on this variant"),
                                    Error::InFlightTTLExceeded{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfo{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnDecrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnEncrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyKeyStore{AwsCryptographyKeyStore, } => AwsCryptographyKeyStore,
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field AwsCryptographyPrimitives for all enum members which have it
                            pub fn AwsCryptographyPrimitives(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error> {
                                match self {
                                    Error::AwsCryptographicMaterialProvidersException{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryAlreadyExists{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryDoesNotExist{message, } => panic!("field does not exist on this variant"),
                                    Error::InFlightTTLExceeded{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfo{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnDecrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnEncrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyKeyStore{AwsCryptographyKeyStore, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => AwsCryptographyPrimitives,
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field ComAmazonawsDynamodb for all enum members which have it
                            pub fn ComAmazonawsDynamodb(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error> {
                                match self {
                                    Error::AwsCryptographicMaterialProvidersException{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryAlreadyExists{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryDoesNotExist{message, } => panic!("field does not exist on this variant"),
                                    Error::InFlightTTLExceeded{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfo{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnDecrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnEncrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyKeyStore{AwsCryptographyKeyStore, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => ComAmazonawsDynamodb,
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field ComAmazonawsKms for all enum members which have it
                            pub fn ComAmazonawsKms(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error> {
                                match self {
                                    Error::AwsCryptographicMaterialProvidersException{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryAlreadyExists{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryDoesNotExist{message, } => panic!("field does not exist on this variant"),
                                    Error::InFlightTTLExceeded{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfo{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnDecrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnEncrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyKeyStore{AwsCryptographyKeyStore, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => ComAmazonawsKms,
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field list for all enum members which have it
                            pub fn list(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>> {
                                match self {
                                    Error::AwsCryptographicMaterialProvidersException{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryAlreadyExists{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryDoesNotExist{message, } => panic!("field does not exist on this variant"),
                                    Error::InFlightTTLExceeded{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfo{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnDecrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnEncrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyKeyStore{AwsCryptographyKeyStore, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => list,
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                }
                            }
                            /// Gets the field obj for all enum members which have it
                            pub fn obj(&self) -> &Object<dyn Any + Sync + Send> {
                                match self {
                                    Error::AwsCryptographicMaterialProvidersException{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryAlreadyExists{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryDoesNotExist{message, } => panic!("field does not exist on this variant"),
                                    Error::InFlightTTLExceeded{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfo{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnDecrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnEncrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyKeyStore{AwsCryptographyKeyStore, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => obj,
                                    Error::OpaqueWithText{obj, objMessage, } => obj,
                                }
                            }
                            /// Gets the field objMessage for all enum members which have it
                            pub fn objMessage(&self) -> &Sequence<DafnyCharUTF16> {
                                match self {
                                    Error::AwsCryptographicMaterialProvidersException{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryAlreadyExists{message, } => panic!("field does not exist on this variant"),
                                    Error::EntryDoesNotExist{message, } => panic!("field does not exist on this variant"),
                                    Error::InFlightTTLExceeded{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfo{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnDecrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidAlgorithmSuiteInfoOnEncrypt{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidDecryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterials{message, } => panic!("field does not exist on this variant"),
                                    Error::InvalidEncryptionMaterialsTransition{message, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyKeyStore{AwsCryptographyKeyStore, } => panic!("field does not exist on this variant"),
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => panic!("field does not exist on this variant"),
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => panic!("field does not exist on this variant"),
                                    Error::CollectionOfErrors{list, message, } => panic!("field does not exist on this variant"),
                                    Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                    Error::OpaqueWithText{obj, objMessage, } => objMessage,
                                }
                            }
                        }

                        impl Debug
                            for Error {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for Error {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    Error::AwsCryptographicMaterialProvidersException{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.AwsCryptographicMaterialProvidersException(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::EntryAlreadyExists{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.EntryAlreadyExists(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::EntryDoesNotExist{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.EntryDoesNotExist(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::InFlightTTLExceeded{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.InFlightTTLExceeded(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::InvalidAlgorithmSuiteInfo{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.InvalidAlgorithmSuiteInfo(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::InvalidAlgorithmSuiteInfoOnDecrypt{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.InvalidAlgorithmSuiteInfoOnDecrypt(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::InvalidAlgorithmSuiteInfoOnEncrypt{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.InvalidAlgorithmSuiteInfoOnEncrypt(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::InvalidDecryptionMaterials{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.InvalidDecryptionMaterials(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::InvalidDecryptionMaterialsTransition{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.InvalidDecryptionMaterialsTransition(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::InvalidEncryptionMaterials{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.InvalidEncryptionMaterials(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::InvalidEncryptionMaterialsTransition{message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.InvalidEncryptionMaterialsTransition(")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::AwsCryptographyKeyStore{AwsCryptographyKeyStore, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.AwsCryptographyKeyStore(")?;
                                        DafnyPrint::fmt_print(AwsCryptographyKeyStore, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.AwsCryptographyPrimitives(")?;
                                        DafnyPrint::fmt_print(AwsCryptographyPrimitives, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.ComAmazonawsDynamodb(")?;
                                        DafnyPrint::fmt_print(ComAmazonawsDynamodb, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.ComAmazonawsKms(")?;
                                        DafnyPrint::fmt_print(ComAmazonawsKms, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::CollectionOfErrors{list, message, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.CollectionOfErrors(")?;
                                        DafnyPrint::fmt_print(list, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(message, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::Opaque{obj, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.Opaque(")?;
                                        DafnyPrint::fmt_print(obj, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                    Error::OpaqueWithText{obj, objMessage, } => {
                                        write!(_formatter, "software.amazon.cryptography.materialproviders.internaldafny.types.Error.OpaqueWithText(")?;
                                        DafnyPrint::fmt_print(obj, _formatter, false)?;
                                        write!(_formatter, ", ")?;
                                        DafnyPrint::fmt_print(objMessage, _formatter, false)?;
                                        write!(_formatter, ")")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl Eq
                            for Error {}

                        impl Hash
                            for Error {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    Error::AwsCryptographicMaterialProvidersException{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::EntryAlreadyExists{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::EntryDoesNotExist{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::InFlightTTLExceeded{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::InvalidAlgorithmSuiteInfo{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::InvalidAlgorithmSuiteInfoOnDecrypt{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::InvalidAlgorithmSuiteInfoOnEncrypt{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::InvalidDecryptionMaterials{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::InvalidDecryptionMaterialsTransition{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::InvalidEncryptionMaterials{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::InvalidEncryptionMaterialsTransition{message, } => {
                                        Hash::hash(message, _state)
                                    },
                                    Error::AwsCryptographyKeyStore{AwsCryptographyKeyStore, } => {
                                        Hash::hash(AwsCryptographyKeyStore, _state)
                                    },
                                    Error::AwsCryptographyPrimitives{AwsCryptographyPrimitives, } => {
                                        Hash::hash(AwsCryptographyPrimitives, _state)
                                    },
                                    Error::ComAmazonawsDynamodb{ComAmazonawsDynamodb, } => {
                                        Hash::hash(ComAmazonawsDynamodb, _state)
                                    },
                                    Error::ComAmazonawsKms{ComAmazonawsKms, } => {
                                        Hash::hash(ComAmazonawsKms, _state)
                                    },
                                    Error::CollectionOfErrors{list, message, } => {
                                        Hash::hash(list, _state);
                                        Hash::hash(message, _state)
                                    },
                                    Error::Opaque{obj, } => {
                                        Hash::hash(obj, _state)
                                    },
                                    Error::OpaqueWithText{obj, objMessage, } => {
                                        Hash::hash(obj, _state);
                                        Hash::hash(objMessage, _state)
                                    },
                                }
                            }
                        }

                        impl Default
                            for Error {
                            fn default() -> Error {
                                Error::AwsCryptographicMaterialProvidersException {
                                    message: Default::default()
                                }
                            }
                        }

                        impl AsRef<Error>
                            for Error {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1725,3)
                        pub type OpaqueError = Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>;

                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy(1728,3)
                        pub type DummySubsetType = DafnyInt;

                        /// An element of DummySubsetType
                        pub fn __init_DummySubsetType() -> DafnyInt {
                            int!(1)
                        }
                    }
                }
            }

            pub mod services {
                pub mod dynamodb {
                    /// ../mpl/ComAmazonawsDynamodb/src/Index.dfy(6,1)
                    pub mod internaldafny {
                        pub use ::std::sync::Arc;
                        pub use ::dafny_runtime::Object;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error;
                        pub use ::std::fmt::Debug;
                        pub use ::std::fmt::Formatter;
                        pub use ::dafny_runtime::DafnyPrint;
                        pub use ::dafny_runtime::SequenceIter;
                        pub use ::dafny_runtime::seq;
                        pub use ::std::cmp::Eq;
                        pub use ::std::hash::Hash;
                        pub use ::std::hash::Hasher;
                        pub use ::std::default::Default;
                        pub use ::std::convert::AsRef;

                        pub struct _default {}

                        impl _default {
                            /// ../mpl/ComAmazonawsDynamodb/src/Index.dfy(8,3)
                            pub fn DefaultDynamoDBClientConfigType() -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::DynamoDBClientConfigType> {
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::DynamoDBClientConfigType::DynamoDBClientConfigType {})
                            }
                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2940,3)
                            pub fn CreateSuccessOfClient(client: &Object<dyn IDynamoDBClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IDynamoDBClient>, Arc<Error>>> {
                                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<dyn IDynamoDBClient>, Arc<Error>>::Success {
                                        value: client.clone()
                                    })
                            }
                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2943,3)
                            pub fn CreateFailureOfError(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IDynamoDBClient>, Arc<Error>>> {
                                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<dyn IDynamoDBClient>, Arc<Error>>::Failure {
                                        error: error.clone()
                                    })
                            }
                        }

                        /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2930,3)
                        #[derive(PartialEq, Clone)]
                        pub enum DynamoDBClientConfigType {
                            DynamoDBClientConfigType {}
                        }

                        impl DynamoDBClientConfigType {}

                        impl Debug
                            for DynamoDBClientConfigType {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for DynamoDBClientConfigType {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    DynamoDBClientConfigType::DynamoDBClientConfigType{} => {
                                        write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.DynamoDBClientConfigType.DynamoDBClientConfigType")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl DynamoDBClientConfigType {
                            /// Enumerates all possible values of DynamoDBClientConfigType
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DynamoDBClientConfigType>> {
                                seq![Arc::new(DynamoDBClientConfigType::DynamoDBClientConfigType {})].iter()
                            }
                        }

                        impl Eq
                            for DynamoDBClientConfigType {}

                        impl Hash
                            for DynamoDBClientConfigType {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    DynamoDBClientConfigType::DynamoDBClientConfigType{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for DynamoDBClientConfigType {
                            fn default() -> DynamoDBClientConfigType {
                                DynamoDBClientConfigType::DynamoDBClientConfigType {}
                            }
                        }

                        impl AsRef<DynamoDBClientConfigType>
                            for DynamoDBClientConfigType {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(5,1)
                        pub mod types {
                            pub use ::dafny_runtime::Sequence;
                            pub use ::dafny_runtime::DafnyCharUTF16;
                            pub use ::dafny_runtime::int;
                            pub use ::dafny_runtime::truncate;
                            pub use ::dafny_runtime::Map;
                            pub use ::std::sync::Arc;
                            pub use ::dafny_runtime::DafnyInt;
                            pub use ::dafny_runtime::DafnyType;
                            pub use ::std::fmt::Debug;
                            pub use ::std::fmt::Formatter;
                            pub use ::dafny_runtime::DafnyPrint;
                            pub use ::std::cmp::Eq;
                            pub use ::std::hash::Hash;
                            pub use ::std::hash::Hasher;
                            pub use ::std::default::Default;
                            pub use ::std::convert::AsRef;
                            pub use ::dafny_runtime::SequenceIter;
                            pub use ::dafny_runtime::seq;
                            pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
                            pub use ::dafny_runtime::Object;
                            pub use ::dafny_runtime::allocate_object;
                            pub use ::dafny_runtime::UpcastObject;
                            pub use ::dafny_runtime::DynAny;
                            pub use ::dafny_runtime::UpcastObjectFn;
                            pub use ::dafny_runtime::Any;
                            pub use ::std::marker::Sync;
                            pub use ::std::marker::Send;

                            pub struct _default {}

                            impl _default {
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(35,3)
                                pub fn IsValid_AttributeName(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(0)) && !(int!(b"65535") < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(39,3)
                                pub fn IsValid_AttributeNameList(x: &Sequence<Sequence<DafnyCharUTF16>>) -> bool {
                                    !(x.cardinality() < int!(1))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(65,3)
                                pub fn IsValid_AutoScalingPolicyName(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(256) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(73,3)
                                pub fn IsValid_AutoScalingRoleArn(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(1600) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(104,3)
                                pub fn IsValid_BackupArn(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(37)) && !(int!(1024) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(122,3)
                                pub fn IsValid_BackupName(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(3)) && !(int!(255) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(126,3)
                                pub fn IsValid_BackupsInputLimit(x: i32) -> bool {
                                    !(x < truncate!(int!(1), i32)) && !(truncate!(int!(100), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(130,3)
                                pub fn IsValid_BackupSizeBytes(x: i64) -> bool {
                                    !(x < truncate!(int!(0), i64))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(177,3)
                                pub fn IsValid_BatchGetRequestMap(x: &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeysAndAttributes>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(220,3)
                                pub fn IsValid_BatchWriteItemRequestMap(x: &Map<Sequence<DafnyCharUTF16>, crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::WriteRequests>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(25) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(224,3)
                                pub fn IsValid_BilledSizeBytes(x: i64) -> bool {
                                    !(x < truncate!(int!(0), i64))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(244,3)
                                pub fn IsValid_CancellationReasonList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CancellationReason>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(253,3)
                                pub fn IsValid_ClientRequestToken(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(36) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(258,3)
                                pub fn IsValid_CloudWatchLogGroupArn(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(1024) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(305,3)
                                pub fn IsValid_ConsumedCapacityUnits(x: &Sequence<u8>) -> bool {
                                    !(x.cardinality() < int!(8)) && !(int!(8) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(384,3)
                                pub fn IsValid_CsvDelimiter(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(1) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(388,3)
                                pub fn IsValid_CsvHeader(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(b"65536") < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(392,3)
                                pub fn IsValid_CsvHeaderList(x: &Sequence<Sequence<DafnyCharUTF16>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(255) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(565,3)
                                pub fn IsValid_DoubleObject(x: &Sequence<u8>) -> bool {
                                    !(x.cardinality() < int!(8)) && !(int!(8) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1589,3)
                                pub fn IsValid_ErrorCount(x: i64) -> bool {
                                    !(x < truncate!(int!(0), i64))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1627,3)
                                pub fn IsValid_ExportArn(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(37)) && !(int!(1024) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1739,3)
                                pub fn IsValid_GlobalSecondaryIndexAutoScalingUpdateList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexAutoScalingUpdate>>) -> bool {
                                    !(x.cardinality() < int!(1))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1788,3)
                                pub fn IsValid_GlobalTableGlobalSecondaryIndexSettingsUpdateList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableGlobalSecondaryIndexSettingsUpdate>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(20) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1798,3)
                                pub fn IsValid_ImportArn(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(37)) && !(int!(1024) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1802,3)
                                pub fn IsValid_ImportedItemCount(x: i64) -> bool {
                                    !(x < truncate!(int!(0), i64))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1806,3)
                                pub fn IsValid_ImportNextToken(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(112)) && !(int!(1024) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1864,3)
                                pub fn IsValid_IndexName(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(3)) && !(int!(255) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1893,3)
                                pub fn IsValid_ItemCollectionSizeEstimateBound(x: &Sequence<u8>) -> bool {
                                    !(x.cardinality() < int!(8)) && !(int!(8) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1898,3)
                                pub fn IsValid_ItemCount(x: i64) -> bool {
                                    !(x < truncate!(int!(0), i64))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1906,3)
                                pub fn IsValid_ItemResponseList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemResponse>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1913,3)
                                pub fn IsValid_KeyList(x: &Sequence<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1924,3)
                                pub fn IsValid_KeySchema(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchemaElement>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(2) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1928,3)
                                pub fn IsValid_KeySchemaAttributeName(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(255) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1977,3)
                                pub fn IsValid_ListContributorInsightsLimit(x: i32) -> bool {
                                    !(truncate!(int!(100), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1990,3)
                                pub fn IsValid_ListExportsMaxLimit(x: i32) -> bool {
                                    !(x < truncate!(int!(1), i32)) && !(truncate!(int!(25), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2012,3)
                                pub fn IsValid_ListImportsMaxLimit(x: i32) -> bool {
                                    !(x < truncate!(int!(1), i32)) && !(truncate!(int!(25), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2024,3)
                                pub fn IsValid_ListTablesInputLimit(x: i32) -> bool {
                                    !(x < truncate!(int!(1), i32)) && !(truncate!(int!(100), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2065,3)
                                pub fn IsValid_NonKeyAttributeName(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(255) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2069,3)
                                pub fn IsValid_NonKeyAttributeNameList(x: &Sequence<Sequence<DafnyCharUTF16>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(20) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2073,3)
                                pub fn IsValid_NonNegativeLongObject(x: i64) -> bool {
                                    !(x < truncate!(int!(0), i64))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2092,3)
                                pub fn IsValid_ParameterizedStatements(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ParameterizedStatement>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2096,3)
                                pub fn IsValid_PartiQLBatchRequest(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementRequest>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(25) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2101,3)
                                pub fn IsValid_PartiQLNextToken(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(b"32768") < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2105,3)
                                pub fn IsValid_PartiQLStatement(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(8192) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2120,3)
                                pub fn IsValid_PolicyRevisionId(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(255) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2124,3)
                                pub fn IsValid_PositiveIntegerObject(x: i32) -> bool {
                                    !(x < truncate!(int!(1), i32))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2128,3)
                                pub fn IsValid_PositiveLongObject(x: i64) -> bool {
                                    !(x < truncate!(int!(1), i64))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2132,3)
                                pub fn IsValid_PreparedStatementParameters(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>) -> bool {
                                    !(x.cardinality() < int!(1))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2136,3)
                                pub fn IsValid_ProcessedItemCount(x: i64) -> bool {
                                    !(x < truncate!(int!(0), i64))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2245,3)
                                pub fn IsValid_ReplicaAutoScalingUpdateList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaAutoScalingUpdate>>) -> bool {
                                    !(x.cardinality() < int!(1))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2285,3)
                                pub fn IsValid_ReplicaGlobalSecondaryIndexList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndex>>) -> bool {
                                    !(x.cardinality() < int!(1))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2303,3)
                                pub fn IsValid_ReplicaGlobalSecondaryIndexSettingsUpdateList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexSettingsUpdate>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(20) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2327,3)
                                pub fn IsValid_ReplicaSettingsUpdateList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaSettingsUpdate>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(50) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2346,3)
                                pub fn IsValid_ReplicationGroupUpdateList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicationGroupUpdate>>) -> bool {
                                    !(x.cardinality() < int!(1))
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2355,3)
                                pub fn IsValid_ResourceArnString(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(1283) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2412,3)
                                pub fn IsValid_S3Bucket(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(0)) && !(int!(255) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2422,3)
                                pub fn IsValid_S3Prefix(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(0)) && !(int!(1024) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2429,3)
                                pub fn IsValid_S3SseKmsKeyId(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(2048) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2462,3)
                                pub fn IsValid_ScanSegment(x: i32) -> bool {
                                    !(x < truncate!(int!(0), i32)) && !(truncate!(int!(b"999999"), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2466,3)
                                pub fn IsValid_ScanTotalSegments(x: i32) -> bool {
                                    !(x < truncate!(int!(1), i32)) && !(truncate!(int!(b"1000000"), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2516,3)
                                pub fn IsValid_StreamArn(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(37)) && !(int!(1024) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2533,3)
                                pub fn IsValid_TableArn(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(1024) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2586,3)
                                pub fn IsValid_TableName(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(3)) && !(int!(255) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2604,3)
                                pub fn IsValid_TagKeyString(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(128) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2613,3)
                                pub fn IsValid_TagValueString(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(0)) && !(int!(256) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2617,3)
                                pub fn IsValid_TimeToLiveAttributeName(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(255) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2638,3)
                                pub fn IsValid_TransactGetItemList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactGetItem>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2656,3)
                                pub fn IsValid_TransactWriteItemList(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItem>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(100) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2803,3)
                                pub fn IsValid_WriteRequests(x: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::WriteRequest>>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(25) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2920,3)
                                pub fn IsDummySubsetType(x: &DafnyInt) -> bool {
                                    int!(0) < x.clone()
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(11,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DafnyCallEvent<I: DafnyType, O: DafnyType> {
                                DafnyCallEvent {
                                    input: I,
                                    output: O
                                }
                            }

                            impl<I: DafnyType, O: DafnyType> DafnyCallEvent<I, O> {
                                /// Returns a borrow of the field input
                                pub fn input(&self) -> &I {
                                    match self {
                                        DafnyCallEvent::DafnyCallEvent{input, output, } => input,
                                    }
                                }
                                /// Returns a borrow of the field output
                                pub fn output(&self) -> &O {
                                    match self {
                                        DafnyCallEvent::DafnyCallEvent{input, output, } => output,
                                    }
                                }
                            }

                            impl<I: DafnyType, O: DafnyType> Debug
                                for DafnyCallEvent<I, O> {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl<I: DafnyType, O: DafnyType> DafnyPrint
                                for DafnyCallEvent<I, O> {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DafnyCallEvent.DafnyCallEvent(")?;
                                            DafnyPrint::fmt_print(input, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(output, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl<I: DafnyType + Eq, O: DafnyType + Eq> Eq
                                for DafnyCallEvent<I, O> {}

                            impl<I: DafnyType + Hash, O: DafnyType + Hash> Hash
                                for DafnyCallEvent<I, O> {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                            Hash::hash(input, _state);
                                            Hash::hash(output, _state)
                                        },
                                    }
                                }
                            }

                            impl<I: DafnyType + Default, O: DafnyType + Default> Default
                                for DafnyCallEvent<I, O> {
                                fn default() -> DafnyCallEvent<I, O> {
                                    DafnyCallEvent::DafnyCallEvent {
                                        input: Default::default(),
                                        output: Default::default()
                                    }
                                }
                            }

                            impl<I: DafnyType, O: DafnyType> AsRef<DafnyCallEvent<I, O>>
                                for DafnyCallEvent<I, O> {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(15,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ApproximateCreationDateTimePrecision {
                                MILLISECOND {},
                                MICROSECOND {}
                            }

                            impl ApproximateCreationDateTimePrecision {}

                            impl Debug
                                for ApproximateCreationDateTimePrecision {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ApproximateCreationDateTimePrecision {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ApproximateCreationDateTimePrecision::MILLISECOND{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ApproximateCreationDateTimePrecision.MILLISECOND")?;
                                            Ok(())
                                        },
                                        ApproximateCreationDateTimePrecision::MICROSECOND{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ApproximateCreationDateTimePrecision.MICROSECOND")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ApproximateCreationDateTimePrecision {
                                /// Enumerates all possible values of ApproximateCreationDateTimePrecision
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ApproximateCreationDateTimePrecision>> {
                                    seq![Arc::new(ApproximateCreationDateTimePrecision::MILLISECOND {}), Arc::new(ApproximateCreationDateTimePrecision::MICROSECOND {})].iter()
                                }
                            }

                            impl Eq
                                for ApproximateCreationDateTimePrecision {}

                            impl Hash
                                for ApproximateCreationDateTimePrecision {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ApproximateCreationDateTimePrecision::MILLISECOND{} => {

                                        },
                                        ApproximateCreationDateTimePrecision::MICROSECOND{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ApproximateCreationDateTimePrecision {
                                fn default() -> ApproximateCreationDateTimePrecision {
                                    ApproximateCreationDateTimePrecision::MILLISECOND {}
                                }
                            }

                            impl AsRef<ApproximateCreationDateTimePrecision>
                                for ApproximateCreationDateTimePrecision {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(19,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ArchivalSummary {
                                ArchivalSummary {
                                    ArchivalDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ArchivalReason: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ArchivalBackupArn: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ArchivalSummary {
                                /// Returns a borrow of the field ArchivalDateTime
                                pub fn ArchivalDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ArchivalSummary::ArchivalSummary{ArchivalDateTime, ArchivalReason, ArchivalBackupArn, } => ArchivalDateTime,
                                    }
                                }
                                /// Returns a borrow of the field ArchivalReason
                                pub fn ArchivalReason(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ArchivalSummary::ArchivalSummary{ArchivalDateTime, ArchivalReason, ArchivalBackupArn, } => ArchivalReason,
                                    }
                                }
                                /// Returns a borrow of the field ArchivalBackupArn
                                pub fn ArchivalBackupArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ArchivalSummary::ArchivalSummary{ArchivalDateTime, ArchivalReason, ArchivalBackupArn, } => ArchivalBackupArn,
                                    }
                                }
                            }

                            impl Debug
                                for ArchivalSummary {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ArchivalSummary {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ArchivalSummary::ArchivalSummary{ArchivalDateTime, ArchivalReason, ArchivalBackupArn, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ArchivalSummary.ArchivalSummary(")?;
                                            DafnyPrint::fmt_print(ArchivalDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ArchivalReason, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ArchivalBackupArn, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ArchivalSummary {}

                            impl Hash
                                for ArchivalSummary {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ArchivalSummary::ArchivalSummary{ArchivalDateTime, ArchivalReason, ArchivalBackupArn, } => {
                                            Hash::hash(ArchivalDateTime, _state);
                                            Hash::hash(ArchivalReason, _state);
                                            Hash::hash(ArchivalBackupArn, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ArchivalSummary {
                                fn default() -> ArchivalSummary {
                                    ArchivalSummary::ArchivalSummary {
                                        ArchivalDateTime: Default::default(),
                                        ArchivalReason: Default::default(),
                                        ArchivalBackupArn: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ArchivalSummary>
                                for ArchivalSummary {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(24,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AttributeAction {
                                ADD {},
                                PUT {},
                                DELETE {}
                            }

                            impl AttributeAction {}

                            impl Debug
                                for AttributeAction {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AttributeAction {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AttributeAction::ADD{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeAction.ADD")?;
                                            Ok(())
                                        },
                                        AttributeAction::PUT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeAction.PUT")?;
                                            Ok(())
                                        },
                                        AttributeAction::DELETE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeAction.DELETE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl AttributeAction {
                                /// Enumerates all possible values of AttributeAction
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<AttributeAction>> {
                                    seq![Arc::new(AttributeAction::ADD {}), Arc::new(AttributeAction::PUT {}), Arc::new(AttributeAction::DELETE {})].iter()
                                }
                            }

                            impl Eq
                                for AttributeAction {}

                            impl Hash
                                for AttributeAction {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AttributeAction::ADD{} => {

                                        },
                                        AttributeAction::PUT{} => {

                                        },
                                        AttributeAction::DELETE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for AttributeAction {
                                fn default() -> AttributeAction {
                                    AttributeAction::ADD {}
                                }
                            }

                            impl AsRef<AttributeAction>
                                for AttributeAction {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(28,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AttributeDefinition {
                                AttributeDefinition {
                                    AttributeName: Sequence<DafnyCharUTF16>,
                                    AttributeType: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ScalarAttributeType>
                                }
                            }

                            impl AttributeDefinition {
                                /// Returns a borrow of the field AttributeName
                                pub fn AttributeName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        AttributeDefinition::AttributeDefinition{AttributeName, AttributeType, } => AttributeName,
                                    }
                                }
                                /// Returns a borrow of the field AttributeType
                                pub fn AttributeType(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ScalarAttributeType> {
                                    match self {
                                        AttributeDefinition::AttributeDefinition{AttributeName, AttributeType, } => AttributeType,
                                    }
                                }
                            }

                            impl Debug
                                for AttributeDefinition {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AttributeDefinition {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AttributeDefinition::AttributeDefinition{AttributeName, AttributeType, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeDefinition.AttributeDefinition(")?;
                                            DafnyPrint::fmt_print(AttributeName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttributeType, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for AttributeDefinition {}

                            impl Hash
                                for AttributeDefinition {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AttributeDefinition::AttributeDefinition{AttributeName, AttributeType, } => {
                                            Hash::hash(AttributeName, _state);
                                            Hash::hash(AttributeType, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for AttributeDefinition {
                                fn default() -> AttributeDefinition {
                                    AttributeDefinition::AttributeDefinition {
                                        AttributeName: Default::default(),
                                        AttributeType: Default::default()
                                    }
                                }
                            }

                            impl AsRef<AttributeDefinition>
                                for AttributeDefinition {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(34,3)
                            pub type AttributeName = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(38,3)
                            pub type AttributeNameList = Sequence<Sequence<DafnyCharUTF16>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(43,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AttributeValue {
                                S {
                                    S: Sequence<DafnyCharUTF16>
                                },
                                N {
                                    N: Sequence<DafnyCharUTF16>
                                },
                                B {
                                    B: Sequence<u8>
                                },
                                SS {
                                    SS: Sequence<Sequence<DafnyCharUTF16>>
                                },
                                NS {
                                    NS: Sequence<Sequence<DafnyCharUTF16>>
                                },
                                BS {
                                    BS: Sequence<Sequence<u8>>
                                },
                                M {
                                    M: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>
                                },
                                L {
                                    L: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>
                                },
                                NULL {
                                    NULL: bool
                                },
                                BOOL {
                                    BOOL: bool
                                }
                            }

                            impl AttributeValue {
                                /// Gets the field S for all enum members which have it
                                pub fn S(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        AttributeValue::S{S, } => S,
                                        AttributeValue::N{N, } => panic!("field does not exist on this variant"),
                                        AttributeValue::B{B, } => panic!("field does not exist on this variant"),
                                        AttributeValue::SS{SS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NS{NS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BS{BS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::M{M, } => panic!("field does not exist on this variant"),
                                        AttributeValue::L{L, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NULL{NULL, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BOOL{BOOL, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field N for all enum members which have it
                                pub fn N(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        AttributeValue::S{S, } => panic!("field does not exist on this variant"),
                                        AttributeValue::N{N, } => N,
                                        AttributeValue::B{B, } => panic!("field does not exist on this variant"),
                                        AttributeValue::SS{SS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NS{NS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BS{BS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::M{M, } => panic!("field does not exist on this variant"),
                                        AttributeValue::L{L, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NULL{NULL, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BOOL{BOOL, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field B for all enum members which have it
                                pub fn B(&self) -> &Sequence<u8> {
                                    match self {
                                        AttributeValue::S{S, } => panic!("field does not exist on this variant"),
                                        AttributeValue::N{N, } => panic!("field does not exist on this variant"),
                                        AttributeValue::B{B, } => B,
                                        AttributeValue::SS{SS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NS{NS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BS{BS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::M{M, } => panic!("field does not exist on this variant"),
                                        AttributeValue::L{L, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NULL{NULL, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BOOL{BOOL, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field SS for all enum members which have it
                                pub fn SS(&self) -> &Sequence<Sequence<DafnyCharUTF16>> {
                                    match self {
                                        AttributeValue::S{S, } => panic!("field does not exist on this variant"),
                                        AttributeValue::N{N, } => panic!("field does not exist on this variant"),
                                        AttributeValue::B{B, } => panic!("field does not exist on this variant"),
                                        AttributeValue::SS{SS, } => SS,
                                        AttributeValue::NS{NS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BS{BS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::M{M, } => panic!("field does not exist on this variant"),
                                        AttributeValue::L{L, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NULL{NULL, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BOOL{BOOL, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field NS for all enum members which have it
                                pub fn NS(&self) -> &Sequence<Sequence<DafnyCharUTF16>> {
                                    match self {
                                        AttributeValue::S{S, } => panic!("field does not exist on this variant"),
                                        AttributeValue::N{N, } => panic!("field does not exist on this variant"),
                                        AttributeValue::B{B, } => panic!("field does not exist on this variant"),
                                        AttributeValue::SS{SS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NS{NS, } => NS,
                                        AttributeValue::BS{BS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::M{M, } => panic!("field does not exist on this variant"),
                                        AttributeValue::L{L, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NULL{NULL, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BOOL{BOOL, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field BS for all enum members which have it
                                pub fn BS(&self) -> &Sequence<Sequence<u8>> {
                                    match self {
                                        AttributeValue::S{S, } => panic!("field does not exist on this variant"),
                                        AttributeValue::N{N, } => panic!("field does not exist on this variant"),
                                        AttributeValue::B{B, } => panic!("field does not exist on this variant"),
                                        AttributeValue::SS{SS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NS{NS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BS{BS, } => BS,
                                        AttributeValue::M{M, } => panic!("field does not exist on this variant"),
                                        AttributeValue::L{L, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NULL{NULL, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BOOL{BOOL, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field M for all enum members which have it
                                pub fn M(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        AttributeValue::S{S, } => panic!("field does not exist on this variant"),
                                        AttributeValue::N{N, } => panic!("field does not exist on this variant"),
                                        AttributeValue::B{B, } => panic!("field does not exist on this variant"),
                                        AttributeValue::SS{SS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NS{NS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BS{BS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::M{M, } => M,
                                        AttributeValue::L{L, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NULL{NULL, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BOOL{BOOL, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field L for all enum members which have it
                                pub fn L(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        AttributeValue::S{S, } => panic!("field does not exist on this variant"),
                                        AttributeValue::N{N, } => panic!("field does not exist on this variant"),
                                        AttributeValue::B{B, } => panic!("field does not exist on this variant"),
                                        AttributeValue::SS{SS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NS{NS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BS{BS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::M{M, } => panic!("field does not exist on this variant"),
                                        AttributeValue::L{L, } => L,
                                        AttributeValue::NULL{NULL, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BOOL{BOOL, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field NULL for all enum members which have it
                                pub fn NULL(&self) -> &bool {
                                    match self {
                                        AttributeValue::S{S, } => panic!("field does not exist on this variant"),
                                        AttributeValue::N{N, } => panic!("field does not exist on this variant"),
                                        AttributeValue::B{B, } => panic!("field does not exist on this variant"),
                                        AttributeValue::SS{SS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NS{NS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BS{BS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::M{M, } => panic!("field does not exist on this variant"),
                                        AttributeValue::L{L, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NULL{NULL, } => NULL,
                                        AttributeValue::BOOL{BOOL, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field BOOL for all enum members which have it
                                pub fn BOOL(&self) -> &bool {
                                    match self {
                                        AttributeValue::S{S, } => panic!("field does not exist on this variant"),
                                        AttributeValue::N{N, } => panic!("field does not exist on this variant"),
                                        AttributeValue::B{B, } => panic!("field does not exist on this variant"),
                                        AttributeValue::SS{SS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NS{NS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BS{BS, } => panic!("field does not exist on this variant"),
                                        AttributeValue::M{M, } => panic!("field does not exist on this variant"),
                                        AttributeValue::L{L, } => panic!("field does not exist on this variant"),
                                        AttributeValue::NULL{NULL, } => panic!("field does not exist on this variant"),
                                        AttributeValue::BOOL{BOOL, } => BOOL,
                                    }
                                }
                            }

                            impl Debug
                                for AttributeValue {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AttributeValue {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AttributeValue::S{S, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.S(")?;
                                            DafnyPrint::fmt_print(S, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        AttributeValue::N{N, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.N(")?;
                                            DafnyPrint::fmt_print(N, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        AttributeValue::B{B, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.B(")?;
                                            DafnyPrint::fmt_print(B, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        AttributeValue::SS{SS, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.SS(")?;
                                            DafnyPrint::fmt_print(SS, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        AttributeValue::NS{NS, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.NS(")?;
                                            DafnyPrint::fmt_print(NS, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        AttributeValue::BS{BS, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.BS(")?;
                                            DafnyPrint::fmt_print(BS, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        AttributeValue::M{M, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.M(")?;
                                            DafnyPrint::fmt_print(M, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        AttributeValue::L{L, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.L(")?;
                                            DafnyPrint::fmt_print(L, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        AttributeValue::NULL{NULL, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.NULL(")?;
                                            DafnyPrint::fmt_print(NULL, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        AttributeValue::BOOL{BOOL, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.BOOL(")?;
                                            DafnyPrint::fmt_print(BOOL, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for AttributeValue {}

                            impl Hash
                                for AttributeValue {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AttributeValue::S{S, } => {
                                            Hash::hash(S, _state)
                                        },
                                        AttributeValue::N{N, } => {
                                            Hash::hash(N, _state)
                                        },
                                        AttributeValue::B{B, } => {
                                            Hash::hash(B, _state)
                                        },
                                        AttributeValue::SS{SS, } => {
                                            Hash::hash(SS, _state)
                                        },
                                        AttributeValue::NS{NS, } => {
                                            Hash::hash(NS, _state)
                                        },
                                        AttributeValue::BS{BS, } => {
                                            Hash::hash(BS, _state)
                                        },
                                        AttributeValue::M{M, } => {
                                            Hash::hash(M, _state)
                                        },
                                        AttributeValue::L{L, } => {
                                            Hash::hash(L, _state)
                                        },
                                        AttributeValue::NULL{NULL, } => {
                                            Hash::hash(NULL, _state)
                                        },
                                        AttributeValue::BOOL{BOOL, } => {
                                            Hash::hash(BOOL, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for AttributeValue {
                                fn default() -> AttributeValue {
                                    AttributeValue::S {
                                        S: Default::default()
                                    }
                                }
                            }

                            impl AsRef<AttributeValue>
                                for AttributeValue {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(55,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AttributeValueUpdate {
                                AttributeValueUpdate {
                                    Value: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>,
                                    Action: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeAction>>>
                                }
                            }

                            impl AttributeValueUpdate {
                                /// Returns a borrow of the field Value
                                pub fn Value(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>> {
                                    match self {
                                        AttributeValueUpdate::AttributeValueUpdate{Value, Action, } => Value,
                                    }
                                }
                                /// Returns a borrow of the field Action
                                pub fn Action(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeAction>>> {
                                    match self {
                                        AttributeValueUpdate::AttributeValueUpdate{Value, Action, } => Action,
                                    }
                                }
                            }

                            impl Debug
                                for AttributeValueUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AttributeValueUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AttributeValueUpdate::AttributeValueUpdate{Value, Action, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValueUpdate.AttributeValueUpdate(")?;
                                            DafnyPrint::fmt_print(Value, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Action, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for AttributeValueUpdate {}

                            impl Hash
                                for AttributeValueUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AttributeValueUpdate::AttributeValueUpdate{Value, Action, } => {
                                            Hash::hash(Value, _state);
                                            Hash::hash(Action, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for AttributeValueUpdate {
                                fn default() -> AttributeValueUpdate {
                                    AttributeValueUpdate::AttributeValueUpdate {
                                        Value: Default::default(),
                                        Action: Default::default()
                                    }
                                }
                            }

                            impl AsRef<AttributeValueUpdate>
                                for AttributeValueUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(59,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AutoScalingPolicyDescription {
                                AutoScalingPolicyDescription {
                                    PolicyName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TargetTrackingScalingPolicyConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingTargetTrackingScalingPolicyConfigurationDescription>>>
                                }
                            }

                            impl AutoScalingPolicyDescription {
                                /// Returns a borrow of the field PolicyName
                                pub fn PolicyName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        AutoScalingPolicyDescription::AutoScalingPolicyDescription{PolicyName, TargetTrackingScalingPolicyConfiguration, } => PolicyName,
                                    }
                                }
                                /// Returns a borrow of the field TargetTrackingScalingPolicyConfiguration
                                pub fn TargetTrackingScalingPolicyConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingTargetTrackingScalingPolicyConfigurationDescription>>> {
                                    match self {
                                        AutoScalingPolicyDescription::AutoScalingPolicyDescription{PolicyName, TargetTrackingScalingPolicyConfiguration, } => TargetTrackingScalingPolicyConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for AutoScalingPolicyDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AutoScalingPolicyDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AutoScalingPolicyDescription::AutoScalingPolicyDescription{PolicyName, TargetTrackingScalingPolicyConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingPolicyDescription.AutoScalingPolicyDescription(")?;
                                            DafnyPrint::fmt_print(PolicyName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TargetTrackingScalingPolicyConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for AutoScalingPolicyDescription {}

                            impl Hash
                                for AutoScalingPolicyDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AutoScalingPolicyDescription::AutoScalingPolicyDescription{PolicyName, TargetTrackingScalingPolicyConfiguration, } => {
                                            Hash::hash(PolicyName, _state);
                                            Hash::hash(TargetTrackingScalingPolicyConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for AutoScalingPolicyDescription {
                                fn default() -> AutoScalingPolicyDescription {
                                    AutoScalingPolicyDescription::AutoScalingPolicyDescription {
                                        PolicyName: Default::default(),
                                        TargetTrackingScalingPolicyConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<AutoScalingPolicyDescription>
                                for AutoScalingPolicyDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(64,3)
                            pub type AutoScalingPolicyName = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(68,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AutoScalingPolicyUpdate {
                                AutoScalingPolicyUpdate {
                                    PolicyName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TargetTrackingScalingPolicyConfiguration: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingTargetTrackingScalingPolicyConfigurationUpdate>
                                }
                            }

                            impl AutoScalingPolicyUpdate {
                                /// Returns a borrow of the field PolicyName
                                pub fn PolicyName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        AutoScalingPolicyUpdate::AutoScalingPolicyUpdate{PolicyName, TargetTrackingScalingPolicyConfiguration, } => PolicyName,
                                    }
                                }
                                /// Returns a borrow of the field TargetTrackingScalingPolicyConfiguration
                                pub fn TargetTrackingScalingPolicyConfiguration(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingTargetTrackingScalingPolicyConfigurationUpdate> {
                                    match self {
                                        AutoScalingPolicyUpdate::AutoScalingPolicyUpdate{PolicyName, TargetTrackingScalingPolicyConfiguration, } => TargetTrackingScalingPolicyConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for AutoScalingPolicyUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AutoScalingPolicyUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AutoScalingPolicyUpdate::AutoScalingPolicyUpdate{PolicyName, TargetTrackingScalingPolicyConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingPolicyUpdate.AutoScalingPolicyUpdate(")?;
                                            DafnyPrint::fmt_print(PolicyName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TargetTrackingScalingPolicyConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for AutoScalingPolicyUpdate {}

                            impl Hash
                                for AutoScalingPolicyUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AutoScalingPolicyUpdate::AutoScalingPolicyUpdate{PolicyName, TargetTrackingScalingPolicyConfiguration, } => {
                                            Hash::hash(PolicyName, _state);
                                            Hash::hash(TargetTrackingScalingPolicyConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for AutoScalingPolicyUpdate {
                                fn default() -> AutoScalingPolicyUpdate {
                                    AutoScalingPolicyUpdate::AutoScalingPolicyUpdate {
                                        PolicyName: Default::default(),
                                        TargetTrackingScalingPolicyConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<AutoScalingPolicyUpdate>
                                for AutoScalingPolicyUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(72,3)
                            pub type AutoScalingRoleArn = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(76,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AutoScalingSettingsDescription {
                                AutoScalingSettingsDescription {
                                    MinimumUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    MaximumUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    AutoScalingDisabled: Arc<Option<bool>>,
                                    AutoScalingRoleArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ScalingPolicies: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingPolicyDescription>>>>
                                }
                            }

                            impl AutoScalingSettingsDescription {
                                /// Returns a borrow of the field MinimumUnits
                                pub fn MinimumUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        AutoScalingSettingsDescription::AutoScalingSettingsDescription{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicies, } => MinimumUnits,
                                    }
                                }
                                /// Returns a borrow of the field MaximumUnits
                                pub fn MaximumUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        AutoScalingSettingsDescription::AutoScalingSettingsDescription{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicies, } => MaximumUnits,
                                    }
                                }
                                /// Returns a borrow of the field AutoScalingDisabled
                                pub fn AutoScalingDisabled(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        AutoScalingSettingsDescription::AutoScalingSettingsDescription{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicies, } => AutoScalingDisabled,
                                    }
                                }
                                /// Returns a borrow of the field AutoScalingRoleArn
                                pub fn AutoScalingRoleArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        AutoScalingSettingsDescription::AutoScalingSettingsDescription{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicies, } => AutoScalingRoleArn,
                                    }
                                }
                                /// Returns a borrow of the field ScalingPolicies
                                pub fn ScalingPolicies(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingPolicyDescription>>>> {
                                    match self {
                                        AutoScalingSettingsDescription::AutoScalingSettingsDescription{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicies, } => ScalingPolicies,
                                    }
                                }
                            }

                            impl Debug
                                for AutoScalingSettingsDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AutoScalingSettingsDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AutoScalingSettingsDescription::AutoScalingSettingsDescription{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicies, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingSettingsDescription.AutoScalingSettingsDescription(")?;
                                            DafnyPrint::fmt_print(MinimumUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MaximumUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AutoScalingDisabled, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AutoScalingRoleArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ScalingPolicies, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for AutoScalingSettingsDescription {}

                            impl Hash
                                for AutoScalingSettingsDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AutoScalingSettingsDescription::AutoScalingSettingsDescription{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicies, } => {
                                            Hash::hash(MinimumUnits, _state);
                                            Hash::hash(MaximumUnits, _state);
                                            Hash::hash(AutoScalingDisabled, _state);
                                            Hash::hash(AutoScalingRoleArn, _state);
                                            Hash::hash(ScalingPolicies, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for AutoScalingSettingsDescription {
                                fn default() -> AutoScalingSettingsDescription {
                                    AutoScalingSettingsDescription::AutoScalingSettingsDescription {
                                        MinimumUnits: Default::default(),
                                        MaximumUnits: Default::default(),
                                        AutoScalingDisabled: Default::default(),
                                        AutoScalingRoleArn: Default::default(),
                                        ScalingPolicies: Default::default()
                                    }
                                }
                            }

                            impl AsRef<AutoScalingSettingsDescription>
                                for AutoScalingSettingsDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(83,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AutoScalingSettingsUpdate {
                                AutoScalingSettingsUpdate {
                                    MinimumUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    MaximumUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    AutoScalingDisabled: Arc<Option<bool>>,
                                    AutoScalingRoleArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ScalingPolicyUpdate: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingPolicyUpdate>>>
                                }
                            }

                            impl AutoScalingSettingsUpdate {
                                /// Returns a borrow of the field MinimumUnits
                                pub fn MinimumUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        AutoScalingSettingsUpdate::AutoScalingSettingsUpdate{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicyUpdate, } => MinimumUnits,
                                    }
                                }
                                /// Returns a borrow of the field MaximumUnits
                                pub fn MaximumUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        AutoScalingSettingsUpdate::AutoScalingSettingsUpdate{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicyUpdate, } => MaximumUnits,
                                    }
                                }
                                /// Returns a borrow of the field AutoScalingDisabled
                                pub fn AutoScalingDisabled(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        AutoScalingSettingsUpdate::AutoScalingSettingsUpdate{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicyUpdate, } => AutoScalingDisabled,
                                    }
                                }
                                /// Returns a borrow of the field AutoScalingRoleArn
                                pub fn AutoScalingRoleArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        AutoScalingSettingsUpdate::AutoScalingSettingsUpdate{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicyUpdate, } => AutoScalingRoleArn,
                                    }
                                }
                                /// Returns a borrow of the field ScalingPolicyUpdate
                                pub fn ScalingPolicyUpdate(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingPolicyUpdate>>> {
                                    match self {
                                        AutoScalingSettingsUpdate::AutoScalingSettingsUpdate{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicyUpdate, } => ScalingPolicyUpdate,
                                    }
                                }
                            }

                            impl Debug
                                for AutoScalingSettingsUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AutoScalingSettingsUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AutoScalingSettingsUpdate::AutoScalingSettingsUpdate{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicyUpdate, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingSettingsUpdate.AutoScalingSettingsUpdate(")?;
                                            DafnyPrint::fmt_print(MinimumUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MaximumUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AutoScalingDisabled, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AutoScalingRoleArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ScalingPolicyUpdate, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for AutoScalingSettingsUpdate {}

                            impl Hash
                                for AutoScalingSettingsUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AutoScalingSettingsUpdate::AutoScalingSettingsUpdate{MinimumUnits, MaximumUnits, AutoScalingDisabled, AutoScalingRoleArn, ScalingPolicyUpdate, } => {
                                            Hash::hash(MinimumUnits, _state);
                                            Hash::hash(MaximumUnits, _state);
                                            Hash::hash(AutoScalingDisabled, _state);
                                            Hash::hash(AutoScalingRoleArn, _state);
                                            Hash::hash(ScalingPolicyUpdate, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for AutoScalingSettingsUpdate {
                                fn default() -> AutoScalingSettingsUpdate {
                                    AutoScalingSettingsUpdate::AutoScalingSettingsUpdate {
                                        MinimumUnits: Default::default(),
                                        MaximumUnits: Default::default(),
                                        AutoScalingDisabled: Default::default(),
                                        AutoScalingRoleArn: Default::default(),
                                        ScalingPolicyUpdate: Default::default()
                                    }
                                }
                            }

                            impl AsRef<AutoScalingSettingsUpdate>
                                for AutoScalingSettingsUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(90,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
                                AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
                                    DisableScaleIn: Arc<Option<bool>>,
                                    ScaleInCooldown: Arc<Option<i32>>,
                                    ScaleOutCooldown: Arc<Option<i32>>,
                                    TargetValue: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DoubleObject
                                }
                            }

                            impl AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
                                /// Returns a borrow of the field DisableScaleIn
                                pub fn DisableScaleIn(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationDescription::AutoScalingTargetTrackingScalingPolicyConfigurationDescription{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => DisableScaleIn,
                                    }
                                }
                                /// Returns a borrow of the field ScaleInCooldown
                                pub fn ScaleInCooldown(&self) -> &Arc<Option<i32>> {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationDescription::AutoScalingTargetTrackingScalingPolicyConfigurationDescription{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => ScaleInCooldown,
                                    }
                                }
                                /// Returns a borrow of the field ScaleOutCooldown
                                pub fn ScaleOutCooldown(&self) -> &Arc<Option<i32>> {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationDescription::AutoScalingTargetTrackingScalingPolicyConfigurationDescription{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => ScaleOutCooldown,
                                    }
                                }
                                /// Returns a borrow of the field TargetValue
                                pub fn TargetValue(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DoubleObject {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationDescription::AutoScalingTargetTrackingScalingPolicyConfigurationDescription{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => TargetValue,
                                    }
                                }
                            }

                            impl Debug
                                for AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationDescription::AutoScalingTargetTrackingScalingPolicyConfigurationDescription{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription.AutoScalingTargetTrackingScalingPolicyConfigurationDescription(")?;
                                            DafnyPrint::fmt_print(DisableScaleIn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ScaleInCooldown, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ScaleOutCooldown, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TargetValue, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for AutoScalingTargetTrackingScalingPolicyConfigurationDescription {}

                            impl Hash
                                for AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationDescription::AutoScalingTargetTrackingScalingPolicyConfigurationDescription{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => {
                                            Hash::hash(DisableScaleIn, _state);
                                            Hash::hash(ScaleInCooldown, _state);
                                            Hash::hash(ScaleOutCooldown, _state);
                                            Hash::hash(TargetValue, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
                                fn default() -> AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
                                    AutoScalingTargetTrackingScalingPolicyConfigurationDescription::AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
                                        DisableScaleIn: Default::default(),
                                        ScaleInCooldown: Default::default(),
                                        ScaleOutCooldown: Default::default(),
                                        TargetValue: Default::default()
                                    }
                                }
                            }

                            impl AsRef<AutoScalingTargetTrackingScalingPolicyConfigurationDescription>
                                for AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(96,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
                                AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
                                    DisableScaleIn: Arc<Option<bool>>,
                                    ScaleInCooldown: Arc<Option<i32>>,
                                    ScaleOutCooldown: Arc<Option<i32>>,
                                    TargetValue: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DoubleObject
                                }
                            }

                            impl AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
                                /// Returns a borrow of the field DisableScaleIn
                                pub fn DisableScaleIn(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationUpdate::AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => DisableScaleIn,
                                    }
                                }
                                /// Returns a borrow of the field ScaleInCooldown
                                pub fn ScaleInCooldown(&self) -> &Arc<Option<i32>> {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationUpdate::AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => ScaleInCooldown,
                                    }
                                }
                                /// Returns a borrow of the field ScaleOutCooldown
                                pub fn ScaleOutCooldown(&self) -> &Arc<Option<i32>> {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationUpdate::AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => ScaleOutCooldown,
                                    }
                                }
                                /// Returns a borrow of the field TargetValue
                                pub fn TargetValue(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DoubleObject {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationUpdate::AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => TargetValue,
                                    }
                                }
                            }

                            impl Debug
                                for AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationUpdate::AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate(")?;
                                            DafnyPrint::fmt_print(DisableScaleIn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ScaleInCooldown, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ScaleOutCooldown, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TargetValue, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {}

                            impl Hash
                                for AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AutoScalingTargetTrackingScalingPolicyConfigurationUpdate::AutoScalingTargetTrackingScalingPolicyConfigurationUpdate{DisableScaleIn, ScaleInCooldown, ScaleOutCooldown, TargetValue, } => {
                                            Hash::hash(DisableScaleIn, _state);
                                            Hash::hash(ScaleInCooldown, _state);
                                            Hash::hash(ScaleOutCooldown, _state);
                                            Hash::hash(TargetValue, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
                                fn default() -> AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
                                    AutoScalingTargetTrackingScalingPolicyConfigurationUpdate::AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
                                        DisableScaleIn: Default::default(),
                                        ScaleInCooldown: Default::default(),
                                        ScaleOutCooldown: Default::default(),
                                        TargetValue: Default::default()
                                    }
                                }
                            }

                            impl AsRef<AutoScalingTargetTrackingScalingPolicyConfigurationUpdate>
                                for AutoScalingTargetTrackingScalingPolicyConfigurationUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(103,3)
                            pub type BackupArn = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(107,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BackupDescription {
                                BackupDescription {
                                    BackupDetails: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupDetails>>>,
                                    SourceTableDetails: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SourceTableDetails>>>,
                                    SourceTableFeatureDetails: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SourceTableFeatureDetails>>>
                                }
                            }

                            impl BackupDescription {
                                /// Returns a borrow of the field BackupDetails
                                pub fn BackupDetails(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupDetails>>> {
                                    match self {
                                        BackupDescription::BackupDescription{BackupDetails, SourceTableDetails, SourceTableFeatureDetails, } => BackupDetails,
                                    }
                                }
                                /// Returns a borrow of the field SourceTableDetails
                                pub fn SourceTableDetails(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SourceTableDetails>>> {
                                    match self {
                                        BackupDescription::BackupDescription{BackupDetails, SourceTableDetails, SourceTableFeatureDetails, } => SourceTableDetails,
                                    }
                                }
                                /// Returns a borrow of the field SourceTableFeatureDetails
                                pub fn SourceTableFeatureDetails(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SourceTableFeatureDetails>>> {
                                    match self {
                                        BackupDescription::BackupDescription{BackupDetails, SourceTableDetails, SourceTableFeatureDetails, } => SourceTableFeatureDetails,
                                    }
                                }
                            }

                            impl Debug
                                for BackupDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BackupDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BackupDescription::BackupDescription{BackupDetails, SourceTableDetails, SourceTableFeatureDetails, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupDescription.BackupDescription(")?;
                                            DafnyPrint::fmt_print(BackupDetails, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SourceTableDetails, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SourceTableFeatureDetails, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BackupDescription {}

                            impl Hash
                                for BackupDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BackupDescription::BackupDescription{BackupDetails, SourceTableDetails, SourceTableFeatureDetails, } => {
                                            Hash::hash(BackupDetails, _state);
                                            Hash::hash(SourceTableDetails, _state);
                                            Hash::hash(SourceTableFeatureDetails, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BackupDescription {
                                fn default() -> BackupDescription {
                                    BackupDescription::BackupDescription {
                                        BackupDetails: Default::default(),
                                        SourceTableDetails: Default::default(),
                                        SourceTableFeatureDetails: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BackupDescription>
                                for BackupDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(112,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BackupDetails {
                                BackupDetails {
                                    BackupArn: Sequence<DafnyCharUTF16>,
                                    BackupName: Sequence<DafnyCharUTF16>,
                                    BackupSizeBytes: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupSizeBytes>>,
                                    BackupStatus: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupStatus>,
                                    BackupType: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupType>,
                                    BackupCreationDateTime: Sequence<DafnyCharUTF16>,
                                    BackupExpiryDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl BackupDetails {
                                /// Returns a borrow of the field BackupArn
                                pub fn BackupArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        BackupDetails::BackupDetails{BackupArn, BackupName, BackupSizeBytes, BackupStatus, BackupType, BackupCreationDateTime, BackupExpiryDateTime, } => BackupArn,
                                    }
                                }
                                /// Returns a borrow of the field BackupName
                                pub fn BackupName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        BackupDetails::BackupDetails{BackupArn, BackupName, BackupSizeBytes, BackupStatus, BackupType, BackupCreationDateTime, BackupExpiryDateTime, } => BackupName,
                                    }
                                }
                                /// Returns a borrow of the field BackupSizeBytes
                                pub fn BackupSizeBytes(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupSizeBytes>> {
                                    match self {
                                        BackupDetails::BackupDetails{BackupArn, BackupName, BackupSizeBytes, BackupStatus, BackupType, BackupCreationDateTime, BackupExpiryDateTime, } => BackupSizeBytes,
                                    }
                                }
                                /// Returns a borrow of the field BackupStatus
                                pub fn BackupStatus(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupStatus> {
                                    match self {
                                        BackupDetails::BackupDetails{BackupArn, BackupName, BackupSizeBytes, BackupStatus, BackupType, BackupCreationDateTime, BackupExpiryDateTime, } => BackupStatus,
                                    }
                                }
                                /// Returns a borrow of the field BackupType
                                pub fn BackupType(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupType> {
                                    match self {
                                        BackupDetails::BackupDetails{BackupArn, BackupName, BackupSizeBytes, BackupStatus, BackupType, BackupCreationDateTime, BackupExpiryDateTime, } => BackupType,
                                    }
                                }
                                /// Returns a borrow of the field BackupCreationDateTime
                                pub fn BackupCreationDateTime(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        BackupDetails::BackupDetails{BackupArn, BackupName, BackupSizeBytes, BackupStatus, BackupType, BackupCreationDateTime, BackupExpiryDateTime, } => BackupCreationDateTime,
                                    }
                                }
                                /// Returns a borrow of the field BackupExpiryDateTime
                                pub fn BackupExpiryDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BackupDetails::BackupDetails{BackupArn, BackupName, BackupSizeBytes, BackupStatus, BackupType, BackupCreationDateTime, BackupExpiryDateTime, } => BackupExpiryDateTime,
                                    }
                                }
                            }

                            impl Debug
                                for BackupDetails {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BackupDetails {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BackupDetails::BackupDetails{BackupArn, BackupName, BackupSizeBytes, BackupStatus, BackupType, BackupCreationDateTime, BackupExpiryDateTime, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupDetails.BackupDetails(")?;
                                            DafnyPrint::fmt_print(BackupArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupSizeBytes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupCreationDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupExpiryDateTime, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BackupDetails {}

                            impl Hash
                                for BackupDetails {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BackupDetails::BackupDetails{BackupArn, BackupName, BackupSizeBytes, BackupStatus, BackupType, BackupCreationDateTime, BackupExpiryDateTime, } => {
                                            Hash::hash(BackupArn, _state);
                                            Hash::hash(BackupName, _state);
                                            Hash::hash(BackupSizeBytes, _state);
                                            Hash::hash(BackupStatus, _state);
                                            Hash::hash(BackupType, _state);
                                            Hash::hash(BackupCreationDateTime, _state);
                                            Hash::hash(BackupExpiryDateTime, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BackupDetails {
                                fn default() -> BackupDetails {
                                    BackupDetails::BackupDetails {
                                        BackupArn: Default::default(),
                                        BackupName: Default::default(),
                                        BackupSizeBytes: Default::default(),
                                        BackupStatus: Default::default(),
                                        BackupType: Default::default(),
                                        BackupCreationDateTime: Default::default(),
                                        BackupExpiryDateTime: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BackupDetails>
                                for BackupDetails {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(121,3)
                            pub type BackupName = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(125,3)
                            pub type BackupsInputLimit = i32;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(129,3)
                            pub type BackupSizeBytes = i64;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(133,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BackupStatus {
                                CREATING {},
                                DELETED {},
                                AVAILABLE {}
                            }

                            impl BackupStatus {}

                            impl Debug
                                for BackupStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BackupStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BackupStatus::CREATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupStatus.CREATING")?;
                                            Ok(())
                                        },
                                        BackupStatus::DELETED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupStatus.DELETED")?;
                                            Ok(())
                                        },
                                        BackupStatus::AVAILABLE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupStatus.AVAILABLE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl BackupStatus {
                                /// Enumerates all possible values of BackupStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<BackupStatus>> {
                                    seq![Arc::new(BackupStatus::CREATING {}), Arc::new(BackupStatus::DELETED {}), Arc::new(BackupStatus::AVAILABLE {})].iter()
                                }
                            }

                            impl Eq
                                for BackupStatus {}

                            impl Hash
                                for BackupStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BackupStatus::CREATING{} => {

                                        },
                                        BackupStatus::DELETED{} => {

                                        },
                                        BackupStatus::AVAILABLE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for BackupStatus {
                                fn default() -> BackupStatus {
                                    BackupStatus::CREATING {}
                                }
                            }

                            impl AsRef<BackupStatus>
                                for BackupStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(138,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BackupSummary {
                                BackupSummary {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TableId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    BackupArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    BackupName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    BackupCreationDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    BackupExpiryDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    BackupStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupStatus>>>,
                                    BackupType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupType>>>,
                                    BackupSizeBytes: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupSizeBytes>>
                                }
                            }

                            impl BackupSummary {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field TableId
                                pub fn TableId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => TableId,
                                    }
                                }
                                /// Returns a borrow of the field TableArn
                                pub fn TableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => TableArn,
                                    }
                                }
                                /// Returns a borrow of the field BackupArn
                                pub fn BackupArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => BackupArn,
                                    }
                                }
                                /// Returns a borrow of the field BackupName
                                pub fn BackupName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => BackupName,
                                    }
                                }
                                /// Returns a borrow of the field BackupCreationDateTime
                                pub fn BackupCreationDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => BackupCreationDateTime,
                                    }
                                }
                                /// Returns a borrow of the field BackupExpiryDateTime
                                pub fn BackupExpiryDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => BackupExpiryDateTime,
                                    }
                                }
                                /// Returns a borrow of the field BackupStatus
                                pub fn BackupStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupStatus>>> {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => BackupStatus,
                                    }
                                }
                                /// Returns a borrow of the field BackupType
                                pub fn BackupType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupType>>> {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => BackupType,
                                    }
                                }
                                /// Returns a borrow of the field BackupSizeBytes
                                pub fn BackupSizeBytes(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupSizeBytes>> {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => BackupSizeBytes,
                                    }
                                }
                            }

                            impl Debug
                                for BackupSummary {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BackupSummary {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupSummary.BackupSummary(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupCreationDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupExpiryDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupSizeBytes, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BackupSummary {}

                            impl Hash
                                for BackupSummary {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BackupSummary::BackupSummary{TableName, TableId, TableArn, BackupArn, BackupName, BackupCreationDateTime, BackupExpiryDateTime, BackupStatus, BackupType, BackupSizeBytes, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(TableId, _state);
                                            Hash::hash(TableArn, _state);
                                            Hash::hash(BackupArn, _state);
                                            Hash::hash(BackupName, _state);
                                            Hash::hash(BackupCreationDateTime, _state);
                                            Hash::hash(BackupExpiryDateTime, _state);
                                            Hash::hash(BackupStatus, _state);
                                            Hash::hash(BackupType, _state);
                                            Hash::hash(BackupSizeBytes, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BackupSummary {
                                fn default() -> BackupSummary {
                                    BackupSummary::BackupSummary {
                                        TableName: Default::default(),
                                        TableId: Default::default(),
                                        TableArn: Default::default(),
                                        BackupArn: Default::default(),
                                        BackupName: Default::default(),
                                        BackupCreationDateTime: Default::default(),
                                        BackupExpiryDateTime: Default::default(),
                                        BackupStatus: Default::default(),
                                        BackupType: Default::default(),
                                        BackupSizeBytes: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BackupSummary>
                                for BackupSummary {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(150,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BackupType {
                                USER {},
                                SYSTEM {},
                                AWS_BACKUP {}
                            }

                            impl BackupType {}

                            impl Debug
                                for BackupType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BackupType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BackupType::USER{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupType.USER")?;
                                            Ok(())
                                        },
                                        BackupType::SYSTEM{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupType.SYSTEM")?;
                                            Ok(())
                                        },
                                        BackupType::AWS_BACKUP{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupType.AWS__BACKUP")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl BackupType {
                                /// Enumerates all possible values of BackupType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<BackupType>> {
                                    seq![Arc::new(BackupType::USER {}), Arc::new(BackupType::SYSTEM {}), Arc::new(BackupType::AWS_BACKUP {})].iter()
                                }
                            }

                            impl Eq
                                for BackupType {}

                            impl Hash
                                for BackupType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BackupType::USER{} => {

                                        },
                                        BackupType::SYSTEM{} => {

                                        },
                                        BackupType::AWS_BACKUP{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for BackupType {
                                fn default() -> BackupType {
                                    BackupType::USER {}
                                }
                            }

                            impl AsRef<BackupType>
                                for BackupType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(154,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BackupTypeFilter {
                                USER {},
                                SYSTEM {},
                                AWS_BACKUP {},
                                ALL {}
                            }

                            impl BackupTypeFilter {}

                            impl Debug
                                for BackupTypeFilter {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BackupTypeFilter {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BackupTypeFilter::USER{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupTypeFilter.USER")?;
                                            Ok(())
                                        },
                                        BackupTypeFilter::SYSTEM{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupTypeFilter.SYSTEM")?;
                                            Ok(())
                                        },
                                        BackupTypeFilter::AWS_BACKUP{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupTypeFilter.AWS__BACKUP")?;
                                            Ok(())
                                        },
                                        BackupTypeFilter::ALL{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupTypeFilter.ALL")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl BackupTypeFilter {
                                /// Enumerates all possible values of BackupTypeFilter
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<BackupTypeFilter>> {
                                    seq![Arc::new(BackupTypeFilter::USER {}), Arc::new(BackupTypeFilter::SYSTEM {}), Arc::new(BackupTypeFilter::AWS_BACKUP {}), Arc::new(BackupTypeFilter::ALL {})].iter()
                                }
                            }

                            impl Eq
                                for BackupTypeFilter {}

                            impl Hash
                                for BackupTypeFilter {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BackupTypeFilter::USER{} => {

                                        },
                                        BackupTypeFilter::SYSTEM{} => {

                                        },
                                        BackupTypeFilter::AWS_BACKUP{} => {

                                        },
                                        BackupTypeFilter::ALL{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for BackupTypeFilter {
                                fn default() -> BackupTypeFilter {
                                    BackupTypeFilter::USER {}
                                }
                            }

                            impl AsRef<BackupTypeFilter>
                                for BackupTypeFilter {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(159,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BatchExecuteStatementInput {
                                BatchExecuteStatementInput {
                                    Statements: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PartiQLBatchRequest,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>
                                }
                            }

                            impl BatchExecuteStatementInput {
                                /// Returns a borrow of the field Statements
                                pub fn Statements(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PartiQLBatchRequest {
                                    match self {
                                        BatchExecuteStatementInput::BatchExecuteStatementInput{Statements, ReturnConsumedCapacity, } => Statements,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        BatchExecuteStatementInput::BatchExecuteStatementInput{Statements, ReturnConsumedCapacity, } => ReturnConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for BatchExecuteStatementInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BatchExecuteStatementInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BatchExecuteStatementInput::BatchExecuteStatementInput{Statements, ReturnConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchExecuteStatementInput.BatchExecuteStatementInput(")?;
                                            DafnyPrint::fmt_print(Statements, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BatchExecuteStatementInput {}

                            impl Hash
                                for BatchExecuteStatementInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BatchExecuteStatementInput::BatchExecuteStatementInput{Statements, ReturnConsumedCapacity, } => {
                                            Hash::hash(Statements, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BatchExecuteStatementInput {
                                fn default() -> BatchExecuteStatementInput {
                                    BatchExecuteStatementInput::BatchExecuteStatementInput {
                                        Statements: Default::default(),
                                        ReturnConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BatchExecuteStatementInput>
                                for BatchExecuteStatementInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(163,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BatchExecuteStatementOutput {
                                BatchExecuteStatementOutput {
                                    Responses: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementResponse>>>>,
                                    ConsumedCapacity: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>>
                                }
                            }

                            impl BatchExecuteStatementOutput {
                                /// Returns a borrow of the field Responses
                                pub fn Responses(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementResponse>>>> {
                                    match self {
                                        BatchExecuteStatementOutput::BatchExecuteStatementOutput{Responses, ConsumedCapacity, } => Responses,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>> {
                                    match self {
                                        BatchExecuteStatementOutput::BatchExecuteStatementOutput{Responses, ConsumedCapacity, } => ConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for BatchExecuteStatementOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BatchExecuteStatementOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BatchExecuteStatementOutput::BatchExecuteStatementOutput{Responses, ConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchExecuteStatementOutput.BatchExecuteStatementOutput(")?;
                                            DafnyPrint::fmt_print(Responses, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BatchExecuteStatementOutput {}

                            impl Hash
                                for BatchExecuteStatementOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BatchExecuteStatementOutput::BatchExecuteStatementOutput{Responses, ConsumedCapacity, } => {
                                            Hash::hash(Responses, _state);
                                            Hash::hash(ConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BatchExecuteStatementOutput {
                                fn default() -> BatchExecuteStatementOutput {
                                    BatchExecuteStatementOutput::BatchExecuteStatementOutput {
                                        Responses: Default::default(),
                                        ConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BatchExecuteStatementOutput>
                                for BatchExecuteStatementOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(167,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BatchGetItemInput {
                                BatchGetItemInput {
                                    RequestItems: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetRequestMap,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>
                                }
                            }

                            impl BatchGetItemInput {
                                /// Returns a borrow of the field RequestItems
                                pub fn RequestItems(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetRequestMap {
                                    match self {
                                        BatchGetItemInput::BatchGetItemInput{RequestItems, ReturnConsumedCapacity, } => RequestItems,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        BatchGetItemInput::BatchGetItemInput{RequestItems, ReturnConsumedCapacity, } => ReturnConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for BatchGetItemInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BatchGetItemInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BatchGetItemInput::BatchGetItemInput{RequestItems, ReturnConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchGetItemInput.BatchGetItemInput(")?;
                                            DafnyPrint::fmt_print(RequestItems, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BatchGetItemInput {}

                            impl Hash
                                for BatchGetItemInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BatchGetItemInput::BatchGetItemInput{RequestItems, ReturnConsumedCapacity, } => {
                                            Hash::hash(RequestItems, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BatchGetItemInput {
                                fn default() -> BatchGetItemInput {
                                    BatchGetItemInput::BatchGetItemInput {
                                        RequestItems: Default::default(),
                                        ReturnConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BatchGetItemInput>
                                for BatchGetItemInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(171,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BatchGetItemOutput {
                                BatchGetItemOutput {
                                    Responses: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>>>,
                                    UnprocessedKeys: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetRequestMap>>,
                                    ConsumedCapacity: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>>
                                }
                            }

                            impl BatchGetItemOutput {
                                /// Returns a borrow of the field Responses
                                pub fn Responses(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>>> {
                                    match self {
                                        BatchGetItemOutput::BatchGetItemOutput{Responses, UnprocessedKeys, ConsumedCapacity, } => Responses,
                                    }
                                }
                                /// Returns a borrow of the field UnprocessedKeys
                                pub fn UnprocessedKeys(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetRequestMap>> {
                                    match self {
                                        BatchGetItemOutput::BatchGetItemOutput{Responses, UnprocessedKeys, ConsumedCapacity, } => UnprocessedKeys,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>> {
                                    match self {
                                        BatchGetItemOutput::BatchGetItemOutput{Responses, UnprocessedKeys, ConsumedCapacity, } => ConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for BatchGetItemOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BatchGetItemOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BatchGetItemOutput::BatchGetItemOutput{Responses, UnprocessedKeys, ConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchGetItemOutput.BatchGetItemOutput(")?;
                                            DafnyPrint::fmt_print(Responses, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(UnprocessedKeys, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BatchGetItemOutput {}

                            impl Hash
                                for BatchGetItemOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BatchGetItemOutput::BatchGetItemOutput{Responses, UnprocessedKeys, ConsumedCapacity, } => {
                                            Hash::hash(Responses, _state);
                                            Hash::hash(UnprocessedKeys, _state);
                                            Hash::hash(ConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BatchGetItemOutput {
                                fn default() -> BatchGetItemOutput {
                                    BatchGetItemOutput::BatchGetItemOutput {
                                        Responses: Default::default(),
                                        UnprocessedKeys: Default::default(),
                                        ConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BatchGetItemOutput>
                                for BatchGetItemOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(176,3)
                            pub type BatchGetRequestMap = Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeysAndAttributes>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(181,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BatchStatementError {
                                BatchStatementError {
                                    Code: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum>>>,
                                    Message: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Item: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>
                                }
                            }

                            impl BatchStatementError {
                                /// Returns a borrow of the field Code
                                pub fn Code(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementErrorCodeEnum>>> {
                                    match self {
                                        BatchStatementError::BatchStatementError{Code, Message, Item, } => Code,
                                    }
                                }
                                /// Returns a borrow of the field Message
                                pub fn Message(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BatchStatementError::BatchStatementError{Code, Message, Item, } => Message,
                                    }
                                }
                                /// Returns a borrow of the field Item
                                pub fn Item(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        BatchStatementError::BatchStatementError{Code, Message, Item, } => Item,
                                    }
                                }
                            }

                            impl Debug
                                for BatchStatementError {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BatchStatementError {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BatchStatementError::BatchStatementError{Code, Message, Item, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementError.BatchStatementError(")?;
                                            DafnyPrint::fmt_print(Code, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Message, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Item, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BatchStatementError {}

                            impl Hash
                                for BatchStatementError {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BatchStatementError::BatchStatementError{Code, Message, Item, } => {
                                            Hash::hash(Code, _state);
                                            Hash::hash(Message, _state);
                                            Hash::hash(Item, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BatchStatementError {
                                fn default() -> BatchStatementError {
                                    BatchStatementError::BatchStatementError {
                                        Code: Default::default(),
                                        Message: Default::default(),
                                        Item: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BatchStatementError>
                                for BatchStatementError {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(186,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BatchStatementErrorCodeEnum {
                                ConditionalCheckFailed {},
                                ItemCollectionSizeLimitExceeded {},
                                RequestLimitExceeded {},
                                ValidationError {},
                                ProvisionedThroughputExceeded {},
                                TransactionConflict {},
                                ThrottlingError {},
                                InternalServerError {},
                                ResourceNotFound {},
                                AccessDenied {},
                                DuplicateItem {}
                            }

                            impl BatchStatementErrorCodeEnum {}

                            impl Debug
                                for BatchStatementErrorCodeEnum {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BatchStatementErrorCodeEnum {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BatchStatementErrorCodeEnum::ConditionalCheckFailed{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.ConditionalCheckFailed")?;
                                            Ok(())
                                        },
                                        BatchStatementErrorCodeEnum::ItemCollectionSizeLimitExceeded{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.ItemCollectionSizeLimitExceeded")?;
                                            Ok(())
                                        },
                                        BatchStatementErrorCodeEnum::RequestLimitExceeded{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.RequestLimitExceeded")?;
                                            Ok(())
                                        },
                                        BatchStatementErrorCodeEnum::ValidationError{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.ValidationError")?;
                                            Ok(())
                                        },
                                        BatchStatementErrorCodeEnum::ProvisionedThroughputExceeded{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.ProvisionedThroughputExceeded")?;
                                            Ok(())
                                        },
                                        BatchStatementErrorCodeEnum::TransactionConflict{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.TransactionConflict")?;
                                            Ok(())
                                        },
                                        BatchStatementErrorCodeEnum::ThrottlingError{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.ThrottlingError")?;
                                            Ok(())
                                        },
                                        BatchStatementErrorCodeEnum::InternalServerError{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.InternalServerError")?;
                                            Ok(())
                                        },
                                        BatchStatementErrorCodeEnum::ResourceNotFound{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.ResourceNotFound")?;
                                            Ok(())
                                        },
                                        BatchStatementErrorCodeEnum::AccessDenied{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.AccessDenied")?;
                                            Ok(())
                                        },
                                        BatchStatementErrorCodeEnum::DuplicateItem{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.DuplicateItem")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl BatchStatementErrorCodeEnum {
                                /// Enumerates all possible values of BatchStatementErrorCodeEnum
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<BatchStatementErrorCodeEnum>> {
                                    seq![Arc::new(BatchStatementErrorCodeEnum::ConditionalCheckFailed {}), Arc::new(BatchStatementErrorCodeEnum::ItemCollectionSizeLimitExceeded {}), Arc::new(BatchStatementErrorCodeEnum::RequestLimitExceeded {}), Arc::new(BatchStatementErrorCodeEnum::ValidationError {}), Arc::new(BatchStatementErrorCodeEnum::ProvisionedThroughputExceeded {}), Arc::new(BatchStatementErrorCodeEnum::TransactionConflict {}), Arc::new(BatchStatementErrorCodeEnum::ThrottlingError {}), Arc::new(BatchStatementErrorCodeEnum::InternalServerError {}), Arc::new(BatchStatementErrorCodeEnum::ResourceNotFound {}), Arc::new(BatchStatementErrorCodeEnum::AccessDenied {}), Arc::new(BatchStatementErrorCodeEnum::DuplicateItem {})].iter()
                                }
                            }

                            impl Eq
                                for BatchStatementErrorCodeEnum {}

                            impl Hash
                                for BatchStatementErrorCodeEnum {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BatchStatementErrorCodeEnum::ConditionalCheckFailed{} => {

                                        },
                                        BatchStatementErrorCodeEnum::ItemCollectionSizeLimitExceeded{} => {

                                        },
                                        BatchStatementErrorCodeEnum::RequestLimitExceeded{} => {

                                        },
                                        BatchStatementErrorCodeEnum::ValidationError{} => {

                                        },
                                        BatchStatementErrorCodeEnum::ProvisionedThroughputExceeded{} => {

                                        },
                                        BatchStatementErrorCodeEnum::TransactionConflict{} => {

                                        },
                                        BatchStatementErrorCodeEnum::ThrottlingError{} => {

                                        },
                                        BatchStatementErrorCodeEnum::InternalServerError{} => {

                                        },
                                        BatchStatementErrorCodeEnum::ResourceNotFound{} => {

                                        },
                                        BatchStatementErrorCodeEnum::AccessDenied{} => {

                                        },
                                        BatchStatementErrorCodeEnum::DuplicateItem{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for BatchStatementErrorCodeEnum {
                                fn default() -> BatchStatementErrorCodeEnum {
                                    BatchStatementErrorCodeEnum::ConditionalCheckFailed {}
                                }
                            }

                            impl AsRef<BatchStatementErrorCodeEnum>
                                for BatchStatementErrorCodeEnum {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(198,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BatchStatementRequest {
                                BatchStatementRequest {
                                    Statement: Sequence<DafnyCharUTF16>,
                                    Parameters: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PreparedStatementParameters>>,
                                    ConsistentRead: Arc<Option<bool>>,
                                    ReturnValuesOnConditionCheckFailure: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>>
                                }
                            }

                            impl BatchStatementRequest {
                                /// Returns a borrow of the field Statement
                                pub fn Statement(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => Statement,
                                    }
                                }
                                /// Returns a borrow of the field Parameters
                                pub fn Parameters(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PreparedStatementParameters>> {
                                    match self {
                                        BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => Parameters,
                                    }
                                }
                                /// Returns a borrow of the field ConsistentRead
                                pub fn ConsistentRead(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => ConsistentRead,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure
                                pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>> {
                                    match self {
                                        BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure,
                                    }
                                }
                            }

                            impl Debug
                                for BatchStatementRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BatchStatementRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementRequest.BatchStatementRequest(")?;
                                            DafnyPrint::fmt_print(Statement, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Parameters, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsistentRead, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BatchStatementRequest {}

                            impl Hash
                                for BatchStatementRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BatchStatementRequest::BatchStatementRequest{Statement, Parameters, ConsistentRead, ReturnValuesOnConditionCheckFailure, } => {
                                            Hash::hash(Statement, _state);
                                            Hash::hash(Parameters, _state);
                                            Hash::hash(ConsistentRead, _state);
                                            Hash::hash(ReturnValuesOnConditionCheckFailure, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BatchStatementRequest {
                                fn default() -> BatchStatementRequest {
                                    BatchStatementRequest::BatchStatementRequest {
                                        Statement: Default::default(),
                                        Parameters: Default::default(),
                                        ConsistentRead: Default::default(),
                                        ReturnValuesOnConditionCheckFailure: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BatchStatementRequest>
                                for BatchStatementRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(204,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BatchStatementResponse {
                                BatchStatementResponse {
                                    Error: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementError>>>,
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Item: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>
                                }
                            }

                            impl BatchStatementResponse {
                                /// Returns a borrow of the field Error
                                pub fn Error(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementError>>> {
                                    match self {
                                        BatchStatementResponse::BatchStatementResponse{Error, TableName, Item, } => Error,
                                    }
                                }
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BatchStatementResponse::BatchStatementResponse{Error, TableName, Item, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field Item
                                pub fn Item(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        BatchStatementResponse::BatchStatementResponse{Error, TableName, Item, } => Item,
                                    }
                                }
                            }

                            impl Debug
                                for BatchStatementResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BatchStatementResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BatchStatementResponse::BatchStatementResponse{Error, TableName, Item, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementResponse.BatchStatementResponse(")?;
                                            DafnyPrint::fmt_print(Error, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Item, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BatchStatementResponse {}

                            impl Hash
                                for BatchStatementResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BatchStatementResponse::BatchStatementResponse{Error, TableName, Item, } => {
                                            Hash::hash(Error, _state);
                                            Hash::hash(TableName, _state);
                                            Hash::hash(Item, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BatchStatementResponse {
                                fn default() -> BatchStatementResponse {
                                    BatchStatementResponse::BatchStatementResponse {
                                        Error: Default::default(),
                                        TableName: Default::default(),
                                        Item: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BatchStatementResponse>
                                for BatchStatementResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(209,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BatchWriteItemInput {
                                BatchWriteItemInput {
                                    RequestItems: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchWriteItemRequestMap,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>,
                                    ReturnItemCollectionMetrics: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics>>>
                                }
                            }

                            impl BatchWriteItemInput {
                                /// Returns a borrow of the field RequestItems
                                pub fn RequestItems(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchWriteItemRequestMap {
                                    match self {
                                        BatchWriteItemInput::BatchWriteItemInput{RequestItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, } => RequestItems,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        BatchWriteItemInput::BatchWriteItemInput{RequestItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, } => ReturnConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ReturnItemCollectionMetrics
                                pub fn ReturnItemCollectionMetrics(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics>>> {
                                    match self {
                                        BatchWriteItemInput::BatchWriteItemInput{RequestItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, } => ReturnItemCollectionMetrics,
                                    }
                                }
                            }

                            impl Debug
                                for BatchWriteItemInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BatchWriteItemInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BatchWriteItemInput::BatchWriteItemInput{RequestItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchWriteItemInput.BatchWriteItemInput(")?;
                                            DafnyPrint::fmt_print(RequestItems, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnItemCollectionMetrics, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BatchWriteItemInput {}

                            impl Hash
                                for BatchWriteItemInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BatchWriteItemInput::BatchWriteItemInput{RequestItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, } => {
                                            Hash::hash(RequestItems, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state);
                                            Hash::hash(ReturnItemCollectionMetrics, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BatchWriteItemInput {
                                fn default() -> BatchWriteItemInput {
                                    BatchWriteItemInput::BatchWriteItemInput {
                                        RequestItems: Default::default(),
                                        ReturnConsumedCapacity: Default::default(),
                                        ReturnItemCollectionMetrics: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BatchWriteItemInput>
                                for BatchWriteItemInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(214,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BatchWriteItemOutput {
                                BatchWriteItemOutput {
                                    UnprocessedItems: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchWriteItemRequestMap>>,
                                    ItemCollectionMetrics: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics>>>>>,
                                    ConsumedCapacity: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>>
                                }
                            }

                            impl BatchWriteItemOutput {
                                /// Returns a borrow of the field UnprocessedItems
                                pub fn UnprocessedItems(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchWriteItemRequestMap>> {
                                    match self {
                                        BatchWriteItemOutput::BatchWriteItemOutput{UnprocessedItems, ItemCollectionMetrics, ConsumedCapacity, } => UnprocessedItems,
                                    }
                                }
                                /// Returns a borrow of the field ItemCollectionMetrics
                                pub fn ItemCollectionMetrics(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics>>>>> {
                                    match self {
                                        BatchWriteItemOutput::BatchWriteItemOutput{UnprocessedItems, ItemCollectionMetrics, ConsumedCapacity, } => ItemCollectionMetrics,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>> {
                                    match self {
                                        BatchWriteItemOutput::BatchWriteItemOutput{UnprocessedItems, ItemCollectionMetrics, ConsumedCapacity, } => ConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for BatchWriteItemOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BatchWriteItemOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BatchWriteItemOutput::BatchWriteItemOutput{UnprocessedItems, ItemCollectionMetrics, ConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchWriteItemOutput.BatchWriteItemOutput(")?;
                                            DafnyPrint::fmt_print(UnprocessedItems, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ItemCollectionMetrics, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BatchWriteItemOutput {}

                            impl Hash
                                for BatchWriteItemOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BatchWriteItemOutput::BatchWriteItemOutput{UnprocessedItems, ItemCollectionMetrics, ConsumedCapacity, } => {
                                            Hash::hash(UnprocessedItems, _state);
                                            Hash::hash(ItemCollectionMetrics, _state);
                                            Hash::hash(ConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BatchWriteItemOutput {
                                fn default() -> BatchWriteItemOutput {
                                    BatchWriteItemOutput::BatchWriteItemOutput {
                                        UnprocessedItems: Default::default(),
                                        ItemCollectionMetrics: Default::default(),
                                        ConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BatchWriteItemOutput>
                                for BatchWriteItemOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(219,3)
                            pub type BatchWriteItemRequestMap = Map<Sequence<DafnyCharUTF16>, crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::WriteRequests>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(223,3)
                            pub type BilledSizeBytes = i64;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(227,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BillingMode {
                                PROVISIONED {},
                                PAY_PER_REQUEST {}
                            }

                            impl BillingMode {}

                            impl Debug
                                for BillingMode {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BillingMode {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BillingMode::PROVISIONED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingMode.PROVISIONED")?;
                                            Ok(())
                                        },
                                        BillingMode::PAY_PER_REQUEST{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingMode.PAY__PER__REQUEST")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl BillingMode {
                                /// Enumerates all possible values of BillingMode
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<BillingMode>> {
                                    seq![Arc::new(BillingMode::PROVISIONED {}), Arc::new(BillingMode::PAY_PER_REQUEST {})].iter()
                                }
                            }

                            impl Eq
                                for BillingMode {}

                            impl Hash
                                for BillingMode {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BillingMode::PROVISIONED{} => {

                                        },
                                        BillingMode::PAY_PER_REQUEST{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for BillingMode {
                                fn default() -> BillingMode {
                                    BillingMode::PROVISIONED {}
                                }
                            }

                            impl AsRef<BillingMode>
                                for BillingMode {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(230,3)
                            #[derive(PartialEq, Clone)]
                            pub enum BillingModeSummary {
                                BillingModeSummary {
                                    BillingMode: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>>,
                                    LastUpdateToPayPerRequestDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl BillingModeSummary {
                                /// Returns a borrow of the field BillingMode
                                pub fn BillingMode(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>> {
                                    match self {
                                        BillingModeSummary::BillingModeSummary{BillingMode, LastUpdateToPayPerRequestDateTime, } => BillingMode,
                                    }
                                }
                                /// Returns a borrow of the field LastUpdateToPayPerRequestDateTime
                                pub fn LastUpdateToPayPerRequestDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        BillingModeSummary::BillingModeSummary{BillingMode, LastUpdateToPayPerRequestDateTime, } => LastUpdateToPayPerRequestDateTime,
                                    }
                                }
                            }

                            impl Debug
                                for BillingModeSummary {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for BillingModeSummary {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        BillingModeSummary::BillingModeSummary{BillingMode, LastUpdateToPayPerRequestDateTime, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingModeSummary.BillingModeSummary(")?;
                                            DafnyPrint::fmt_print(BillingMode, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastUpdateToPayPerRequestDateTime, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for BillingModeSummary {}

                            impl Hash
                                for BillingModeSummary {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        BillingModeSummary::BillingModeSummary{BillingMode, LastUpdateToPayPerRequestDateTime, } => {
                                            Hash::hash(BillingMode, _state);
                                            Hash::hash(LastUpdateToPayPerRequestDateTime, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for BillingModeSummary {
                                fn default() -> BillingModeSummary {
                                    BillingModeSummary::BillingModeSummary {
                                        BillingMode: Default::default(),
                                        LastUpdateToPayPerRequestDateTime: Default::default()
                                    }
                                }
                            }

                            impl AsRef<BillingModeSummary>
                                for BillingModeSummary {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(238,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CancellationReason {
                                CancellationReason {
                                    Item: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    Code: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl CancellationReason {
                                /// Returns a borrow of the field Item
                                pub fn Item(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        CancellationReason::CancellationReason{Item, Code, Message, } => Item,
                                    }
                                }
                                /// Returns a borrow of the field Code
                                pub fn Code(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CancellationReason::CancellationReason{Item, Code, Message, } => Code,
                                    }
                                }
                                /// Returns a borrow of the field Message
                                pub fn Message(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CancellationReason::CancellationReason{Item, Code, Message, } => Message,
                                    }
                                }
                            }

                            impl Debug
                                for CancellationReason {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CancellationReason {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CancellationReason::CancellationReason{Item, Code, Message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CancellationReason.CancellationReason(")?;
                                            DafnyPrint::fmt_print(Item, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Code, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CancellationReason {}

                            impl Hash
                                for CancellationReason {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CancellationReason::CancellationReason{Item, Code, Message, } => {
                                            Hash::hash(Item, _state);
                                            Hash::hash(Code, _state);
                                            Hash::hash(Message, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CancellationReason {
                                fn default() -> CancellationReason {
                                    CancellationReason::CancellationReason {
                                        Item: Default::default(),
                                        Code: Default::default(),
                                        Message: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CancellationReason>
                                for CancellationReason {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(243,3)
                            pub type CancellationReasonList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CancellationReason>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(247,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Capacity {
                                Capacity {
                                    ReadCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>>,
                                    WriteCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>>,
                                    CapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>>
                                }
                            }

                            impl Capacity {
                                /// Returns a borrow of the field ReadCapacityUnits
                                pub fn ReadCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>> {
                                    match self {
                                        Capacity::Capacity{ReadCapacityUnits, WriteCapacityUnits, CapacityUnits, } => ReadCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field WriteCapacityUnits
                                pub fn WriteCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>> {
                                    match self {
                                        Capacity::Capacity{ReadCapacityUnits, WriteCapacityUnits, CapacityUnits, } => WriteCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field CapacityUnits
                                pub fn CapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>> {
                                    match self {
                                        Capacity::Capacity{ReadCapacityUnits, WriteCapacityUnits, CapacityUnits, } => CapacityUnits,
                                    }
                                }
                            }

                            impl Debug
                                for Capacity {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Capacity {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Capacity::Capacity{ReadCapacityUnits, WriteCapacityUnits, CapacityUnits, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Capacity.Capacity(")?;
                                            DafnyPrint::fmt_print(ReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(WriteCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CapacityUnits, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Capacity {}

                            impl Hash
                                for Capacity {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Capacity::Capacity{ReadCapacityUnits, WriteCapacityUnits, CapacityUnits, } => {
                                            Hash::hash(ReadCapacityUnits, _state);
                                            Hash::hash(WriteCapacityUnits, _state);
                                            Hash::hash(CapacityUnits, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Capacity {
                                fn default() -> Capacity {
                                    Capacity::Capacity {
                                        ReadCapacityUnits: Default::default(),
                                        WriteCapacityUnits: Default::default(),
                                        CapacityUnits: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Capacity>
                                for Capacity {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(252,3)
                            pub type ClientRequestToken = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(257,3)
                            pub type CloudWatchLogGroupArn = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(262,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ComparisonOperator {
                                EQ {},
                                NE {},
                                IN {},
                                LE {},
                                LT {},
                                GE {},
                                GT {},
                                BETWEEN {},
                                NOT_NULL {},
                                NULL {},
                                CONTAINS {},
                                NOT_CONTAINS {},
                                BEGINS_WITH {}
                            }

                            impl ComparisonOperator {}

                            impl Debug
                                for ComparisonOperator {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ComparisonOperator {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ComparisonOperator::EQ{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.EQ")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::NE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.NE")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::IN{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.IN")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::LE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.LE")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::LT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.LT")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::GE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.GE")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::GT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.GT")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::BETWEEN{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.BETWEEN")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::NOT_NULL{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.NOT__NULL")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::NULL{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.NULL")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::CONTAINS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.CONTAINS")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::NOT_CONTAINS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.NOT__CONTAINS")?;
                                            Ok(())
                                        },
                                        ComparisonOperator::BEGINS_WITH{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.BEGINS__WITH")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ComparisonOperator {
                                /// Enumerates all possible values of ComparisonOperator
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ComparisonOperator>> {
                                    seq![Arc::new(ComparisonOperator::EQ {}), Arc::new(ComparisonOperator::NE {}), Arc::new(ComparisonOperator::IN {}), Arc::new(ComparisonOperator::LE {}), Arc::new(ComparisonOperator::LT {}), Arc::new(ComparisonOperator::GE {}), Arc::new(ComparisonOperator::GT {}), Arc::new(ComparisonOperator::BETWEEN {}), Arc::new(ComparisonOperator::NOT_NULL {}), Arc::new(ComparisonOperator::NULL {}), Arc::new(ComparisonOperator::CONTAINS {}), Arc::new(ComparisonOperator::NOT_CONTAINS {}), Arc::new(ComparisonOperator::BEGINS_WITH {})].iter()
                                }
                            }

                            impl Eq
                                for ComparisonOperator {}

                            impl Hash
                                for ComparisonOperator {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ComparisonOperator::EQ{} => {

                                        },
                                        ComparisonOperator::NE{} => {

                                        },
                                        ComparisonOperator::IN{} => {

                                        },
                                        ComparisonOperator::LE{} => {

                                        },
                                        ComparisonOperator::LT{} => {

                                        },
                                        ComparisonOperator::GE{} => {

                                        },
                                        ComparisonOperator::GT{} => {

                                        },
                                        ComparisonOperator::BETWEEN{} => {

                                        },
                                        ComparisonOperator::NOT_NULL{} => {

                                        },
                                        ComparisonOperator::NULL{} => {

                                        },
                                        ComparisonOperator::CONTAINS{} => {

                                        },
                                        ComparisonOperator::NOT_CONTAINS{} => {

                                        },
                                        ComparisonOperator::BEGINS_WITH{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ComparisonOperator {
                                fn default() -> ComparisonOperator {
                                    ComparisonOperator::EQ {}
                                }
                            }

                            impl AsRef<ComparisonOperator>
                                for ComparisonOperator {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(276,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Condition {
                                Condition {
                                    AttributeValueList: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ComparisonOperator: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator>
                                }
                            }

                            impl Condition {
                                /// Returns a borrow of the field AttributeValueList
                                pub fn AttributeValueList(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        Condition::Condition{AttributeValueList, ComparisonOperator, } => AttributeValueList,
                                    }
                                }
                                /// Returns a borrow of the field ComparisonOperator
                                pub fn ComparisonOperator(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator> {
                                    match self {
                                        Condition::Condition{AttributeValueList, ComparisonOperator, } => ComparisonOperator,
                                    }
                                }
                            }

                            impl Debug
                                for Condition {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Condition {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Condition::Condition{AttributeValueList, ComparisonOperator, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Condition.Condition(")?;
                                            DafnyPrint::fmt_print(AttributeValueList, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ComparisonOperator, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Condition {}

                            impl Hash
                                for Condition {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Condition::Condition{AttributeValueList, ComparisonOperator, } => {
                                            Hash::hash(AttributeValueList, _state);
                                            Hash::hash(ComparisonOperator, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Condition {
                                fn default() -> Condition {
                                    Condition::Condition {
                                        AttributeValueList: Default::default(),
                                        ComparisonOperator: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Condition>
                                for Condition {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(280,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ConditionalOperator {
                                AND {},
                                OR {}
                            }

                            impl ConditionalOperator {}

                            impl Debug
                                for ConditionalOperator {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ConditionalOperator {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ConditionalOperator::AND{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionalOperator.AND")?;
                                            Ok(())
                                        },
                                        ConditionalOperator::OR{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionalOperator.OR")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ConditionalOperator {
                                /// Enumerates all possible values of ConditionalOperator
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ConditionalOperator>> {
                                    seq![Arc::new(ConditionalOperator::AND {}), Arc::new(ConditionalOperator::OR {})].iter()
                                }
                            }

                            impl Eq
                                for ConditionalOperator {}

                            impl Hash
                                for ConditionalOperator {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ConditionalOperator::AND{} => {

                                        },
                                        ConditionalOperator::OR{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ConditionalOperator {
                                fn default() -> ConditionalOperator {
                                    ConditionalOperator::AND {}
                                }
                            }

                            impl AsRef<ConditionalOperator>
                                for ConditionalOperator {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(283,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ConditionCheck {
                                ConditionCheck {
                                    Key: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>,
                                    TableName: Sequence<DafnyCharUTF16>,
                                    ConditionExpression: Sequence<DafnyCharUTF16>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    ExpressionAttributeValues: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ReturnValuesOnConditionCheckFailure: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>>
                                }
                            }

                            impl ConditionCheck {
                                /// Returns a borrow of the field Key
                                pub fn Key(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        ConditionCheck::ConditionCheck{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Key,
                                    }
                                }
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ConditionCheck::ConditionCheck{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field ConditionExpression
                                pub fn ConditionExpression(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ConditionCheck::ConditionCheck{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        ConditionCheck::ConditionCheck{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeNames,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeValues
                                pub fn ExpressionAttributeValues(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        ConditionCheck::ConditionCheck{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeValues,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure
                                pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>> {
                                    match self {
                                        ConditionCheck::ConditionCheck{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure,
                                    }
                                }
                            }

                            impl Debug
                                for ConditionCheck {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ConditionCheck {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ConditionCheck::ConditionCheck{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionCheck.ConditionCheck(")?;
                                            DafnyPrint::fmt_print(Key, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ConditionCheck {}

                            impl Hash
                                for ConditionCheck {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ConditionCheck::ConditionCheck{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            Hash::hash(Key, _state);
                                            Hash::hash(TableName, _state);
                                            Hash::hash(ConditionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state);
                                            Hash::hash(ExpressionAttributeValues, _state);
                                            Hash::hash(ReturnValuesOnConditionCheckFailure, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ConditionCheck {
                                fn default() -> ConditionCheck {
                                    ConditionCheck::ConditionCheck {
                                        Key: Default::default(),
                                        TableName: Default::default(),
                                        ConditionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default(),
                                        ExpressionAttributeValues: Default::default(),
                                        ReturnValuesOnConditionCheckFailure: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ConditionCheck>
                                for ConditionCheck {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(294,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ConsumedCapacity {
                                ConsumedCapacity {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>>,
                                    ReadCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>>,
                                    WriteCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>>,
                                    Table: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Capacity>>>,
                                    LocalSecondaryIndexes: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Capacity>>>>,
                                    GlobalSecondaryIndexes: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Capacity>>>>
                                }
                            }

                            impl ConsumedCapacity {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ConsumedCapacity::ConsumedCapacity{TableName, CapacityUnits, ReadCapacityUnits, WriteCapacityUnits, Table, LocalSecondaryIndexes, GlobalSecondaryIndexes, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field CapacityUnits
                                pub fn CapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>> {
                                    match self {
                                        ConsumedCapacity::ConsumedCapacity{TableName, CapacityUnits, ReadCapacityUnits, WriteCapacityUnits, Table, LocalSecondaryIndexes, GlobalSecondaryIndexes, } => CapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field ReadCapacityUnits
                                pub fn ReadCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>> {
                                    match self {
                                        ConsumedCapacity::ConsumedCapacity{TableName, CapacityUnits, ReadCapacityUnits, WriteCapacityUnits, Table, LocalSecondaryIndexes, GlobalSecondaryIndexes, } => ReadCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field WriteCapacityUnits
                                pub fn WriteCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacityUnits>> {
                                    match self {
                                        ConsumedCapacity::ConsumedCapacity{TableName, CapacityUnits, ReadCapacityUnits, WriteCapacityUnits, Table, LocalSecondaryIndexes, GlobalSecondaryIndexes, } => WriteCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field Table
                                pub fn Table(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Capacity>>> {
                                    match self {
                                        ConsumedCapacity::ConsumedCapacity{TableName, CapacityUnits, ReadCapacityUnits, WriteCapacityUnits, Table, LocalSecondaryIndexes, GlobalSecondaryIndexes, } => Table,
                                    }
                                }
                                /// Returns a borrow of the field LocalSecondaryIndexes
                                pub fn LocalSecondaryIndexes(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Capacity>>>> {
                                    match self {
                                        ConsumedCapacity::ConsumedCapacity{TableName, CapacityUnits, ReadCapacityUnits, WriteCapacityUnits, Table, LocalSecondaryIndexes, GlobalSecondaryIndexes, } => LocalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexes
                                pub fn GlobalSecondaryIndexes(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Capacity>>>> {
                                    match self {
                                        ConsumedCapacity::ConsumedCapacity{TableName, CapacityUnits, ReadCapacityUnits, WriteCapacityUnits, Table, LocalSecondaryIndexes, GlobalSecondaryIndexes, } => GlobalSecondaryIndexes,
                                    }
                                }
                            }

                            impl Debug
                                for ConsumedCapacity {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ConsumedCapacity {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ConsumedCapacity::ConsumedCapacity{TableName, CapacityUnits, ReadCapacityUnits, WriteCapacityUnits, Table, LocalSecondaryIndexes, GlobalSecondaryIndexes, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ConsumedCapacity.ConsumedCapacity(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(WriteCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Table, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LocalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ConsumedCapacity {}

                            impl Hash
                                for ConsumedCapacity {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ConsumedCapacity::ConsumedCapacity{TableName, CapacityUnits, ReadCapacityUnits, WriteCapacityUnits, Table, LocalSecondaryIndexes, GlobalSecondaryIndexes, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(CapacityUnits, _state);
                                            Hash::hash(ReadCapacityUnits, _state);
                                            Hash::hash(WriteCapacityUnits, _state);
                                            Hash::hash(Table, _state);
                                            Hash::hash(LocalSecondaryIndexes, _state);
                                            Hash::hash(GlobalSecondaryIndexes, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ConsumedCapacity {
                                fn default() -> ConsumedCapacity {
                                    ConsumedCapacity::ConsumedCapacity {
                                        TableName: Default::default(),
                                        CapacityUnits: Default::default(),
                                        ReadCapacityUnits: Default::default(),
                                        WriteCapacityUnits: Default::default(),
                                        Table: Default::default(),
                                        LocalSecondaryIndexes: Default::default(),
                                        GlobalSecondaryIndexes: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ConsumedCapacity>
                                for ConsumedCapacity {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(304,3)
                            pub type ConsumedCapacityUnits = Sequence<u8>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(308,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ContinuousBackupsDescription {
                                ContinuousBackupsDescription {
                                    ContinuousBackupsStatus: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContinuousBackupsStatus>,
                                    PointInTimeRecoveryDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PointInTimeRecoveryDescription>>>
                                }
                            }

                            impl ContinuousBackupsDescription {
                                /// Returns a borrow of the field ContinuousBackupsStatus
                                pub fn ContinuousBackupsStatus(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContinuousBackupsStatus> {
                                    match self {
                                        ContinuousBackupsDescription::ContinuousBackupsDescription{ContinuousBackupsStatus, PointInTimeRecoveryDescription, } => ContinuousBackupsStatus,
                                    }
                                }
                                /// Returns a borrow of the field PointInTimeRecoveryDescription
                                pub fn PointInTimeRecoveryDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PointInTimeRecoveryDescription>>> {
                                    match self {
                                        ContinuousBackupsDescription::ContinuousBackupsDescription{ContinuousBackupsStatus, PointInTimeRecoveryDescription, } => PointInTimeRecoveryDescription,
                                    }
                                }
                            }

                            impl Debug
                                for ContinuousBackupsDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ContinuousBackupsDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ContinuousBackupsDescription::ContinuousBackupsDescription{ContinuousBackupsStatus, PointInTimeRecoveryDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContinuousBackupsDescription.ContinuousBackupsDescription(")?;
                                            DafnyPrint::fmt_print(ContinuousBackupsStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PointInTimeRecoveryDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ContinuousBackupsDescription {}

                            impl Hash
                                for ContinuousBackupsDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ContinuousBackupsDescription::ContinuousBackupsDescription{ContinuousBackupsStatus, PointInTimeRecoveryDescription, } => {
                                            Hash::hash(ContinuousBackupsStatus, _state);
                                            Hash::hash(PointInTimeRecoveryDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ContinuousBackupsDescription {
                                fn default() -> ContinuousBackupsDescription {
                                    ContinuousBackupsDescription::ContinuousBackupsDescription {
                                        ContinuousBackupsStatus: Default::default(),
                                        PointInTimeRecoveryDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ContinuousBackupsDescription>
                                for ContinuousBackupsDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(312,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ContinuousBackupsStatus {
                                ENABLED {},
                                DISABLED {}
                            }

                            impl ContinuousBackupsStatus {}

                            impl Debug
                                for ContinuousBackupsStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ContinuousBackupsStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ContinuousBackupsStatus::ENABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContinuousBackupsStatus.ENABLED")?;
                                            Ok(())
                                        },
                                        ContinuousBackupsStatus::DISABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContinuousBackupsStatus.DISABLED")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ContinuousBackupsStatus {
                                /// Enumerates all possible values of ContinuousBackupsStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ContinuousBackupsStatus>> {
                                    seq![Arc::new(ContinuousBackupsStatus::ENABLED {}), Arc::new(ContinuousBackupsStatus::DISABLED {})].iter()
                                }
                            }

                            impl Eq
                                for ContinuousBackupsStatus {}

                            impl Hash
                                for ContinuousBackupsStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ContinuousBackupsStatus::ENABLED{} => {

                                        },
                                        ContinuousBackupsStatus::DISABLED{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ContinuousBackupsStatus {
                                fn default() -> ContinuousBackupsStatus {
                                    ContinuousBackupsStatus::ENABLED {}
                                }
                            }

                            impl AsRef<ContinuousBackupsStatus>
                                for ContinuousBackupsStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(315,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ContributorInsightsAction {
                                ENABLE {},
                                DISABLE {}
                            }

                            impl ContributorInsightsAction {}

                            impl Debug
                                for ContributorInsightsAction {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ContributorInsightsAction {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ContributorInsightsAction::ENABLE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsAction.ENABLE")?;
                                            Ok(())
                                        },
                                        ContributorInsightsAction::DISABLE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsAction.DISABLE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ContributorInsightsAction {
                                /// Enumerates all possible values of ContributorInsightsAction
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ContributorInsightsAction>> {
                                    seq![Arc::new(ContributorInsightsAction::ENABLE {}), Arc::new(ContributorInsightsAction::DISABLE {})].iter()
                                }
                            }

                            impl Eq
                                for ContributorInsightsAction {}

                            impl Hash
                                for ContributorInsightsAction {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ContributorInsightsAction::ENABLE{} => {

                                        },
                                        ContributorInsightsAction::DISABLE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ContributorInsightsAction {
                                fn default() -> ContributorInsightsAction {
                                    ContributorInsightsAction::ENABLE {}
                                }
                            }

                            impl AsRef<ContributorInsightsAction>
                                for ContributorInsightsAction {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(320,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ContributorInsightsStatus {
                                ENABLING {},
                                ENABLED {},
                                DISABLING {},
                                DISABLED {},
                                FAILED {}
                            }

                            impl ContributorInsightsStatus {}

                            impl Debug
                                for ContributorInsightsStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ContributorInsightsStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ContributorInsightsStatus::ENABLING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsStatus.ENABLING")?;
                                            Ok(())
                                        },
                                        ContributorInsightsStatus::ENABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsStatus.ENABLED")?;
                                            Ok(())
                                        },
                                        ContributorInsightsStatus::DISABLING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsStatus.DISABLING")?;
                                            Ok(())
                                        },
                                        ContributorInsightsStatus::DISABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsStatus.DISABLED")?;
                                            Ok(())
                                        },
                                        ContributorInsightsStatus::FAILED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsStatus.FAILED")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ContributorInsightsStatus {
                                /// Enumerates all possible values of ContributorInsightsStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ContributorInsightsStatus>> {
                                    seq![Arc::new(ContributorInsightsStatus::ENABLING {}), Arc::new(ContributorInsightsStatus::ENABLED {}), Arc::new(ContributorInsightsStatus::DISABLING {}), Arc::new(ContributorInsightsStatus::DISABLED {}), Arc::new(ContributorInsightsStatus::FAILED {})].iter()
                                }
                            }

                            impl Eq
                                for ContributorInsightsStatus {}

                            impl Hash
                                for ContributorInsightsStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ContributorInsightsStatus::ENABLING{} => {

                                        },
                                        ContributorInsightsStatus::ENABLED{} => {

                                        },
                                        ContributorInsightsStatus::DISABLING{} => {

                                        },
                                        ContributorInsightsStatus::DISABLED{} => {

                                        },
                                        ContributorInsightsStatus::FAILED{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ContributorInsightsStatus {
                                fn default() -> ContributorInsightsStatus {
                                    ContributorInsightsStatus::ENABLING {}
                                }
                            }

                            impl AsRef<ContributorInsightsStatus>
                                for ContributorInsightsStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(327,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ContributorInsightsSummary {
                                ContributorInsightsSummary {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ContributorInsightsStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContributorInsightsStatus>>>
                                }
                            }

                            impl ContributorInsightsSummary {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ContributorInsightsSummary::ContributorInsightsSummary{TableName, IndexName, ContributorInsightsStatus, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ContributorInsightsSummary::ContributorInsightsSummary{TableName, IndexName, ContributorInsightsStatus, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ContributorInsightsStatus
                                pub fn ContributorInsightsStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContributorInsightsStatus>>> {
                                    match self {
                                        ContributorInsightsSummary::ContributorInsightsSummary{TableName, IndexName, ContributorInsightsStatus, } => ContributorInsightsStatus,
                                    }
                                }
                            }

                            impl Debug
                                for ContributorInsightsSummary {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ContributorInsightsSummary {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ContributorInsightsSummary::ContributorInsightsSummary{TableName, IndexName, ContributorInsightsStatus, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsSummary.ContributorInsightsSummary(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ContributorInsightsStatus, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ContributorInsightsSummary {}

                            impl Hash
                                for ContributorInsightsSummary {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ContributorInsightsSummary::ContributorInsightsSummary{TableName, IndexName, ContributorInsightsStatus, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ContributorInsightsStatus, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ContributorInsightsSummary {
                                fn default() -> ContributorInsightsSummary {
                                    ContributorInsightsSummary::ContributorInsightsSummary {
                                        TableName: Default::default(),
                                        IndexName: Default::default(),
                                        ContributorInsightsStatus: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ContributorInsightsSummary>
                                for ContributorInsightsSummary {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(332,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateBackupInput {
                                CreateBackupInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    BackupName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl CreateBackupInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateBackupInput::CreateBackupInput{TableName, BackupName, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field BackupName
                                pub fn BackupName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateBackupInput::CreateBackupInput{TableName, BackupName, } => BackupName,
                                    }
                                }
                            }

                            impl Debug
                                for CreateBackupInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateBackupInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateBackupInput::CreateBackupInput{TableName, BackupName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateBackupInput.CreateBackupInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateBackupInput {}

                            impl Hash
                                for CreateBackupInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateBackupInput::CreateBackupInput{TableName, BackupName, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(BackupName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateBackupInput {
                                fn default() -> CreateBackupInput {
                                    CreateBackupInput::CreateBackupInput {
                                        TableName: Default::default(),
                                        BackupName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateBackupInput>
                                for CreateBackupInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(336,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateBackupOutput {
                                CreateBackupOutput {
                                    BackupDetails: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupDetails>>>
                                }
                            }

                            impl CreateBackupOutput {
                                /// Returns a borrow of the field BackupDetails
                                pub fn BackupDetails(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupDetails>>> {
                                    match self {
                                        CreateBackupOutput::CreateBackupOutput{BackupDetails, } => BackupDetails,
                                    }
                                }
                            }

                            impl Debug
                                for CreateBackupOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateBackupOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateBackupOutput::CreateBackupOutput{BackupDetails, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateBackupOutput.CreateBackupOutput(")?;
                                            DafnyPrint::fmt_print(BackupDetails, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateBackupOutput {}

                            impl Hash
                                for CreateBackupOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateBackupOutput::CreateBackupOutput{BackupDetails, } => {
                                            Hash::hash(BackupDetails, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateBackupOutput {
                                fn default() -> CreateBackupOutput {
                                    CreateBackupOutput::CreateBackupOutput {
                                        BackupDetails: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateBackupOutput>
                                for CreateBackupOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(339,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateGlobalSecondaryIndexAction {
                                CreateGlobalSecondaryIndexAction {
                                    IndexName: Sequence<DafnyCharUTF16>,
                                    KeySchema: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema,
                                    Projection: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>,
                                    ProvisionedThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>>,
                                    OnDemandThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>
                                }
                            }

                            impl CreateGlobalSecondaryIndexAction {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateGlobalSecondaryIndexAction::CreateGlobalSecondaryIndexAction{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema {
                                    match self {
                                        CreateGlobalSecondaryIndexAction::CreateGlobalSecondaryIndexAction{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field Projection
                                pub fn Projection(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection> {
                                    match self {
                                        CreateGlobalSecondaryIndexAction::CreateGlobalSecondaryIndexAction{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => Projection,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughput
                                pub fn ProvisionedThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>> {
                                    match self {
                                        CreateGlobalSecondaryIndexAction::CreateGlobalSecondaryIndexAction{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => ProvisionedThroughput,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughput
                                pub fn OnDemandThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        CreateGlobalSecondaryIndexAction::CreateGlobalSecondaryIndexAction{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => OnDemandThroughput,
                                    }
                                }
                            }

                            impl Debug
                                for CreateGlobalSecondaryIndexAction {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateGlobalSecondaryIndexAction {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateGlobalSecondaryIndexAction::CreateGlobalSecondaryIndexAction{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalSecondaryIndexAction.CreateGlobalSecondaryIndexAction(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Projection, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughput, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateGlobalSecondaryIndexAction {}

                            impl Hash
                                for CreateGlobalSecondaryIndexAction {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateGlobalSecondaryIndexAction::CreateGlobalSecondaryIndexAction{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(Projection, _state);
                                            Hash::hash(ProvisionedThroughput, _state);
                                            Hash::hash(OnDemandThroughput, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateGlobalSecondaryIndexAction {
                                fn default() -> CreateGlobalSecondaryIndexAction {
                                    CreateGlobalSecondaryIndexAction::CreateGlobalSecondaryIndexAction {
                                        IndexName: Default::default(),
                                        KeySchema: Default::default(),
                                        Projection: Default::default(),
                                        ProvisionedThroughput: Default::default(),
                                        OnDemandThroughput: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateGlobalSecondaryIndexAction>
                                for CreateGlobalSecondaryIndexAction {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(346,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateGlobalTableInput {
                                CreateGlobalTableInput {
                                    GlobalTableName: Sequence<DafnyCharUTF16>,
                                    ReplicationGroup: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Replica>>
                                }
                            }

                            impl CreateGlobalTableInput {
                                /// Returns a borrow of the field GlobalTableName
                                pub fn GlobalTableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateGlobalTableInput::CreateGlobalTableInput{GlobalTableName, ReplicationGroup, } => GlobalTableName,
                                    }
                                }
                                /// Returns a borrow of the field ReplicationGroup
                                pub fn ReplicationGroup(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Replica>> {
                                    match self {
                                        CreateGlobalTableInput::CreateGlobalTableInput{GlobalTableName, ReplicationGroup, } => ReplicationGroup,
                                    }
                                }
                            }

                            impl Debug
                                for CreateGlobalTableInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateGlobalTableInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateGlobalTableInput::CreateGlobalTableInput{GlobalTableName, ReplicationGroup, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalTableInput.CreateGlobalTableInput(")?;
                                            DafnyPrint::fmt_print(GlobalTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicationGroup, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateGlobalTableInput {}

                            impl Hash
                                for CreateGlobalTableInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateGlobalTableInput::CreateGlobalTableInput{GlobalTableName, ReplicationGroup, } => {
                                            Hash::hash(GlobalTableName, _state);
                                            Hash::hash(ReplicationGroup, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateGlobalTableInput {
                                fn default() -> CreateGlobalTableInput {
                                    CreateGlobalTableInput::CreateGlobalTableInput {
                                        GlobalTableName: Default::default(),
                                        ReplicationGroup: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateGlobalTableInput>
                                for CreateGlobalTableInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(350,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateGlobalTableOutput {
                                CreateGlobalTableOutput {
                                    GlobalTableDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableDescription>>>
                                }
                            }

                            impl CreateGlobalTableOutput {
                                /// Returns a borrow of the field GlobalTableDescription
                                pub fn GlobalTableDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableDescription>>> {
                                    match self {
                                        CreateGlobalTableOutput::CreateGlobalTableOutput{GlobalTableDescription, } => GlobalTableDescription,
                                    }
                                }
                            }

                            impl Debug
                                for CreateGlobalTableOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateGlobalTableOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateGlobalTableOutput::CreateGlobalTableOutput{GlobalTableDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalTableOutput.CreateGlobalTableOutput(")?;
                                            DafnyPrint::fmt_print(GlobalTableDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateGlobalTableOutput {}

                            impl Hash
                                for CreateGlobalTableOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateGlobalTableOutput::CreateGlobalTableOutput{GlobalTableDescription, } => {
                                            Hash::hash(GlobalTableDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateGlobalTableOutput {
                                fn default() -> CreateGlobalTableOutput {
                                    CreateGlobalTableOutput::CreateGlobalTableOutput {
                                        GlobalTableDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateGlobalTableOutput>
                                for CreateGlobalTableOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(353,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateReplicaAction {
                                CreateReplicaAction {
                                    RegionName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl CreateReplicaAction {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateReplicaAction::CreateReplicaAction{RegionName, } => RegionName,
                                    }
                                }
                            }

                            impl Debug
                                for CreateReplicaAction {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateReplicaAction {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateReplicaAction::CreateReplicaAction{RegionName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateReplicaAction.CreateReplicaAction(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateReplicaAction {}

                            impl Hash
                                for CreateReplicaAction {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateReplicaAction::CreateReplicaAction{RegionName, } => {
                                            Hash::hash(RegionName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateReplicaAction {
                                fn default() -> CreateReplicaAction {
                                    CreateReplicaAction::CreateReplicaAction {
                                        RegionName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateReplicaAction>
                                for CreateReplicaAction {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(356,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateReplicationGroupMemberAction {
                                CreateReplicationGroupMemberAction {
                                    RegionName: Sequence<DafnyCharUTF16>,
                                    KMSMasterKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ProvisionedThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride>>>,
                                    OnDemandThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughputOverride>>>,
                                    GlobalSecondaryIndexes: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexList>>,
                                    TableClassOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>>
                                }
                            }

                            impl CreateReplicationGroupMemberAction {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateReplicationGroupMemberAction::CreateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => RegionName,
                                    }
                                }
                                /// Returns a borrow of the field KMSMasterKeyId
                                pub fn KMSMasterKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateReplicationGroupMemberAction::CreateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => KMSMasterKeyId,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughputOverride
                                pub fn ProvisionedThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride>>> {
                                    match self {
                                        CreateReplicationGroupMemberAction::CreateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => ProvisionedThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughputOverride
                                pub fn OnDemandThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughputOverride>>> {
                                    match self {
                                        CreateReplicationGroupMemberAction::CreateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => OnDemandThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexes
                                pub fn GlobalSecondaryIndexes(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexList>> {
                                    match self {
                                        CreateReplicationGroupMemberAction::CreateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => GlobalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field TableClassOverride
                                pub fn TableClassOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>> {
                                    match self {
                                        CreateReplicationGroupMemberAction::CreateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => TableClassOverride,
                                    }
                                }
                            }

                            impl Debug
                                for CreateReplicationGroupMemberAction {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateReplicationGroupMemberAction {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateReplicationGroupMemberAction::CreateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateReplicationGroupMemberAction.CreateReplicationGroupMemberAction(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KMSMasterKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableClassOverride, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateReplicationGroupMemberAction {}

                            impl Hash
                                for CreateReplicationGroupMemberAction {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateReplicationGroupMemberAction::CreateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => {
                                            Hash::hash(RegionName, _state);
                                            Hash::hash(KMSMasterKeyId, _state);
                                            Hash::hash(ProvisionedThroughputOverride, _state);
                                            Hash::hash(OnDemandThroughputOverride, _state);
                                            Hash::hash(GlobalSecondaryIndexes, _state);
                                            Hash::hash(TableClassOverride, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateReplicationGroupMemberAction {
                                fn default() -> CreateReplicationGroupMemberAction {
                                    CreateReplicationGroupMemberAction::CreateReplicationGroupMemberAction {
                                        RegionName: Default::default(),
                                        KMSMasterKeyId: Default::default(),
                                        ProvisionedThroughputOverride: Default::default(),
                                        OnDemandThroughputOverride: Default::default(),
                                        GlobalSecondaryIndexes: Default::default(),
                                        TableClassOverride: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateReplicationGroupMemberAction>
                                for CreateReplicationGroupMemberAction {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(364,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateTableInput {
                                CreateTableInput {
                                    AttributeDefinitions: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition>>,
                                    TableName: Sequence<DafnyCharUTF16>,
                                    KeySchema: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema,
                                    LocalSecondaryIndexes: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndex>>>>,
                                    GlobalSecondaryIndexes: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex>>>>,
                                    BillingMode: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>>,
                                    ProvisionedThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>>,
                                    StreamSpecification: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification>>>,
                                    SSESpecification: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification>>>,
                                    Tags: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Tag>>>>,
                                    TableClass: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>>,
                                    DeletionProtectionEnabled: Arc<Option<bool>>,
                                    ResourcePolicy: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    OnDemandThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>
                                }
                            }

                            impl CreateTableInput {
                                /// Returns a borrow of the field AttributeDefinitions
                                pub fn AttributeDefinitions(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => AttributeDefinitions,
                                    }
                                }
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field LocalSecondaryIndexes
                                pub fn LocalSecondaryIndexes(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndex>>>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => LocalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexes
                                pub fn GlobalSecondaryIndexes(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex>>>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => GlobalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field BillingMode
                                pub fn BillingMode(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => BillingMode,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughput
                                pub fn ProvisionedThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => ProvisionedThroughput,
                                    }
                                }
                                /// Returns a borrow of the field StreamSpecification
                                pub fn StreamSpecification(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification>>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => StreamSpecification,
                                    }
                                }
                                /// Returns a borrow of the field SSESpecification
                                pub fn SSESpecification(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification>>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => SSESpecification,
                                    }
                                }
                                /// Returns a borrow of the field Tags
                                pub fn Tags(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Tag>>>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => Tags,
                                    }
                                }
                                /// Returns a borrow of the field TableClass
                                pub fn TableClass(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => TableClass,
                                    }
                                }
                                /// Returns a borrow of the field DeletionProtectionEnabled
                                pub fn DeletionProtectionEnabled(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => DeletionProtectionEnabled,
                                    }
                                }
                                /// Returns a borrow of the field ResourcePolicy
                                pub fn ResourcePolicy(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => ResourcePolicy,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughput
                                pub fn OnDemandThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => OnDemandThroughput,
                                    }
                                }
                            }

                            impl Debug
                                for CreateTableInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateTableInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateTableInput.CreateTableInput(")?;
                                            DafnyPrint::fmt_print(AttributeDefinitions, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LocalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BillingMode, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamSpecification, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SSESpecification, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Tags, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableClass, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DeletionProtectionEnabled, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ResourcePolicy, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughput, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateTableInput {}

                            impl Hash
                                for CreateTableInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateTableInput::CreateTableInput{AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, BillingMode, ProvisionedThroughput, StreamSpecification, SSESpecification, Tags, TableClass, DeletionProtectionEnabled, ResourcePolicy, OnDemandThroughput, } => {
                                            Hash::hash(AttributeDefinitions, _state);
                                            Hash::hash(TableName, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(LocalSecondaryIndexes, _state);
                                            Hash::hash(GlobalSecondaryIndexes, _state);
                                            Hash::hash(BillingMode, _state);
                                            Hash::hash(ProvisionedThroughput, _state);
                                            Hash::hash(StreamSpecification, _state);
                                            Hash::hash(SSESpecification, _state);
                                            Hash::hash(Tags, _state);
                                            Hash::hash(TableClass, _state);
                                            Hash::hash(DeletionProtectionEnabled, _state);
                                            Hash::hash(ResourcePolicy, _state);
                                            Hash::hash(OnDemandThroughput, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateTableInput {
                                fn default() -> CreateTableInput {
                                    CreateTableInput::CreateTableInput {
                                        AttributeDefinitions: Default::default(),
                                        TableName: Default::default(),
                                        KeySchema: Default::default(),
                                        LocalSecondaryIndexes: Default::default(),
                                        GlobalSecondaryIndexes: Default::default(),
                                        BillingMode: Default::default(),
                                        ProvisionedThroughput: Default::default(),
                                        StreamSpecification: Default::default(),
                                        SSESpecification: Default::default(),
                                        Tags: Default::default(),
                                        TableClass: Default::default(),
                                        DeletionProtectionEnabled: Default::default(),
                                        ResourcePolicy: Default::default(),
                                        OnDemandThroughput: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateTableInput>
                                for CreateTableInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(380,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateTableOutput {
                                CreateTableOutput {
                                    TableDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>>
                                }
                            }

                            impl CreateTableOutput {
                                /// Returns a borrow of the field TableDescription
                                pub fn TableDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>> {
                                    match self {
                                        CreateTableOutput::CreateTableOutput{TableDescription, } => TableDescription,
                                    }
                                }
                            }

                            impl Debug
                                for CreateTableOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateTableOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateTableOutput::CreateTableOutput{TableDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateTableOutput.CreateTableOutput(")?;
                                            DafnyPrint::fmt_print(TableDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateTableOutput {}

                            impl Hash
                                for CreateTableOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateTableOutput::CreateTableOutput{TableDescription, } => {
                                            Hash::hash(TableDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateTableOutput {
                                fn default() -> CreateTableOutput {
                                    CreateTableOutput::CreateTableOutput {
                                        TableDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateTableOutput>
                                for CreateTableOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(383,3)
                            pub type CsvDelimiter = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(387,3)
                            pub type CsvHeader = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(391,3)
                            pub type CsvHeaderList = Sequence<Sequence<DafnyCharUTF16>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(395,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CsvOptions {
                                CsvOptions {
                                    Delimiter: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    HeaderList: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CsvHeaderList>>
                                }
                            }

                            impl CsvOptions {
                                /// Returns a borrow of the field Delimiter
                                pub fn Delimiter(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CsvOptions::CsvOptions{Delimiter, HeaderList, } => Delimiter,
                                    }
                                }
                                /// Returns a borrow of the field HeaderList
                                pub fn HeaderList(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CsvHeaderList>> {
                                    match self {
                                        CsvOptions::CsvOptions{Delimiter, HeaderList, } => HeaderList,
                                    }
                                }
                            }

                            impl Debug
                                for CsvOptions {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CsvOptions {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CsvOptions::CsvOptions{Delimiter, HeaderList, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.CsvOptions.CsvOptions(")?;
                                            DafnyPrint::fmt_print(Delimiter, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(HeaderList, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CsvOptions {}

                            impl Hash
                                for CsvOptions {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CsvOptions::CsvOptions{Delimiter, HeaderList, } => {
                                            Hash::hash(Delimiter, _state);
                                            Hash::hash(HeaderList, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CsvOptions {
                                fn default() -> CsvOptions {
                                    CsvOptions::CsvOptions {
                                        Delimiter: Default::default(),
                                        HeaderList: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CsvOptions>
                                for CsvOptions {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(399,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Delete {
                                Delete {
                                    Key: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>,
                                    TableName: Sequence<DafnyCharUTF16>,
                                    ConditionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    ExpressionAttributeValues: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ReturnValuesOnConditionCheckFailure: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>>
                                }
                            }

                            impl Delete {
                                /// Returns a borrow of the field Key
                                pub fn Key(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        Delete::Delete{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Key,
                                    }
                                }
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Delete::Delete{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field ConditionExpression
                                pub fn ConditionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        Delete::Delete{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        Delete::Delete{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeNames,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeValues
                                pub fn ExpressionAttributeValues(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        Delete::Delete{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeValues,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure
                                pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>> {
                                    match self {
                                        Delete::Delete{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure,
                                    }
                                }
                            }

                            impl Debug
                                for Delete {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Delete {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Delete::Delete{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Delete.Delete(")?;
                                            DafnyPrint::fmt_print(Key, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Delete {}

                            impl Hash
                                for Delete {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Delete::Delete{Key, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            Hash::hash(Key, _state);
                                            Hash::hash(TableName, _state);
                                            Hash::hash(ConditionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state);
                                            Hash::hash(ExpressionAttributeValues, _state);
                                            Hash::hash(ReturnValuesOnConditionCheckFailure, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Delete {
                                fn default() -> Delete {
                                    Delete::Delete {
                                        Key: Default::default(),
                                        TableName: Default::default(),
                                        ConditionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default(),
                                        ExpressionAttributeValues: Default::default(),
                                        ReturnValuesOnConditionCheckFailure: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Delete>
                                for Delete {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(407,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteBackupInput {
                                DeleteBackupInput {
                                    BackupArn: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DeleteBackupInput {
                                /// Returns a borrow of the field BackupArn
                                pub fn BackupArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeleteBackupInput::DeleteBackupInput{BackupArn, } => BackupArn,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteBackupInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteBackupInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteBackupInput::DeleteBackupInput{BackupArn, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteBackupInput.DeleteBackupInput(")?;
                                            DafnyPrint::fmt_print(BackupArn, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteBackupInput {}

                            impl Hash
                                for DeleteBackupInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteBackupInput::DeleteBackupInput{BackupArn, } => {
                                            Hash::hash(BackupArn, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteBackupInput {
                                fn default() -> DeleteBackupInput {
                                    DeleteBackupInput::DeleteBackupInput {
                                        BackupArn: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteBackupInput>
                                for DeleteBackupInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(410,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteBackupOutput {
                                DeleteBackupOutput {
                                    BackupDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupDescription>>>
                                }
                            }

                            impl DeleteBackupOutput {
                                /// Returns a borrow of the field BackupDescription
                                pub fn BackupDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupDescription>>> {
                                    match self {
                                        DeleteBackupOutput::DeleteBackupOutput{BackupDescription, } => BackupDescription,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteBackupOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteBackupOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteBackupOutput::DeleteBackupOutput{BackupDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteBackupOutput.DeleteBackupOutput(")?;
                                            DafnyPrint::fmt_print(BackupDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteBackupOutput {}

                            impl Hash
                                for DeleteBackupOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteBackupOutput::DeleteBackupOutput{BackupDescription, } => {
                                            Hash::hash(BackupDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteBackupOutput {
                                fn default() -> DeleteBackupOutput {
                                    DeleteBackupOutput::DeleteBackupOutput {
                                        BackupDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteBackupOutput>
                                for DeleteBackupOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(413,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteGlobalSecondaryIndexAction {
                                DeleteGlobalSecondaryIndexAction {
                                    IndexName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DeleteGlobalSecondaryIndexAction {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeleteGlobalSecondaryIndexAction::DeleteGlobalSecondaryIndexAction{IndexName, } => IndexName,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteGlobalSecondaryIndexAction {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteGlobalSecondaryIndexAction {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteGlobalSecondaryIndexAction::DeleteGlobalSecondaryIndexAction{IndexName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteGlobalSecondaryIndexAction.DeleteGlobalSecondaryIndexAction(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteGlobalSecondaryIndexAction {}

                            impl Hash
                                for DeleteGlobalSecondaryIndexAction {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteGlobalSecondaryIndexAction::DeleteGlobalSecondaryIndexAction{IndexName, } => {
                                            Hash::hash(IndexName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteGlobalSecondaryIndexAction {
                                fn default() -> DeleteGlobalSecondaryIndexAction {
                                    DeleteGlobalSecondaryIndexAction::DeleteGlobalSecondaryIndexAction {
                                        IndexName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteGlobalSecondaryIndexAction>
                                for DeleteGlobalSecondaryIndexAction {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(416,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteItemInput {
                                DeleteItemInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    Key: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>,
                                    Expected: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExpectedAttributeValue>>>>,
                                    ConditionalOperator: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator>>>,
                                    ReturnValues: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue>>>,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>,
                                    ReturnItemCollectionMetrics: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics>>>,
                                    ConditionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    ExpressionAttributeValues: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ReturnValuesOnConditionCheckFailure: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>>
                                }
                            }

                            impl DeleteItemInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field Key
                                pub fn Key(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Key,
                                    }
                                }
                                /// Returns a borrow of the field Expected
                                pub fn Expected(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExpectedAttributeValue>>>> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Expected,
                                    }
                                }
                                /// Returns a borrow of the field ConditionalOperator
                                pub fn ConditionalOperator(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator>>> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionalOperator,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValues
                                pub fn ReturnValues(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue>>> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValues,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ReturnItemCollectionMetrics
                                pub fn ReturnItemCollectionMetrics(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics>>> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnItemCollectionMetrics,
                                    }
                                }
                                /// Returns a borrow of the field ConditionExpression
                                pub fn ConditionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeNames,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeValues
                                pub fn ExpressionAttributeValues(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeValues,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure
                                pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>> {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteItemInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteItemInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemInput.DeleteItemInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Key, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Expected, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionalOperator, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnItemCollectionMetrics, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteItemInput {}

                            impl Hash
                                for DeleteItemInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteItemInput::DeleteItemInput{TableName, Key, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(Key, _state);
                                            Hash::hash(Expected, _state);
                                            Hash::hash(ConditionalOperator, _state);
                                            Hash::hash(ReturnValues, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state);
                                            Hash::hash(ReturnItemCollectionMetrics, _state);
                                            Hash::hash(ConditionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state);
                                            Hash::hash(ExpressionAttributeValues, _state);
                                            Hash::hash(ReturnValuesOnConditionCheckFailure, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteItemInput {
                                fn default() -> DeleteItemInput {
                                    DeleteItemInput::DeleteItemInput {
                                        TableName: Default::default(),
                                        Key: Default::default(),
                                        Expected: Default::default(),
                                        ConditionalOperator: Default::default(),
                                        ReturnValues: Default::default(),
                                        ReturnConsumedCapacity: Default::default(),
                                        ReturnItemCollectionMetrics: Default::default(),
                                        ConditionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default(),
                                        ExpressionAttributeValues: Default::default(),
                                        ReturnValuesOnConditionCheckFailure: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteItemInput>
                                for DeleteItemInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(429,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteItemOutput {
                                DeleteItemOutput {
                                    Attributes: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>,
                                    ItemCollectionMetrics: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics>>>
                                }
                            }

                            impl DeleteItemOutput {
                                /// Returns a borrow of the field Attributes
                                pub fn Attributes(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        DeleteItemOutput::DeleteItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => Attributes,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>> {
                                    match self {
                                        DeleteItemOutput::DeleteItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => ConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ItemCollectionMetrics
                                pub fn ItemCollectionMetrics(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics>>> {
                                    match self {
                                        DeleteItemOutput::DeleteItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => ItemCollectionMetrics,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteItemOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteItemOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteItemOutput::DeleteItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemOutput.DeleteItemOutput(")?;
                                            DafnyPrint::fmt_print(Attributes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ItemCollectionMetrics, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteItemOutput {}

                            impl Hash
                                for DeleteItemOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteItemOutput::DeleteItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => {
                                            Hash::hash(Attributes, _state);
                                            Hash::hash(ConsumedCapacity, _state);
                                            Hash::hash(ItemCollectionMetrics, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteItemOutput {
                                fn default() -> DeleteItemOutput {
                                    DeleteItemOutput::DeleteItemOutput {
                                        Attributes: Default::default(),
                                        ConsumedCapacity: Default::default(),
                                        ItemCollectionMetrics: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteItemOutput>
                                for DeleteItemOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(434,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteReplicaAction {
                                DeleteReplicaAction {
                                    RegionName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DeleteReplicaAction {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeleteReplicaAction::DeleteReplicaAction{RegionName, } => RegionName,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteReplicaAction {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteReplicaAction {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteReplicaAction::DeleteReplicaAction{RegionName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteReplicaAction.DeleteReplicaAction(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteReplicaAction {}

                            impl Hash
                                for DeleteReplicaAction {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteReplicaAction::DeleteReplicaAction{RegionName, } => {
                                            Hash::hash(RegionName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteReplicaAction {
                                fn default() -> DeleteReplicaAction {
                                    DeleteReplicaAction::DeleteReplicaAction {
                                        RegionName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteReplicaAction>
                                for DeleteReplicaAction {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(437,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteReplicationGroupMemberAction {
                                DeleteReplicationGroupMemberAction {
                                    RegionName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DeleteReplicationGroupMemberAction {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeleteReplicationGroupMemberAction::DeleteReplicationGroupMemberAction{RegionName, } => RegionName,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteReplicationGroupMemberAction {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteReplicationGroupMemberAction {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteReplicationGroupMemberAction::DeleteReplicationGroupMemberAction{RegionName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteReplicationGroupMemberAction.DeleteReplicationGroupMemberAction(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteReplicationGroupMemberAction {}

                            impl Hash
                                for DeleteReplicationGroupMemberAction {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteReplicationGroupMemberAction::DeleteReplicationGroupMemberAction{RegionName, } => {
                                            Hash::hash(RegionName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteReplicationGroupMemberAction {
                                fn default() -> DeleteReplicationGroupMemberAction {
                                    DeleteReplicationGroupMemberAction::DeleteReplicationGroupMemberAction {
                                        RegionName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteReplicationGroupMemberAction>
                                for DeleteReplicationGroupMemberAction {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(440,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteRequest {
                                DeleteRequest {
                                    Key: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>
                                }
                            }

                            impl DeleteRequest {
                                /// Returns a borrow of the field Key
                                pub fn Key(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        DeleteRequest::DeleteRequest{Key, } => Key,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteRequest::DeleteRequest{Key, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteRequest.DeleteRequest(")?;
                                            DafnyPrint::fmt_print(Key, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteRequest {}

                            impl Hash
                                for DeleteRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteRequest::DeleteRequest{Key, } => {
                                            Hash::hash(Key, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteRequest {
                                fn default() -> DeleteRequest {
                                    DeleteRequest::DeleteRequest {
                                        Key: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteRequest>
                                for DeleteRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(443,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteResourcePolicyInput {
                                DeleteResourcePolicyInput {
                                    ResourceArn: Sequence<DafnyCharUTF16>,
                                    ExpectedRevisionId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl DeleteResourcePolicyInput {
                                /// Returns a borrow of the field ResourceArn
                                pub fn ResourceArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeleteResourcePolicyInput::DeleteResourcePolicyInput{ResourceArn, ExpectedRevisionId, } => ResourceArn,
                                    }
                                }
                                /// Returns a borrow of the field ExpectedRevisionId
                                pub fn ExpectedRevisionId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DeleteResourcePolicyInput::DeleteResourcePolicyInput{ResourceArn, ExpectedRevisionId, } => ExpectedRevisionId,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteResourcePolicyInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteResourcePolicyInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteResourcePolicyInput::DeleteResourcePolicyInput{ResourceArn, ExpectedRevisionId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteResourcePolicyInput.DeleteResourcePolicyInput(")?;
                                            DafnyPrint::fmt_print(ResourceArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpectedRevisionId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteResourcePolicyInput {}

                            impl Hash
                                for DeleteResourcePolicyInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteResourcePolicyInput::DeleteResourcePolicyInput{ResourceArn, ExpectedRevisionId, } => {
                                            Hash::hash(ResourceArn, _state);
                                            Hash::hash(ExpectedRevisionId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteResourcePolicyInput {
                                fn default() -> DeleteResourcePolicyInput {
                                    DeleteResourcePolicyInput::DeleteResourcePolicyInput {
                                        ResourceArn: Default::default(),
                                        ExpectedRevisionId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteResourcePolicyInput>
                                for DeleteResourcePolicyInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(447,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteResourcePolicyOutput {
                                DeleteResourcePolicyOutput {
                                    RevisionId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl DeleteResourcePolicyOutput {
                                /// Returns a borrow of the field RevisionId
                                pub fn RevisionId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DeleteResourcePolicyOutput::DeleteResourcePolicyOutput{RevisionId, } => RevisionId,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteResourcePolicyOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteResourcePolicyOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteResourcePolicyOutput::DeleteResourcePolicyOutput{RevisionId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteResourcePolicyOutput.DeleteResourcePolicyOutput(")?;
                                            DafnyPrint::fmt_print(RevisionId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteResourcePolicyOutput {}

                            impl Hash
                                for DeleteResourcePolicyOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteResourcePolicyOutput::DeleteResourcePolicyOutput{RevisionId, } => {
                                            Hash::hash(RevisionId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteResourcePolicyOutput {
                                fn default() -> DeleteResourcePolicyOutput {
                                    DeleteResourcePolicyOutput::DeleteResourcePolicyOutput {
                                        RevisionId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteResourcePolicyOutput>
                                for DeleteResourcePolicyOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(450,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteTableInput {
                                DeleteTableInput {
                                    TableName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DeleteTableInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeleteTableInput::DeleteTableInput{TableName, } => TableName,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteTableInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteTableInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteTableInput::DeleteTableInput{TableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteTableInput.DeleteTableInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteTableInput {}

                            impl Hash
                                for DeleteTableInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteTableInput::DeleteTableInput{TableName, } => {
                                            Hash::hash(TableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteTableInput {
                                fn default() -> DeleteTableInput {
                                    DeleteTableInput::DeleteTableInput {
                                        TableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteTableInput>
                                for DeleteTableInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(453,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteTableOutput {
                                DeleteTableOutput {
                                    TableDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>>
                                }
                            }

                            impl DeleteTableOutput {
                                /// Returns a borrow of the field TableDescription
                                pub fn TableDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>> {
                                    match self {
                                        DeleteTableOutput::DeleteTableOutput{TableDescription, } => TableDescription,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteTableOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteTableOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteTableOutput::DeleteTableOutput{TableDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteTableOutput.DeleteTableOutput(")?;
                                            DafnyPrint::fmt_print(TableDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteTableOutput {}

                            impl Hash
                                for DeleteTableOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteTableOutput::DeleteTableOutput{TableDescription, } => {
                                            Hash::hash(TableDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteTableOutput {
                                fn default() -> DeleteTableOutput {
                                    DeleteTableOutput::DeleteTableOutput {
                                        TableDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteTableOutput>
                                for DeleteTableOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(457,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeBackupInput {
                                DescribeBackupInput {
                                    BackupArn: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DescribeBackupInput {
                                /// Returns a borrow of the field BackupArn
                                pub fn BackupArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeBackupInput::DescribeBackupInput{BackupArn, } => BackupArn,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeBackupInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeBackupInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeBackupInput::DescribeBackupInput{BackupArn, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeBackupInput.DescribeBackupInput(")?;
                                            DafnyPrint::fmt_print(BackupArn, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeBackupInput {}

                            impl Hash
                                for DescribeBackupInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeBackupInput::DescribeBackupInput{BackupArn, } => {
                                            Hash::hash(BackupArn, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeBackupInput {
                                fn default() -> DescribeBackupInput {
                                    DescribeBackupInput::DescribeBackupInput {
                                        BackupArn: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeBackupInput>
                                for DescribeBackupInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(460,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeBackupOutput {
                                DescribeBackupOutput {
                                    BackupDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupDescription>>>
                                }
                            }

                            impl DescribeBackupOutput {
                                /// Returns a borrow of the field BackupDescription
                                pub fn BackupDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupDescription>>> {
                                    match self {
                                        DescribeBackupOutput::DescribeBackupOutput{BackupDescription, } => BackupDescription,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeBackupOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeBackupOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeBackupOutput::DescribeBackupOutput{BackupDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeBackupOutput.DescribeBackupOutput(")?;
                                            DafnyPrint::fmt_print(BackupDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeBackupOutput {}

                            impl Hash
                                for DescribeBackupOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeBackupOutput::DescribeBackupOutput{BackupDescription, } => {
                                            Hash::hash(BackupDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeBackupOutput {
                                fn default() -> DescribeBackupOutput {
                                    DescribeBackupOutput::DescribeBackupOutput {
                                        BackupDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeBackupOutput>
                                for DescribeBackupOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(463,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeContinuousBackupsInput {
                                DescribeContinuousBackupsInput {
                                    TableName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DescribeContinuousBackupsInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeContinuousBackupsInput::DescribeContinuousBackupsInput{TableName, } => TableName,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeContinuousBackupsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeContinuousBackupsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeContinuousBackupsInput::DescribeContinuousBackupsInput{TableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContinuousBackupsInput.DescribeContinuousBackupsInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeContinuousBackupsInput {}

                            impl Hash
                                for DescribeContinuousBackupsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeContinuousBackupsInput::DescribeContinuousBackupsInput{TableName, } => {
                                            Hash::hash(TableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeContinuousBackupsInput {
                                fn default() -> DescribeContinuousBackupsInput {
                                    DescribeContinuousBackupsInput::DescribeContinuousBackupsInput {
                                        TableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeContinuousBackupsInput>
                                for DescribeContinuousBackupsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(466,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeContinuousBackupsOutput {
                                DescribeContinuousBackupsOutput {
                                    ContinuousBackupsDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContinuousBackupsDescription>>>
                                }
                            }

                            impl DescribeContinuousBackupsOutput {
                                /// Returns a borrow of the field ContinuousBackupsDescription
                                pub fn ContinuousBackupsDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContinuousBackupsDescription>>> {
                                    match self {
                                        DescribeContinuousBackupsOutput::DescribeContinuousBackupsOutput{ContinuousBackupsDescription, } => ContinuousBackupsDescription,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeContinuousBackupsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeContinuousBackupsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeContinuousBackupsOutput::DescribeContinuousBackupsOutput{ContinuousBackupsDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContinuousBackupsOutput.DescribeContinuousBackupsOutput(")?;
                                            DafnyPrint::fmt_print(ContinuousBackupsDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeContinuousBackupsOutput {}

                            impl Hash
                                for DescribeContinuousBackupsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeContinuousBackupsOutput::DescribeContinuousBackupsOutput{ContinuousBackupsDescription, } => {
                                            Hash::hash(ContinuousBackupsDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeContinuousBackupsOutput {
                                fn default() -> DescribeContinuousBackupsOutput {
                                    DescribeContinuousBackupsOutput::DescribeContinuousBackupsOutput {
                                        ContinuousBackupsDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeContinuousBackupsOutput>
                                for DescribeContinuousBackupsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(469,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeContributorInsightsInput {
                                DescribeContributorInsightsInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl DescribeContributorInsightsInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeContributorInsightsInput::DescribeContributorInsightsInput{TableName, IndexName, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DescribeContributorInsightsInput::DescribeContributorInsightsInput{TableName, IndexName, } => IndexName,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeContributorInsightsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeContributorInsightsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeContributorInsightsInput::DescribeContributorInsightsInput{TableName, IndexName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContributorInsightsInput.DescribeContributorInsightsInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeContributorInsightsInput {}

                            impl Hash
                                for DescribeContributorInsightsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeContributorInsightsInput::DescribeContributorInsightsInput{TableName, IndexName, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(IndexName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeContributorInsightsInput {
                                fn default() -> DescribeContributorInsightsInput {
                                    DescribeContributorInsightsInput::DescribeContributorInsightsInput {
                                        TableName: Default::default(),
                                        IndexName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeContributorInsightsInput>
                                for DescribeContributorInsightsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(473,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeContributorInsightsOutput {
                                DescribeContributorInsightsOutput {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ContributorInsightsRuleList: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>,
                                    ContributorInsightsStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContributorInsightsStatus>>>,
                                    LastUpdateDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    FailureException: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::FailureException>>>
                                }
                            }

                            impl DescribeContributorInsightsOutput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DescribeContributorInsightsOutput::DescribeContributorInsightsOutput{TableName, IndexName, ContributorInsightsRuleList, ContributorInsightsStatus, LastUpdateDateTime, FailureException, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DescribeContributorInsightsOutput::DescribeContributorInsightsOutput{TableName, IndexName, ContributorInsightsRuleList, ContributorInsightsStatus, LastUpdateDateTime, FailureException, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ContributorInsightsRuleList
                                pub fn ContributorInsightsRuleList(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        DescribeContributorInsightsOutput::DescribeContributorInsightsOutput{TableName, IndexName, ContributorInsightsRuleList, ContributorInsightsStatus, LastUpdateDateTime, FailureException, } => ContributorInsightsRuleList,
                                    }
                                }
                                /// Returns a borrow of the field ContributorInsightsStatus
                                pub fn ContributorInsightsStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContributorInsightsStatus>>> {
                                    match self {
                                        DescribeContributorInsightsOutput::DescribeContributorInsightsOutput{TableName, IndexName, ContributorInsightsRuleList, ContributorInsightsStatus, LastUpdateDateTime, FailureException, } => ContributorInsightsStatus,
                                    }
                                }
                                /// Returns a borrow of the field LastUpdateDateTime
                                pub fn LastUpdateDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DescribeContributorInsightsOutput::DescribeContributorInsightsOutput{TableName, IndexName, ContributorInsightsRuleList, ContributorInsightsStatus, LastUpdateDateTime, FailureException, } => LastUpdateDateTime,
                                    }
                                }
                                /// Returns a borrow of the field FailureException
                                pub fn FailureException(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::FailureException>>> {
                                    match self {
                                        DescribeContributorInsightsOutput::DescribeContributorInsightsOutput{TableName, IndexName, ContributorInsightsRuleList, ContributorInsightsStatus, LastUpdateDateTime, FailureException, } => FailureException,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeContributorInsightsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeContributorInsightsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeContributorInsightsOutput::DescribeContributorInsightsOutput{TableName, IndexName, ContributorInsightsRuleList, ContributorInsightsStatus, LastUpdateDateTime, FailureException, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContributorInsightsOutput.DescribeContributorInsightsOutput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ContributorInsightsRuleList, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ContributorInsightsStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastUpdateDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(FailureException, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeContributorInsightsOutput {}

                            impl Hash
                                for DescribeContributorInsightsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeContributorInsightsOutput::DescribeContributorInsightsOutput{TableName, IndexName, ContributorInsightsRuleList, ContributorInsightsStatus, LastUpdateDateTime, FailureException, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ContributorInsightsRuleList, _state);
                                            Hash::hash(ContributorInsightsStatus, _state);
                                            Hash::hash(LastUpdateDateTime, _state);
                                            Hash::hash(FailureException, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeContributorInsightsOutput {
                                fn default() -> DescribeContributorInsightsOutput {
                                    DescribeContributorInsightsOutput::DescribeContributorInsightsOutput {
                                        TableName: Default::default(),
                                        IndexName: Default::default(),
                                        ContributorInsightsRuleList: Default::default(),
                                        ContributorInsightsStatus: Default::default(),
                                        LastUpdateDateTime: Default::default(),
                                        FailureException: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeContributorInsightsOutput>
                                for DescribeContributorInsightsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(481,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeEndpointsRequest {
                                DescribeEndpointsRequest {}
                            }

                            impl DescribeEndpointsRequest {}

                            impl Debug
                                for DescribeEndpointsRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeEndpointsRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeEndpointsRequest::DescribeEndpointsRequest{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeEndpointsRequest.DescribeEndpointsRequest")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl DescribeEndpointsRequest {
                                /// Enumerates all possible values of DescribeEndpointsRequest
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DescribeEndpointsRequest>> {
                                    seq![Arc::new(DescribeEndpointsRequest::DescribeEndpointsRequest {})].iter()
                                }
                            }

                            impl Eq
                                for DescribeEndpointsRequest {}

                            impl Hash
                                for DescribeEndpointsRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeEndpointsRequest::DescribeEndpointsRequest{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeEndpointsRequest {
                                fn default() -> DescribeEndpointsRequest {
                                    DescribeEndpointsRequest::DescribeEndpointsRequest {}
                                }
                            }

                            impl AsRef<DescribeEndpointsRequest>
                                for DescribeEndpointsRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(484,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeEndpointsResponse {
                                DescribeEndpointsResponse {
                                    Endpoints: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Endpoint>>
                                }
                            }

                            impl DescribeEndpointsResponse {
                                /// Returns a borrow of the field Endpoints
                                pub fn Endpoints(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Endpoint>> {
                                    match self {
                                        DescribeEndpointsResponse::DescribeEndpointsResponse{Endpoints, } => Endpoints,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeEndpointsResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeEndpointsResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeEndpointsResponse::DescribeEndpointsResponse{Endpoints, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeEndpointsResponse.DescribeEndpointsResponse(")?;
                                            DafnyPrint::fmt_print(Endpoints, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeEndpointsResponse {}

                            impl Hash
                                for DescribeEndpointsResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeEndpointsResponse::DescribeEndpointsResponse{Endpoints, } => {
                                            Hash::hash(Endpoints, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeEndpointsResponse {
                                fn default() -> DescribeEndpointsResponse {
                                    DescribeEndpointsResponse::DescribeEndpointsResponse {
                                        Endpoints: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeEndpointsResponse>
                                for DescribeEndpointsResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(487,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeExportInput {
                                DescribeExportInput {
                                    ExportArn: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DescribeExportInput {
                                /// Returns a borrow of the field ExportArn
                                pub fn ExportArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeExportInput::DescribeExportInput{ExportArn, } => ExportArn,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeExportInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeExportInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeExportInput::DescribeExportInput{ExportArn, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeExportInput.DescribeExportInput(")?;
                                            DafnyPrint::fmt_print(ExportArn, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeExportInput {}

                            impl Hash
                                for DescribeExportInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeExportInput::DescribeExportInput{ExportArn, } => {
                                            Hash::hash(ExportArn, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeExportInput {
                                fn default() -> DescribeExportInput {
                                    DescribeExportInput::DescribeExportInput {
                                        ExportArn: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeExportInput>
                                for DescribeExportInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(490,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeExportOutput {
                                DescribeExportOutput {
                                    ExportDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportDescription>>>
                                }
                            }

                            impl DescribeExportOutput {
                                /// Returns a borrow of the field ExportDescription
                                pub fn ExportDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportDescription>>> {
                                    match self {
                                        DescribeExportOutput::DescribeExportOutput{ExportDescription, } => ExportDescription,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeExportOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeExportOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeExportOutput::DescribeExportOutput{ExportDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeExportOutput.DescribeExportOutput(")?;
                                            DafnyPrint::fmt_print(ExportDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeExportOutput {}

                            impl Hash
                                for DescribeExportOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeExportOutput::DescribeExportOutput{ExportDescription, } => {
                                            Hash::hash(ExportDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeExportOutput {
                                fn default() -> DescribeExportOutput {
                                    DescribeExportOutput::DescribeExportOutput {
                                        ExportDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeExportOutput>
                                for DescribeExportOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(493,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeGlobalTableInput {
                                DescribeGlobalTableInput {
                                    GlobalTableName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DescribeGlobalTableInput {
                                /// Returns a borrow of the field GlobalTableName
                                pub fn GlobalTableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeGlobalTableInput::DescribeGlobalTableInput{GlobalTableName, } => GlobalTableName,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeGlobalTableInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeGlobalTableInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeGlobalTableInput::DescribeGlobalTableInput{GlobalTableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableInput.DescribeGlobalTableInput(")?;
                                            DafnyPrint::fmt_print(GlobalTableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeGlobalTableInput {}

                            impl Hash
                                for DescribeGlobalTableInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeGlobalTableInput::DescribeGlobalTableInput{GlobalTableName, } => {
                                            Hash::hash(GlobalTableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeGlobalTableInput {
                                fn default() -> DescribeGlobalTableInput {
                                    DescribeGlobalTableInput::DescribeGlobalTableInput {
                                        GlobalTableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeGlobalTableInput>
                                for DescribeGlobalTableInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(496,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeGlobalTableOutput {
                                DescribeGlobalTableOutput {
                                    GlobalTableDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableDescription>>>
                                }
                            }

                            impl DescribeGlobalTableOutput {
                                /// Returns a borrow of the field GlobalTableDescription
                                pub fn GlobalTableDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableDescription>>> {
                                    match self {
                                        DescribeGlobalTableOutput::DescribeGlobalTableOutput{GlobalTableDescription, } => GlobalTableDescription,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeGlobalTableOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeGlobalTableOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeGlobalTableOutput::DescribeGlobalTableOutput{GlobalTableDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableOutput.DescribeGlobalTableOutput(")?;
                                            DafnyPrint::fmt_print(GlobalTableDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeGlobalTableOutput {}

                            impl Hash
                                for DescribeGlobalTableOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeGlobalTableOutput::DescribeGlobalTableOutput{GlobalTableDescription, } => {
                                            Hash::hash(GlobalTableDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeGlobalTableOutput {
                                fn default() -> DescribeGlobalTableOutput {
                                    DescribeGlobalTableOutput::DescribeGlobalTableOutput {
                                        GlobalTableDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeGlobalTableOutput>
                                for DescribeGlobalTableOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(499,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeGlobalTableSettingsInput {
                                DescribeGlobalTableSettingsInput {
                                    GlobalTableName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DescribeGlobalTableSettingsInput {
                                /// Returns a borrow of the field GlobalTableName
                                pub fn GlobalTableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeGlobalTableSettingsInput::DescribeGlobalTableSettingsInput{GlobalTableName, } => GlobalTableName,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeGlobalTableSettingsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeGlobalTableSettingsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeGlobalTableSettingsInput::DescribeGlobalTableSettingsInput{GlobalTableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableSettingsInput.DescribeGlobalTableSettingsInput(")?;
                                            DafnyPrint::fmt_print(GlobalTableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeGlobalTableSettingsInput {}

                            impl Hash
                                for DescribeGlobalTableSettingsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeGlobalTableSettingsInput::DescribeGlobalTableSettingsInput{GlobalTableName, } => {
                                            Hash::hash(GlobalTableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeGlobalTableSettingsInput {
                                fn default() -> DescribeGlobalTableSettingsInput {
                                    DescribeGlobalTableSettingsInput::DescribeGlobalTableSettingsInput {
                                        GlobalTableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeGlobalTableSettingsInput>
                                for DescribeGlobalTableSettingsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(502,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeGlobalTableSettingsOutput {
                                DescribeGlobalTableSettingsOutput {
                                    GlobalTableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ReplicaSettings: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaSettingsDescription>>>>
                                }
                            }

                            impl DescribeGlobalTableSettingsOutput {
                                /// Returns a borrow of the field GlobalTableName
                                pub fn GlobalTableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DescribeGlobalTableSettingsOutput::DescribeGlobalTableSettingsOutput{GlobalTableName, ReplicaSettings, } => GlobalTableName,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaSettings
                                pub fn ReplicaSettings(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaSettingsDescription>>>> {
                                    match self {
                                        DescribeGlobalTableSettingsOutput::DescribeGlobalTableSettingsOutput{GlobalTableName, ReplicaSettings, } => ReplicaSettings,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeGlobalTableSettingsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeGlobalTableSettingsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeGlobalTableSettingsOutput::DescribeGlobalTableSettingsOutput{GlobalTableName, ReplicaSettings, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableSettingsOutput.DescribeGlobalTableSettingsOutput(")?;
                                            DafnyPrint::fmt_print(GlobalTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaSettings, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeGlobalTableSettingsOutput {}

                            impl Hash
                                for DescribeGlobalTableSettingsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeGlobalTableSettingsOutput::DescribeGlobalTableSettingsOutput{GlobalTableName, ReplicaSettings, } => {
                                            Hash::hash(GlobalTableName, _state);
                                            Hash::hash(ReplicaSettings, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeGlobalTableSettingsOutput {
                                fn default() -> DescribeGlobalTableSettingsOutput {
                                    DescribeGlobalTableSettingsOutput::DescribeGlobalTableSettingsOutput {
                                        GlobalTableName: Default::default(),
                                        ReplicaSettings: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeGlobalTableSettingsOutput>
                                for DescribeGlobalTableSettingsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(506,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeImportInput {
                                DescribeImportInput {
                                    ImportArn: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DescribeImportInput {
                                /// Returns a borrow of the field ImportArn
                                pub fn ImportArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeImportInput::DescribeImportInput{ImportArn, } => ImportArn,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeImportInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeImportInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeImportInput::DescribeImportInput{ImportArn, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeImportInput.DescribeImportInput(")?;
                                            DafnyPrint::fmt_print(ImportArn, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeImportInput {}

                            impl Hash
                                for DescribeImportInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeImportInput::DescribeImportInput{ImportArn, } => {
                                            Hash::hash(ImportArn, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeImportInput {
                                fn default() -> DescribeImportInput {
                                    DescribeImportInput::DescribeImportInput {
                                        ImportArn: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeImportInput>
                                for DescribeImportInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(509,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeImportOutput {
                                DescribeImportOutput {
                                    ImportTableDescription: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportTableDescription>
                                }
                            }

                            impl DescribeImportOutput {
                                /// Returns a borrow of the field ImportTableDescription
                                pub fn ImportTableDescription(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportTableDescription> {
                                    match self {
                                        DescribeImportOutput::DescribeImportOutput{ImportTableDescription, } => ImportTableDescription,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeImportOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeImportOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeImportOutput::DescribeImportOutput{ImportTableDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeImportOutput.DescribeImportOutput(")?;
                                            DafnyPrint::fmt_print(ImportTableDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeImportOutput {}

                            impl Hash
                                for DescribeImportOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeImportOutput::DescribeImportOutput{ImportTableDescription, } => {
                                            Hash::hash(ImportTableDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeImportOutput {
                                fn default() -> DescribeImportOutput {
                                    DescribeImportOutput::DescribeImportOutput {
                                        ImportTableDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeImportOutput>
                                for DescribeImportOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(512,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeKinesisStreamingDestinationInput {
                                DescribeKinesisStreamingDestinationInput {
                                    TableName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DescribeKinesisStreamingDestinationInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeKinesisStreamingDestinationInput::DescribeKinesisStreamingDestinationInput{TableName, } => TableName,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeKinesisStreamingDestinationInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeKinesisStreamingDestinationInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeKinesisStreamingDestinationInput::DescribeKinesisStreamingDestinationInput{TableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeKinesisStreamingDestinationInput.DescribeKinesisStreamingDestinationInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeKinesisStreamingDestinationInput {}

                            impl Hash
                                for DescribeKinesisStreamingDestinationInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeKinesisStreamingDestinationInput::DescribeKinesisStreamingDestinationInput{TableName, } => {
                                            Hash::hash(TableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeKinesisStreamingDestinationInput {
                                fn default() -> DescribeKinesisStreamingDestinationInput {
                                    DescribeKinesisStreamingDestinationInput::DescribeKinesisStreamingDestinationInput {
                                        TableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeKinesisStreamingDestinationInput>
                                for DescribeKinesisStreamingDestinationInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(515,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeKinesisStreamingDestinationOutput {
                                DescribeKinesisStreamingDestinationOutput {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KinesisDataStreamDestinations: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KinesisDataStreamDestination>>>>
                                }
                            }

                            impl DescribeKinesisStreamingDestinationOutput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DescribeKinesisStreamingDestinationOutput::DescribeKinesisStreamingDestinationOutput{TableName, KinesisDataStreamDestinations, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field KinesisDataStreamDestinations
                                pub fn KinesisDataStreamDestinations(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KinesisDataStreamDestination>>>> {
                                    match self {
                                        DescribeKinesisStreamingDestinationOutput::DescribeKinesisStreamingDestinationOutput{TableName, KinesisDataStreamDestinations, } => KinesisDataStreamDestinations,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeKinesisStreamingDestinationOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeKinesisStreamingDestinationOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeKinesisStreamingDestinationOutput::DescribeKinesisStreamingDestinationOutput{TableName, KinesisDataStreamDestinations, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeKinesisStreamingDestinationOutput.DescribeKinesisStreamingDestinationOutput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KinesisDataStreamDestinations, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeKinesisStreamingDestinationOutput {}

                            impl Hash
                                for DescribeKinesisStreamingDestinationOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeKinesisStreamingDestinationOutput::DescribeKinesisStreamingDestinationOutput{TableName, KinesisDataStreamDestinations, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(KinesisDataStreamDestinations, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeKinesisStreamingDestinationOutput {
                                fn default() -> DescribeKinesisStreamingDestinationOutput {
                                    DescribeKinesisStreamingDestinationOutput::DescribeKinesisStreamingDestinationOutput {
                                        TableName: Default::default(),
                                        KinesisDataStreamDestinations: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeKinesisStreamingDestinationOutput>
                                for DescribeKinesisStreamingDestinationOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(519,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeLimitsInput {
                                DescribeLimitsInput {}
                            }

                            impl DescribeLimitsInput {}

                            impl Debug
                                for DescribeLimitsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeLimitsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeLimitsInput::DescribeLimitsInput{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeLimitsInput.DescribeLimitsInput")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl DescribeLimitsInput {
                                /// Enumerates all possible values of DescribeLimitsInput
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DescribeLimitsInput>> {
                                    seq![Arc::new(DescribeLimitsInput::DescribeLimitsInput {})].iter()
                                }
                            }

                            impl Eq
                                for DescribeLimitsInput {}

                            impl Hash
                                for DescribeLimitsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeLimitsInput::DescribeLimitsInput{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeLimitsInput {
                                fn default() -> DescribeLimitsInput {
                                    DescribeLimitsInput::DescribeLimitsInput {}
                                }
                            }

                            impl AsRef<DescribeLimitsInput>
                                for DescribeLimitsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(522,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeLimitsOutput {
                                DescribeLimitsOutput {
                                    AccountMaxReadCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    AccountMaxWriteCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    TableMaxReadCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    TableMaxWriteCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>
                                }
                            }

                            impl DescribeLimitsOutput {
                                /// Returns a borrow of the field AccountMaxReadCapacityUnits
                                pub fn AccountMaxReadCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        DescribeLimitsOutput::DescribeLimitsOutput{AccountMaxReadCapacityUnits, AccountMaxWriteCapacityUnits, TableMaxReadCapacityUnits, TableMaxWriteCapacityUnits, } => AccountMaxReadCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field AccountMaxWriteCapacityUnits
                                pub fn AccountMaxWriteCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        DescribeLimitsOutput::DescribeLimitsOutput{AccountMaxReadCapacityUnits, AccountMaxWriteCapacityUnits, TableMaxReadCapacityUnits, TableMaxWriteCapacityUnits, } => AccountMaxWriteCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field TableMaxReadCapacityUnits
                                pub fn TableMaxReadCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        DescribeLimitsOutput::DescribeLimitsOutput{AccountMaxReadCapacityUnits, AccountMaxWriteCapacityUnits, TableMaxReadCapacityUnits, TableMaxWriteCapacityUnits, } => TableMaxReadCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field TableMaxWriteCapacityUnits
                                pub fn TableMaxWriteCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        DescribeLimitsOutput::DescribeLimitsOutput{AccountMaxReadCapacityUnits, AccountMaxWriteCapacityUnits, TableMaxReadCapacityUnits, TableMaxWriteCapacityUnits, } => TableMaxWriteCapacityUnits,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeLimitsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeLimitsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeLimitsOutput::DescribeLimitsOutput{AccountMaxReadCapacityUnits, AccountMaxWriteCapacityUnits, TableMaxReadCapacityUnits, TableMaxWriteCapacityUnits, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeLimitsOutput.DescribeLimitsOutput(")?;
                                            DafnyPrint::fmt_print(AccountMaxReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AccountMaxWriteCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableMaxReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableMaxWriteCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeLimitsOutput {}

                            impl Hash
                                for DescribeLimitsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeLimitsOutput::DescribeLimitsOutput{AccountMaxReadCapacityUnits, AccountMaxWriteCapacityUnits, TableMaxReadCapacityUnits, TableMaxWriteCapacityUnits, } => {
                                            Hash::hash(AccountMaxReadCapacityUnits, _state);
                                            Hash::hash(AccountMaxWriteCapacityUnits, _state);
                                            Hash::hash(TableMaxReadCapacityUnits, _state);
                                            Hash::hash(TableMaxWriteCapacityUnits, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeLimitsOutput {
                                fn default() -> DescribeLimitsOutput {
                                    DescribeLimitsOutput::DescribeLimitsOutput {
                                        AccountMaxReadCapacityUnits: Default::default(),
                                        AccountMaxWriteCapacityUnits: Default::default(),
                                        TableMaxReadCapacityUnits: Default::default(),
                                        TableMaxWriteCapacityUnits: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeLimitsOutput>
                                for DescribeLimitsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(528,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeTableInput {
                                DescribeTableInput {
                                    TableName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DescribeTableInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeTableInput::DescribeTableInput{TableName, } => TableName,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeTableInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeTableInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeTableInput::DescribeTableInput{TableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableInput.DescribeTableInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeTableInput {}

                            impl Hash
                                for DescribeTableInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeTableInput::DescribeTableInput{TableName, } => {
                                            Hash::hash(TableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeTableInput {
                                fn default() -> DescribeTableInput {
                                    DescribeTableInput::DescribeTableInput {
                                        TableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeTableInput>
                                for DescribeTableInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(531,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeTableOutput {
                                DescribeTableOutput {
                                    Table: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>>
                                }
                            }

                            impl DescribeTableOutput {
                                /// Returns a borrow of the field Table
                                pub fn Table(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>> {
                                    match self {
                                        DescribeTableOutput::DescribeTableOutput{Table, } => Table,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeTableOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeTableOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeTableOutput::DescribeTableOutput{Table, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableOutput.DescribeTableOutput(")?;
                                            DafnyPrint::fmt_print(Table, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeTableOutput {}

                            impl Hash
                                for DescribeTableOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeTableOutput::DescribeTableOutput{Table, } => {
                                            Hash::hash(Table, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeTableOutput {
                                fn default() -> DescribeTableOutput {
                                    DescribeTableOutput::DescribeTableOutput {
                                        Table: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeTableOutput>
                                for DescribeTableOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(534,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeTableReplicaAutoScalingInput {
                                DescribeTableReplicaAutoScalingInput {
                                    TableName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DescribeTableReplicaAutoScalingInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeTableReplicaAutoScalingInput::DescribeTableReplicaAutoScalingInput{TableName, } => TableName,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeTableReplicaAutoScalingInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeTableReplicaAutoScalingInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeTableReplicaAutoScalingInput::DescribeTableReplicaAutoScalingInput{TableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableReplicaAutoScalingInput.DescribeTableReplicaAutoScalingInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeTableReplicaAutoScalingInput {}

                            impl Hash
                                for DescribeTableReplicaAutoScalingInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeTableReplicaAutoScalingInput::DescribeTableReplicaAutoScalingInput{TableName, } => {
                                            Hash::hash(TableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeTableReplicaAutoScalingInput {
                                fn default() -> DescribeTableReplicaAutoScalingInput {
                                    DescribeTableReplicaAutoScalingInput::DescribeTableReplicaAutoScalingInput {
                                        TableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeTableReplicaAutoScalingInput>
                                for DescribeTableReplicaAutoScalingInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(537,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeTableReplicaAutoScalingOutput {
                                DescribeTableReplicaAutoScalingOutput {
                                    TableAutoScalingDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableAutoScalingDescription>>>
                                }
                            }

                            impl DescribeTableReplicaAutoScalingOutput {
                                /// Returns a borrow of the field TableAutoScalingDescription
                                pub fn TableAutoScalingDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableAutoScalingDescription>>> {
                                    match self {
                                        DescribeTableReplicaAutoScalingOutput::DescribeTableReplicaAutoScalingOutput{TableAutoScalingDescription, } => TableAutoScalingDescription,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeTableReplicaAutoScalingOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeTableReplicaAutoScalingOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeTableReplicaAutoScalingOutput::DescribeTableReplicaAutoScalingOutput{TableAutoScalingDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableReplicaAutoScalingOutput.DescribeTableReplicaAutoScalingOutput(")?;
                                            DafnyPrint::fmt_print(TableAutoScalingDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeTableReplicaAutoScalingOutput {}

                            impl Hash
                                for DescribeTableReplicaAutoScalingOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeTableReplicaAutoScalingOutput::DescribeTableReplicaAutoScalingOutput{TableAutoScalingDescription, } => {
                                            Hash::hash(TableAutoScalingDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeTableReplicaAutoScalingOutput {
                                fn default() -> DescribeTableReplicaAutoScalingOutput {
                                    DescribeTableReplicaAutoScalingOutput::DescribeTableReplicaAutoScalingOutput {
                                        TableAutoScalingDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeTableReplicaAutoScalingOutput>
                                for DescribeTableReplicaAutoScalingOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(540,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeTimeToLiveInput {
                                DescribeTimeToLiveInput {
                                    TableName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DescribeTimeToLiveInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeTimeToLiveInput::DescribeTimeToLiveInput{TableName, } => TableName,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeTimeToLiveInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeTimeToLiveInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeTimeToLiveInput::DescribeTimeToLiveInput{TableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTimeToLiveInput.DescribeTimeToLiveInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeTimeToLiveInput {}

                            impl Hash
                                for DescribeTimeToLiveInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeTimeToLiveInput::DescribeTimeToLiveInput{TableName, } => {
                                            Hash::hash(TableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeTimeToLiveInput {
                                fn default() -> DescribeTimeToLiveInput {
                                    DescribeTimeToLiveInput::DescribeTimeToLiveInput {
                                        TableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeTimeToLiveInput>
                                for DescribeTimeToLiveInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(543,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeTimeToLiveOutput {
                                DescribeTimeToLiveOutput {
                                    TimeToLiveDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TimeToLiveDescription>>>
                                }
                            }

                            impl DescribeTimeToLiveOutput {
                                /// Returns a borrow of the field TimeToLiveDescription
                                pub fn TimeToLiveDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TimeToLiveDescription>>> {
                                    match self {
                                        DescribeTimeToLiveOutput::DescribeTimeToLiveOutput{TimeToLiveDescription, } => TimeToLiveDescription,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeTimeToLiveOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeTimeToLiveOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeTimeToLiveOutput::DescribeTimeToLiveOutput{TimeToLiveDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTimeToLiveOutput.DescribeTimeToLiveOutput(")?;
                                            DafnyPrint::fmt_print(TimeToLiveDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeTimeToLiveOutput {}

                            impl Hash
                                for DescribeTimeToLiveOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeTimeToLiveOutput::DescribeTimeToLiveOutput{TimeToLiveDescription, } => {
                                            Hash::hash(TimeToLiveDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeTimeToLiveOutput {
                                fn default() -> DescribeTimeToLiveOutput {
                                    DescribeTimeToLiveOutput::DescribeTimeToLiveOutput {
                                        TimeToLiveDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeTimeToLiveOutput>
                                for DescribeTimeToLiveOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(546,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DestinationStatus {
                                ENABLING {},
                                ACTIVE {},
                                DISABLING {},
                                DISABLED {},
                                ENABLE_FAILED {},
                                UPDATING {}
                            }

                            impl DestinationStatus {}

                            impl Debug
                                for DestinationStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DestinationStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DestinationStatus::ENABLING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DestinationStatus.ENABLING")?;
                                            Ok(())
                                        },
                                        DestinationStatus::ACTIVE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DestinationStatus.ACTIVE")?;
                                            Ok(())
                                        },
                                        DestinationStatus::DISABLING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DestinationStatus.DISABLING")?;
                                            Ok(())
                                        },
                                        DestinationStatus::DISABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DestinationStatus.DISABLED")?;
                                            Ok(())
                                        },
                                        DestinationStatus::ENABLE_FAILED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DestinationStatus.ENABLE__FAILED")?;
                                            Ok(())
                                        },
                                        DestinationStatus::UPDATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DestinationStatus.UPDATING")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl DestinationStatus {
                                /// Enumerates all possible values of DestinationStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DestinationStatus>> {
                                    seq![Arc::new(DestinationStatus::ENABLING {}), Arc::new(DestinationStatus::ACTIVE {}), Arc::new(DestinationStatus::DISABLING {}), Arc::new(DestinationStatus::DISABLED {}), Arc::new(DestinationStatus::ENABLE_FAILED {}), Arc::new(DestinationStatus::UPDATING {})].iter()
                                }
                            }

                            impl Eq
                                for DestinationStatus {}

                            impl Hash
                                for DestinationStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DestinationStatus::ENABLING{} => {

                                        },
                                        DestinationStatus::ACTIVE{} => {

                                        },
                                        DestinationStatus::DISABLING{} => {

                                        },
                                        DestinationStatus::DISABLED{} => {

                                        },
                                        DestinationStatus::ENABLE_FAILED{} => {

                                        },
                                        DestinationStatus::UPDATING{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for DestinationStatus {
                                fn default() -> DestinationStatus {
                                    DestinationStatus::ENABLING {}
                                }
                            }

                            impl AsRef<DestinationStatus>
                                for DestinationStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(553,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DisableKinesisStreamingDestinationInput {
                                DisableKinesisStreamingDestinationInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    StreamArn: Sequence<DafnyCharUTF16>,
                                    EnableKinesisStreamingConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>>
                                }
                            }

                            impl DisableKinesisStreamingDestinationInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DisableKinesisStreamingDestinationInput::DisableKinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field StreamArn
                                pub fn StreamArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DisableKinesisStreamingDestinationInput::DisableKinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => StreamArn,
                                    }
                                }
                                /// Returns a borrow of the field EnableKinesisStreamingConfiguration
                                pub fn EnableKinesisStreamingConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>> {
                                    match self {
                                        DisableKinesisStreamingDestinationInput::DisableKinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => EnableKinesisStreamingConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for DisableKinesisStreamingDestinationInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DisableKinesisStreamingDestinationInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DisableKinesisStreamingDestinationInput::DisableKinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DisableKinesisStreamingDestinationInput.DisableKinesisStreamingDestinationInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EnableKinesisStreamingConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DisableKinesisStreamingDestinationInput {}

                            impl Hash
                                for DisableKinesisStreamingDestinationInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DisableKinesisStreamingDestinationInput::DisableKinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(StreamArn, _state);
                                            Hash::hash(EnableKinesisStreamingConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DisableKinesisStreamingDestinationInput {
                                fn default() -> DisableKinesisStreamingDestinationInput {
                                    DisableKinesisStreamingDestinationInput::DisableKinesisStreamingDestinationInput {
                                        TableName: Default::default(),
                                        StreamArn: Default::default(),
                                        EnableKinesisStreamingConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DisableKinesisStreamingDestinationInput>
                                for DisableKinesisStreamingDestinationInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(558,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DisableKinesisStreamingDestinationOutput {
                                DisableKinesisStreamingDestinationOutput {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    StreamArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    DestinationStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DestinationStatus>>>,
                                    EnableKinesisStreamingConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>>
                                }
                            }

                            impl DisableKinesisStreamingDestinationOutput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DisableKinesisStreamingDestinationOutput::DisableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field StreamArn
                                pub fn StreamArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DisableKinesisStreamingDestinationOutput::DisableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => StreamArn,
                                    }
                                }
                                /// Returns a borrow of the field DestinationStatus
                                pub fn DestinationStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DestinationStatus>>> {
                                    match self {
                                        DisableKinesisStreamingDestinationOutput::DisableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => DestinationStatus,
                                    }
                                }
                                /// Returns a borrow of the field EnableKinesisStreamingConfiguration
                                pub fn EnableKinesisStreamingConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>> {
                                    match self {
                                        DisableKinesisStreamingDestinationOutput::DisableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => EnableKinesisStreamingConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for DisableKinesisStreamingDestinationOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DisableKinesisStreamingDestinationOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DisableKinesisStreamingDestinationOutput::DisableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.DisableKinesisStreamingDestinationOutput.DisableKinesisStreamingDestinationOutput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DestinationStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EnableKinesisStreamingConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DisableKinesisStreamingDestinationOutput {}

                            impl Hash
                                for DisableKinesisStreamingDestinationOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DisableKinesisStreamingDestinationOutput::DisableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(StreamArn, _state);
                                            Hash::hash(DestinationStatus, _state);
                                            Hash::hash(EnableKinesisStreamingConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DisableKinesisStreamingDestinationOutput {
                                fn default() -> DisableKinesisStreamingDestinationOutput {
                                    DisableKinesisStreamingDestinationOutput::DisableKinesisStreamingDestinationOutput {
                                        TableName: Default::default(),
                                        StreamArn: Default::default(),
                                        DestinationStatus: Default::default(),
                                        EnableKinesisStreamingConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DisableKinesisStreamingDestinationOutput>
                                for DisableKinesisStreamingDestinationOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(564,3)
                            pub type DoubleObject = Sequence<u8>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(568,3)
                            pub struct IDynamoDBClientCallHistory {}

                            impl IDynamoDBClientCallHistory {
                                /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                                pub fn _allocate_object() -> Object<Self> {
                                    allocate_object::<Self>()
                                }
                            }

                            impl UpcastObject<DynAny>
                                for crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClientCallHistory {
                                UpcastObjectFn!(DynAny);
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(686,3)
                            pub trait IDynamoDBClient: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(715,5)
                                fn BatchExecuteStatement(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchExecuteStatementInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchExecuteStatementOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(730,5)
                                fn BatchGetItem(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetItemInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchGetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(745,5)
                                fn BatchWriteItem(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchWriteItemInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchWriteItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(760,5)
                                fn CreateBackup(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateBackupInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateBackupOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(775,5)
                                fn CreateGlobalTable(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateGlobalTableInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateGlobalTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(790,5)
                                fn CreateTable(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateTableInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(805,5)
                                fn DeleteBackup(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteBackupInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteBackupOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(820,5)
                                fn DeleteItem(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteItemInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(835,5)
                                fn DeleteResourcePolicy(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteResourcePolicyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteResourcePolicyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(850,5)
                                fn DeleteTable(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteTableInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(865,5)
                                fn DescribeBackup(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeBackupInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeBackupOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(880,5)
                                fn DescribeContinuousBackups(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeContinuousBackupsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeContinuousBackupsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(895,5)
                                fn DescribeContributorInsights(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeContributorInsightsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeContributorInsightsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(910,5)
                                fn DescribeEndpoints(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeEndpointsRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeEndpointsResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(925,5)
                                fn DescribeExport(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeExportInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeExportOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(940,5)
                                fn DescribeGlobalTable(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeGlobalTableInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeGlobalTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(955,5)
                                fn DescribeGlobalTableSettings(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeGlobalTableSettingsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeGlobalTableSettingsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(970,5)
                                fn DescribeImport(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeImportInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeImportOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(985,5)
                                fn DescribeKinesisStreamingDestination(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeKinesisStreamingDestinationInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeKinesisStreamingDestinationOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1000,5)
                                fn DescribeLimits(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeLimitsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeLimitsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1015,5)
                                fn DescribeTable(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1030,5)
                                fn DescribeTableReplicaAutoScaling(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableReplicaAutoScalingInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableReplicaAutoScalingOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1045,5)
                                fn DescribeTimeToLive(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTimeToLiveInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTimeToLiveOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1060,5)
                                fn DisableKinesisStreamingDestination(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DisableKinesisStreamingDestinationInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DisableKinesisStreamingDestinationOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1075,5)
                                fn EnableKinesisStreamingDestination(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingDestinationInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingDestinationOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1090,5)
                                fn ExecuteStatement(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExecuteStatementInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExecuteStatementOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1105,5)
                                fn ExecuteTransaction(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExecuteTransactionInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExecuteTransactionOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1120,5)
                                fn ExportTableToPointInTime(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportTableToPointInTimeInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportTableToPointInTimeOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1135,5)
                                fn GetItem(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GetItemInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1150,5)
                                fn GetResourcePolicy(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GetResourcePolicyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GetResourcePolicyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1165,5)
                                fn ImportTable(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportTableInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1180,5)
                                fn ListBackups(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListBackupsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListBackupsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1195,5)
                                fn ListContributorInsights(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListContributorInsightsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListContributorInsightsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1210,5)
                                fn ListExports(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListExportsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListExportsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1225,5)
                                fn ListGlobalTables(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListGlobalTablesInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListGlobalTablesOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1240,5)
                                fn ListImports(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListImportsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListImportsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1255,5)
                                fn ListTables(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListTablesInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListTablesOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1270,5)
                                fn ListTagsOfResource(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListTagsOfResourceInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListTagsOfResourceOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1285,5)
                                fn PutItem(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PutItemInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PutItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1300,5)
                                fn PutResourcePolicy(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PutResourcePolicyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PutResourcePolicyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1315,5)
                                fn Query(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::QueryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::QueryOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1330,5)
                                fn RestoreTableFromBackup(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::RestoreTableFromBackupInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::RestoreTableFromBackupOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1345,5)
                                fn RestoreTableToPointInTime(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::RestoreTableToPointInTimeInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::RestoreTableToPointInTimeOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1360,5)
                                fn Scan(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1375,5)
                                fn TagResource(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TagResourceInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1390,5)
                                fn TransactGetItems(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactGetItemsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactGetItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1405,5)
                                fn TransactWriteItems(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1420,5)
                                fn UntagResource(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UntagResourceInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1435,5)
                                fn UpdateContinuousBackups(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateContinuousBackupsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateContinuousBackupsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1450,5)
                                fn UpdateContributorInsights(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateContributorInsightsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateContributorInsightsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1465,5)
                                fn UpdateGlobalTable(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateGlobalTableInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateGlobalTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1480,5)
                                fn UpdateGlobalTableSettings(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateGlobalTableSettingsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateGlobalTableSettingsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1495,5)
                                fn UpdateItem(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateItemInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1510,5)
                                fn UpdateKinesisStreamingDestination(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateKinesisStreamingDestinationInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateKinesisStreamingDestinationOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1525,5)
                                fn UpdateTable(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateTableInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1540,5)
                                fn UpdateTableReplicaAutoScaling(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateTableReplicaAutoScalingInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateTableReplicaAutoScalingOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1555,5)
                                fn UpdateTimeToLive(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateTimeToLiveInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateTimeToLiveOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1569,3)
                            #[derive(PartialEq, Clone)]
                            pub enum EnableKinesisStreamingConfiguration {
                                EnableKinesisStreamingConfiguration {
                                    ApproximateCreationDateTimePrecision: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ApproximateCreationDateTimePrecision>>>
                                }
                            }

                            impl EnableKinesisStreamingConfiguration {
                                /// Returns a borrow of the field ApproximateCreationDateTimePrecision
                                pub fn ApproximateCreationDateTimePrecision(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ApproximateCreationDateTimePrecision>>> {
                                    match self {
                                        EnableKinesisStreamingConfiguration::EnableKinesisStreamingConfiguration{ApproximateCreationDateTimePrecision, } => ApproximateCreationDateTimePrecision,
                                    }
                                }
                            }

                            impl Debug
                                for EnableKinesisStreamingConfiguration {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for EnableKinesisStreamingConfiguration {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        EnableKinesisStreamingConfiguration::EnableKinesisStreamingConfiguration{ApproximateCreationDateTimePrecision, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.EnableKinesisStreamingConfiguration.EnableKinesisStreamingConfiguration(")?;
                                            DafnyPrint::fmt_print(ApproximateCreationDateTimePrecision, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for EnableKinesisStreamingConfiguration {}

                            impl Hash
                                for EnableKinesisStreamingConfiguration {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        EnableKinesisStreamingConfiguration::EnableKinesisStreamingConfiguration{ApproximateCreationDateTimePrecision, } => {
                                            Hash::hash(ApproximateCreationDateTimePrecision, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for EnableKinesisStreamingConfiguration {
                                fn default() -> EnableKinesisStreamingConfiguration {
                                    EnableKinesisStreamingConfiguration::EnableKinesisStreamingConfiguration {
                                        ApproximateCreationDateTimePrecision: Default::default()
                                    }
                                }
                            }

                            impl AsRef<EnableKinesisStreamingConfiguration>
                                for EnableKinesisStreamingConfiguration {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1572,3)
                            #[derive(PartialEq, Clone)]
                            pub enum EnableKinesisStreamingDestinationInput {
                                EnableKinesisStreamingDestinationInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    StreamArn: Sequence<DafnyCharUTF16>,
                                    EnableKinesisStreamingConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>>
                                }
                            }

                            impl EnableKinesisStreamingDestinationInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        EnableKinesisStreamingDestinationInput::EnableKinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field StreamArn
                                pub fn StreamArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        EnableKinesisStreamingDestinationInput::EnableKinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => StreamArn,
                                    }
                                }
                                /// Returns a borrow of the field EnableKinesisStreamingConfiguration
                                pub fn EnableKinesisStreamingConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>> {
                                    match self {
                                        EnableKinesisStreamingDestinationInput::EnableKinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => EnableKinesisStreamingConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for EnableKinesisStreamingDestinationInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for EnableKinesisStreamingDestinationInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        EnableKinesisStreamingDestinationInput::EnableKinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.EnableKinesisStreamingDestinationInput.EnableKinesisStreamingDestinationInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EnableKinesisStreamingConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for EnableKinesisStreamingDestinationInput {}

                            impl Hash
                                for EnableKinesisStreamingDestinationInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        EnableKinesisStreamingDestinationInput::EnableKinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(StreamArn, _state);
                                            Hash::hash(EnableKinesisStreamingConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for EnableKinesisStreamingDestinationInput {
                                fn default() -> EnableKinesisStreamingDestinationInput {
                                    EnableKinesisStreamingDestinationInput::EnableKinesisStreamingDestinationInput {
                                        TableName: Default::default(),
                                        StreamArn: Default::default(),
                                        EnableKinesisStreamingConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<EnableKinesisStreamingDestinationInput>
                                for EnableKinesisStreamingDestinationInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1577,3)
                            #[derive(PartialEq, Clone)]
                            pub enum EnableKinesisStreamingDestinationOutput {
                                EnableKinesisStreamingDestinationOutput {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    StreamArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    DestinationStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DestinationStatus>>>,
                                    EnableKinesisStreamingConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>>
                                }
                            }

                            impl EnableKinesisStreamingDestinationOutput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        EnableKinesisStreamingDestinationOutput::EnableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field StreamArn
                                pub fn StreamArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        EnableKinesisStreamingDestinationOutput::EnableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => StreamArn,
                                    }
                                }
                                /// Returns a borrow of the field DestinationStatus
                                pub fn DestinationStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DestinationStatus>>> {
                                    match self {
                                        EnableKinesisStreamingDestinationOutput::EnableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => DestinationStatus,
                                    }
                                }
                                /// Returns a borrow of the field EnableKinesisStreamingConfiguration
                                pub fn EnableKinesisStreamingConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>> {
                                    match self {
                                        EnableKinesisStreamingDestinationOutput::EnableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => EnableKinesisStreamingConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for EnableKinesisStreamingDestinationOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for EnableKinesisStreamingDestinationOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        EnableKinesisStreamingDestinationOutput::EnableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.EnableKinesisStreamingDestinationOutput.EnableKinesisStreamingDestinationOutput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DestinationStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EnableKinesisStreamingConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for EnableKinesisStreamingDestinationOutput {}

                            impl Hash
                                for EnableKinesisStreamingDestinationOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        EnableKinesisStreamingDestinationOutput::EnableKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(StreamArn, _state);
                                            Hash::hash(DestinationStatus, _state);
                                            Hash::hash(EnableKinesisStreamingConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for EnableKinesisStreamingDestinationOutput {
                                fn default() -> EnableKinesisStreamingDestinationOutput {
                                    EnableKinesisStreamingDestinationOutput::EnableKinesisStreamingDestinationOutput {
                                        TableName: Default::default(),
                                        StreamArn: Default::default(),
                                        DestinationStatus: Default::default(),
                                        EnableKinesisStreamingConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<EnableKinesisStreamingDestinationOutput>
                                for EnableKinesisStreamingDestinationOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1583,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Endpoint {
                                Endpoint {
                                    Address: Sequence<DafnyCharUTF16>,
                                    CachePeriodInMinutes: i64
                                }
                            }

                            impl Endpoint {
                                /// Returns a borrow of the field Address
                                pub fn Address(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Endpoint::Endpoint{Address, CachePeriodInMinutes, } => Address,
                                    }
                                }
                                /// Returns a borrow of the field CachePeriodInMinutes
                                pub fn CachePeriodInMinutes(&self) -> &i64 {
                                    match self {
                                        Endpoint::Endpoint{Address, CachePeriodInMinutes, } => CachePeriodInMinutes,
                                    }
                                }
                            }

                            impl Debug
                                for Endpoint {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Endpoint {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Endpoint::Endpoint{Address, CachePeriodInMinutes, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Endpoint.Endpoint(")?;
                                            DafnyPrint::fmt_print(Address, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CachePeriodInMinutes, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Endpoint {}

                            impl Hash
                                for Endpoint {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Endpoint::Endpoint{Address, CachePeriodInMinutes, } => {
                                            Hash::hash(Address, _state);
                                            Hash::hash(CachePeriodInMinutes, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Endpoint {
                                fn default() -> Endpoint {
                                    Endpoint::Endpoint {
                                        Address: Default::default(),
                                        CachePeriodInMinutes: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Endpoint>
                                for Endpoint {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1588,3)
                            pub type ErrorCount = i64;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1595,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExecuteStatementInput {
                                ExecuteStatementInput {
                                    Statement: Sequence<DafnyCharUTF16>,
                                    Parameters: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PreparedStatementParameters>>,
                                    ConsistentRead: Arc<Option<bool>>,
                                    NextToken: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveIntegerObject>>,
                                    ReturnValuesOnConditionCheckFailure: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>>
                                }
                            }

                            impl ExecuteStatementInput {
                                /// Returns a borrow of the field Statement
                                pub fn Statement(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => Statement,
                                    }
                                }
                                /// Returns a borrow of the field Parameters
                                pub fn Parameters(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PreparedStatementParameters>> {
                                    match self {
                                        ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => Parameters,
                                    }
                                }
                                /// Returns a borrow of the field ConsistentRead
                                pub fn ConsistentRead(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => ConsistentRead,
                                    }
                                }
                                /// Returns a borrow of the field NextToken
                                pub fn NextToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => NextToken,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => ReturnConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveIntegerObject>> {
                                    match self {
                                        ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure
                                pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>> {
                                    match self {
                                        ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure,
                                    }
                                }
                            }

                            impl Debug
                                for ExecuteStatementInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExecuteStatementInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteStatementInput.ExecuteStatementInput(")?;
                                            DafnyPrint::fmt_print(Statement, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Parameters, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsistentRead, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ExecuteStatementInput {}

                            impl Hash
                                for ExecuteStatementInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExecuteStatementInput::ExecuteStatementInput{Statement, Parameters, ConsistentRead, NextToken, ReturnConsumedCapacity, Limit, ReturnValuesOnConditionCheckFailure, } => {
                                            Hash::hash(Statement, _state);
                                            Hash::hash(Parameters, _state);
                                            Hash::hash(ConsistentRead, _state);
                                            Hash::hash(NextToken, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state);
                                            Hash::hash(Limit, _state);
                                            Hash::hash(ReturnValuesOnConditionCheckFailure, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExecuteStatementInput {
                                fn default() -> ExecuteStatementInput {
                                    ExecuteStatementInput::ExecuteStatementInput {
                                        Statement: Default::default(),
                                        Parameters: Default::default(),
                                        ConsistentRead: Default::default(),
                                        NextToken: Default::default(),
                                        ReturnConsumedCapacity: Default::default(),
                                        Limit: Default::default(),
                                        ReturnValuesOnConditionCheckFailure: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ExecuteStatementInput>
                                for ExecuteStatementInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1604,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExecuteStatementOutput {
                                ExecuteStatementOutput {
                                    Items: Arc<Option<Sequence<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>>,
                                    NextToken: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>,
                                    LastEvaluatedKey: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>
                                }
                            }

                            impl ExecuteStatementOutput {
                                /// Returns a borrow of the field Items
                                pub fn Items(&self) -> &Arc<Option<Sequence<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>> {
                                    match self {
                                        ExecuteStatementOutput::ExecuteStatementOutput{Items, NextToken, ConsumedCapacity, LastEvaluatedKey, } => Items,
                                    }
                                }
                                /// Returns a borrow of the field NextToken
                                pub fn NextToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExecuteStatementOutput::ExecuteStatementOutput{Items, NextToken, ConsumedCapacity, LastEvaluatedKey, } => NextToken,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>> {
                                    match self {
                                        ExecuteStatementOutput::ExecuteStatementOutput{Items, NextToken, ConsumedCapacity, LastEvaluatedKey, } => ConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field LastEvaluatedKey
                                pub fn LastEvaluatedKey(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        ExecuteStatementOutput::ExecuteStatementOutput{Items, NextToken, ConsumedCapacity, LastEvaluatedKey, } => LastEvaluatedKey,
                                    }
                                }
                            }

                            impl Debug
                                for ExecuteStatementOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExecuteStatementOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExecuteStatementOutput::ExecuteStatementOutput{Items, NextToken, ConsumedCapacity, LastEvaluatedKey, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteStatementOutput.ExecuteStatementOutput(")?;
                                            DafnyPrint::fmt_print(Items, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastEvaluatedKey, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ExecuteStatementOutput {}

                            impl Hash
                                for ExecuteStatementOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExecuteStatementOutput::ExecuteStatementOutput{Items, NextToken, ConsumedCapacity, LastEvaluatedKey, } => {
                                            Hash::hash(Items, _state);
                                            Hash::hash(NextToken, _state);
                                            Hash::hash(ConsumedCapacity, _state);
                                            Hash::hash(LastEvaluatedKey, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExecuteStatementOutput {
                                fn default() -> ExecuteStatementOutput {
                                    ExecuteStatementOutput::ExecuteStatementOutput {
                                        Items: Default::default(),
                                        NextToken: Default::default(),
                                        ConsumedCapacity: Default::default(),
                                        LastEvaluatedKey: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ExecuteStatementOutput>
                                for ExecuteStatementOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1610,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExecuteTransactionInput {
                                ExecuteTransactionInput {
                                    TransactStatements: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ParameterizedStatements,
                                    ClientRequestToken: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>
                                }
                            }

                            impl ExecuteTransactionInput {
                                /// Returns a borrow of the field TransactStatements
                                pub fn TransactStatements(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ParameterizedStatements {
                                    match self {
                                        ExecuteTransactionInput::ExecuteTransactionInput{TransactStatements, ClientRequestToken, ReturnConsumedCapacity, } => TransactStatements,
                                    }
                                }
                                /// Returns a borrow of the field ClientRequestToken
                                pub fn ClientRequestToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExecuteTransactionInput::ExecuteTransactionInput{TransactStatements, ClientRequestToken, ReturnConsumedCapacity, } => ClientRequestToken,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        ExecuteTransactionInput::ExecuteTransactionInput{TransactStatements, ClientRequestToken, ReturnConsumedCapacity, } => ReturnConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for ExecuteTransactionInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExecuteTransactionInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExecuteTransactionInput::ExecuteTransactionInput{TransactStatements, ClientRequestToken, ReturnConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteTransactionInput.ExecuteTransactionInput(")?;
                                            DafnyPrint::fmt_print(TransactStatements, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ClientRequestToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ExecuteTransactionInput {}

                            impl Hash
                                for ExecuteTransactionInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExecuteTransactionInput::ExecuteTransactionInput{TransactStatements, ClientRequestToken, ReturnConsumedCapacity, } => {
                                            Hash::hash(TransactStatements, _state);
                                            Hash::hash(ClientRequestToken, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExecuteTransactionInput {
                                fn default() -> ExecuteTransactionInput {
                                    ExecuteTransactionInput::ExecuteTransactionInput {
                                        TransactStatements: Default::default(),
                                        ClientRequestToken: Default::default(),
                                        ReturnConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ExecuteTransactionInput>
                                for ExecuteTransactionInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1615,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExecuteTransactionOutput {
                                ExecuteTransactionOutput {
                                    Responses: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemResponseList>>,
                                    ConsumedCapacity: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>>
                                }
                            }

                            impl ExecuteTransactionOutput {
                                /// Returns a borrow of the field Responses
                                pub fn Responses(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemResponseList>> {
                                    match self {
                                        ExecuteTransactionOutput::ExecuteTransactionOutput{Responses, ConsumedCapacity, } => Responses,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>> {
                                    match self {
                                        ExecuteTransactionOutput::ExecuteTransactionOutput{Responses, ConsumedCapacity, } => ConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for ExecuteTransactionOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExecuteTransactionOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExecuteTransactionOutput::ExecuteTransactionOutput{Responses, ConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteTransactionOutput.ExecuteTransactionOutput(")?;
                                            DafnyPrint::fmt_print(Responses, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ExecuteTransactionOutput {}

                            impl Hash
                                for ExecuteTransactionOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExecuteTransactionOutput::ExecuteTransactionOutput{Responses, ConsumedCapacity, } => {
                                            Hash::hash(Responses, _state);
                                            Hash::hash(ConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExecuteTransactionOutput {
                                fn default() -> ExecuteTransactionOutput {
                                    ExecuteTransactionOutput::ExecuteTransactionOutput {
                                        Responses: Default::default(),
                                        ConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ExecuteTransactionOutput>
                                for ExecuteTransactionOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1620,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExpectedAttributeValue {
                                ExpectedAttributeValue {
                                    Value: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>,
                                    Exists: Arc<Option<bool>>,
                                    ComparisonOperator: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator>>>,
                                    AttributeValueList: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>
                                }
                            }

                            impl ExpectedAttributeValue {
                                /// Returns a borrow of the field Value
                                pub fn Value(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>> {
                                    match self {
                                        ExpectedAttributeValue::ExpectedAttributeValue{Value, Exists, ComparisonOperator, AttributeValueList, } => Value,
                                    }
                                }
                                /// Returns a borrow of the field Exists
                                pub fn Exists(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ExpectedAttributeValue::ExpectedAttributeValue{Value, Exists, ComparisonOperator, AttributeValueList, } => Exists,
                                    }
                                }
                                /// Returns a borrow of the field ComparisonOperator
                                pub fn ComparisonOperator(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ComparisonOperator>>> {
                                    match self {
                                        ExpectedAttributeValue::ExpectedAttributeValue{Value, Exists, ComparisonOperator, AttributeValueList, } => ComparisonOperator,
                                    }
                                }
                                /// Returns a borrow of the field AttributeValueList
                                pub fn AttributeValueList(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        ExpectedAttributeValue::ExpectedAttributeValue{Value, Exists, ComparisonOperator, AttributeValueList, } => AttributeValueList,
                                    }
                                }
                            }

                            impl Debug
                                for ExpectedAttributeValue {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExpectedAttributeValue {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExpectedAttributeValue::ExpectedAttributeValue{Value, Exists, ComparisonOperator, AttributeValueList, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExpectedAttributeValue.ExpectedAttributeValue(")?;
                                            DafnyPrint::fmt_print(Value, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Exists, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ComparisonOperator, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttributeValueList, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ExpectedAttributeValue {}

                            impl Hash
                                for ExpectedAttributeValue {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExpectedAttributeValue::ExpectedAttributeValue{Value, Exists, ComparisonOperator, AttributeValueList, } => {
                                            Hash::hash(Value, _state);
                                            Hash::hash(Exists, _state);
                                            Hash::hash(ComparisonOperator, _state);
                                            Hash::hash(AttributeValueList, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExpectedAttributeValue {
                                fn default() -> ExpectedAttributeValue {
                                    ExpectedAttributeValue::ExpectedAttributeValue {
                                        Value: Default::default(),
                                        Exists: Default::default(),
                                        ComparisonOperator: Default::default(),
                                        AttributeValueList: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ExpectedAttributeValue>
                                for ExpectedAttributeValue {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1626,3)
                            pub type ExportArn = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1630,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExportDescription {
                                ExportDescription {
                                    ExportArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExportStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportStatus>>>,
                                    StartTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    EndTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExportManifest: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TableId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExportTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ClientToken: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3Bucket: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3BucketOwner: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3Prefix: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3SseAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::S3SseAlgorithm>>>,
                                    S3SseKmsKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    FailureCode: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    FailureMessage: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExportFormat: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportFormat>>>,
                                    BilledSizeBytes: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BilledSizeBytes>>,
                                    ItemCount: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCount>>,
                                    ExportType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportType>>>,
                                    IncrementalExportSpecification: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IncrementalExportSpecification>>>
                                }
                            }

                            impl ExportDescription {
                                /// Returns a borrow of the field ExportArn
                                pub fn ExportArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => ExportArn,
                                    }
                                }
                                /// Returns a borrow of the field ExportStatus
                                pub fn ExportStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportStatus>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => ExportStatus,
                                    }
                                }
                                /// Returns a borrow of the field StartTime
                                pub fn StartTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => StartTime,
                                    }
                                }
                                /// Returns a borrow of the field EndTime
                                pub fn EndTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => EndTime,
                                    }
                                }
                                /// Returns a borrow of the field ExportManifest
                                pub fn ExportManifest(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => ExportManifest,
                                    }
                                }
                                /// Returns a borrow of the field TableArn
                                pub fn TableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => TableArn,
                                    }
                                }
                                /// Returns a borrow of the field TableId
                                pub fn TableId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => TableId,
                                    }
                                }
                                /// Returns a borrow of the field ExportTime
                                pub fn ExportTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => ExportTime,
                                    }
                                }
                                /// Returns a borrow of the field ClientToken
                                pub fn ClientToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => ClientToken,
                                    }
                                }
                                /// Returns a borrow of the field S3Bucket
                                pub fn S3Bucket(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => S3Bucket,
                                    }
                                }
                                /// Returns a borrow of the field S3BucketOwner
                                pub fn S3BucketOwner(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => S3BucketOwner,
                                    }
                                }
                                /// Returns a borrow of the field S3Prefix
                                pub fn S3Prefix(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => S3Prefix,
                                    }
                                }
                                /// Returns a borrow of the field S3SseAlgorithm
                                pub fn S3SseAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::S3SseAlgorithm>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => S3SseAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field S3SseKmsKeyId
                                pub fn S3SseKmsKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => S3SseKmsKeyId,
                                    }
                                }
                                /// Returns a borrow of the field FailureCode
                                pub fn FailureCode(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => FailureCode,
                                    }
                                }
                                /// Returns a borrow of the field FailureMessage
                                pub fn FailureMessage(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => FailureMessage,
                                    }
                                }
                                /// Returns a borrow of the field ExportFormat
                                pub fn ExportFormat(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportFormat>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => ExportFormat,
                                    }
                                }
                                /// Returns a borrow of the field BilledSizeBytes
                                pub fn BilledSizeBytes(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BilledSizeBytes>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => BilledSizeBytes,
                                    }
                                }
                                /// Returns a borrow of the field ItemCount
                                pub fn ItemCount(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCount>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => ItemCount,
                                    }
                                }
                                /// Returns a borrow of the field ExportType
                                pub fn ExportType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportType>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => ExportType,
                                    }
                                }
                                /// Returns a borrow of the field IncrementalExportSpecification
                                pub fn IncrementalExportSpecification(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IncrementalExportSpecification>>> {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => IncrementalExportSpecification,
                                    }
                                }
                            }

                            impl Debug
                                for ExportDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExportDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportDescription.ExportDescription(")?;
                                            DafnyPrint::fmt_print(ExportArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StartTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EndTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportManifest, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ClientToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3Bucket, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3BucketOwner, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3Prefix, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3SseAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3SseKmsKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(FailureCode, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(FailureMessage, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportFormat, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BilledSizeBytes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ItemCount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IncrementalExportSpecification, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ExportDescription {}

                            impl Hash
                                for ExportDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExportDescription::ExportDescription{ExportArn, ExportStatus, StartTime, EndTime, ExportManifest, TableArn, TableId, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, FailureCode, FailureMessage, ExportFormat, BilledSizeBytes, ItemCount, ExportType, IncrementalExportSpecification, } => {
                                            Hash::hash(ExportArn, _state);
                                            Hash::hash(ExportStatus, _state);
                                            Hash::hash(StartTime, _state);
                                            Hash::hash(EndTime, _state);
                                            Hash::hash(ExportManifest, _state);
                                            Hash::hash(TableArn, _state);
                                            Hash::hash(TableId, _state);
                                            Hash::hash(ExportTime, _state);
                                            Hash::hash(ClientToken, _state);
                                            Hash::hash(S3Bucket, _state);
                                            Hash::hash(S3BucketOwner, _state);
                                            Hash::hash(S3Prefix, _state);
                                            Hash::hash(S3SseAlgorithm, _state);
                                            Hash::hash(S3SseKmsKeyId, _state);
                                            Hash::hash(FailureCode, _state);
                                            Hash::hash(FailureMessage, _state);
                                            Hash::hash(ExportFormat, _state);
                                            Hash::hash(BilledSizeBytes, _state);
                                            Hash::hash(ItemCount, _state);
                                            Hash::hash(ExportType, _state);
                                            Hash::hash(IncrementalExportSpecification, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExportDescription {
                                fn default() -> ExportDescription {
                                    ExportDescription::ExportDescription {
                                        ExportArn: Default::default(),
                                        ExportStatus: Default::default(),
                                        StartTime: Default::default(),
                                        EndTime: Default::default(),
                                        ExportManifest: Default::default(),
                                        TableArn: Default::default(),
                                        TableId: Default::default(),
                                        ExportTime: Default::default(),
                                        ClientToken: Default::default(),
                                        S3Bucket: Default::default(),
                                        S3BucketOwner: Default::default(),
                                        S3Prefix: Default::default(),
                                        S3SseAlgorithm: Default::default(),
                                        S3SseKmsKeyId: Default::default(),
                                        FailureCode: Default::default(),
                                        FailureMessage: Default::default(),
                                        ExportFormat: Default::default(),
                                        BilledSizeBytes: Default::default(),
                                        ItemCount: Default::default(),
                                        ExportType: Default::default(),
                                        IncrementalExportSpecification: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ExportDescription>
                                for ExportDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1653,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExportFormat {
                                DYNAMODB_JSON {},
                                ION {}
                            }

                            impl ExportFormat {}

                            impl Debug
                                for ExportFormat {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExportFormat {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExportFormat::DYNAMODB_JSON{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportFormat.DYNAMODB__JSON")?;
                                            Ok(())
                                        },
                                        ExportFormat::ION{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportFormat.ION")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ExportFormat {
                                /// Enumerates all possible values of ExportFormat
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ExportFormat>> {
                                    seq![Arc::new(ExportFormat::DYNAMODB_JSON {}), Arc::new(ExportFormat::ION {})].iter()
                                }
                            }

                            impl Eq
                                for ExportFormat {}

                            impl Hash
                                for ExportFormat {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExportFormat::DYNAMODB_JSON{} => {

                                        },
                                        ExportFormat::ION{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExportFormat {
                                fn default() -> ExportFormat {
                                    ExportFormat::DYNAMODB_JSON {}
                                }
                            }

                            impl AsRef<ExportFormat>
                                for ExportFormat {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1658,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExportStatus {
                                IN_PROGRESS {},
                                COMPLETED {},
                                FAILED {}
                            }

                            impl ExportStatus {}

                            impl Debug
                                for ExportStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExportStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExportStatus::IN_PROGRESS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportStatus.IN__PROGRESS")?;
                                            Ok(())
                                        },
                                        ExportStatus::COMPLETED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportStatus.COMPLETED")?;
                                            Ok(())
                                        },
                                        ExportStatus::FAILED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportStatus.FAILED")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ExportStatus {
                                /// Enumerates all possible values of ExportStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ExportStatus>> {
                                    seq![Arc::new(ExportStatus::IN_PROGRESS {}), Arc::new(ExportStatus::COMPLETED {}), Arc::new(ExportStatus::FAILED {})].iter()
                                }
                            }

                            impl Eq
                                for ExportStatus {}

                            impl Hash
                                for ExportStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExportStatus::IN_PROGRESS{} => {

                                        },
                                        ExportStatus::COMPLETED{} => {

                                        },
                                        ExportStatus::FAILED{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExportStatus {
                                fn default() -> ExportStatus {
                                    ExportStatus::IN_PROGRESS {}
                                }
                            }

                            impl AsRef<ExportStatus>
                                for ExportStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1663,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExportSummary {
                                ExportSummary {
                                    ExportArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExportStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportStatus>>>,
                                    ExportType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportType>>>
                                }
                            }

                            impl ExportSummary {
                                /// Returns a borrow of the field ExportArn
                                pub fn ExportArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportSummary::ExportSummary{ExportArn, ExportStatus, ExportType, } => ExportArn,
                                    }
                                }
                                /// Returns a borrow of the field ExportStatus
                                pub fn ExportStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportStatus>>> {
                                    match self {
                                        ExportSummary::ExportSummary{ExportArn, ExportStatus, ExportType, } => ExportStatus,
                                    }
                                }
                                /// Returns a borrow of the field ExportType
                                pub fn ExportType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportType>>> {
                                    match self {
                                        ExportSummary::ExportSummary{ExportArn, ExportStatus, ExportType, } => ExportType,
                                    }
                                }
                            }

                            impl Debug
                                for ExportSummary {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExportSummary {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExportSummary::ExportSummary{ExportArn, ExportStatus, ExportType, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportSummary.ExportSummary(")?;
                                            DafnyPrint::fmt_print(ExportArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportType, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ExportSummary {}

                            impl Hash
                                for ExportSummary {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExportSummary::ExportSummary{ExportArn, ExportStatus, ExportType, } => {
                                            Hash::hash(ExportArn, _state);
                                            Hash::hash(ExportStatus, _state);
                                            Hash::hash(ExportType, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExportSummary {
                                fn default() -> ExportSummary {
                                    ExportSummary::ExportSummary {
                                        ExportArn: Default::default(),
                                        ExportStatus: Default::default(),
                                        ExportType: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ExportSummary>
                                for ExportSummary {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1668,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExportTableToPointInTimeInput {
                                ExportTableToPointInTimeInput {
                                    TableArn: Sequence<DafnyCharUTF16>,
                                    ExportTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ClientToken: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3Bucket: Sequence<DafnyCharUTF16>,
                                    S3BucketOwner: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3Prefix: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3SseAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::S3SseAlgorithm>>>,
                                    S3SseKmsKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExportFormat: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportFormat>>>,
                                    ExportType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportType>>>,
                                    IncrementalExportSpecification: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IncrementalExportSpecification>>>
                                }
                            }

                            impl ExportTableToPointInTimeInput {
                                /// Returns a borrow of the field TableArn
                                pub fn TableArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => TableArn,
                                    }
                                }
                                /// Returns a borrow of the field ExportTime
                                pub fn ExportTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => ExportTime,
                                    }
                                }
                                /// Returns a borrow of the field ClientToken
                                pub fn ClientToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => ClientToken,
                                    }
                                }
                                /// Returns a borrow of the field S3Bucket
                                pub fn S3Bucket(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => S3Bucket,
                                    }
                                }
                                /// Returns a borrow of the field S3BucketOwner
                                pub fn S3BucketOwner(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => S3BucketOwner,
                                    }
                                }
                                /// Returns a borrow of the field S3Prefix
                                pub fn S3Prefix(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => S3Prefix,
                                    }
                                }
                                /// Returns a borrow of the field S3SseAlgorithm
                                pub fn S3SseAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::S3SseAlgorithm>>> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => S3SseAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field S3SseKmsKeyId
                                pub fn S3SseKmsKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => S3SseKmsKeyId,
                                    }
                                }
                                /// Returns a borrow of the field ExportFormat
                                pub fn ExportFormat(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportFormat>>> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => ExportFormat,
                                    }
                                }
                                /// Returns a borrow of the field ExportType
                                pub fn ExportType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportType>>> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => ExportType,
                                    }
                                }
                                /// Returns a borrow of the field IncrementalExportSpecification
                                pub fn IncrementalExportSpecification(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IncrementalExportSpecification>>> {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => IncrementalExportSpecification,
                                    }
                                }
                            }

                            impl Debug
                                for ExportTableToPointInTimeInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExportTableToPointInTimeInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportTableToPointInTimeInput.ExportTableToPointInTimeInput(")?;
                                            DafnyPrint::fmt_print(TableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ClientToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3Bucket, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3BucketOwner, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3Prefix, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3SseAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3SseKmsKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportFormat, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IncrementalExportSpecification, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ExportTableToPointInTimeInput {}

                            impl Hash
                                for ExportTableToPointInTimeInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExportTableToPointInTimeInput::ExportTableToPointInTimeInput{TableArn, ExportTime, ClientToken, S3Bucket, S3BucketOwner, S3Prefix, S3SseAlgorithm, S3SseKmsKeyId, ExportFormat, ExportType, IncrementalExportSpecification, } => {
                                            Hash::hash(TableArn, _state);
                                            Hash::hash(ExportTime, _state);
                                            Hash::hash(ClientToken, _state);
                                            Hash::hash(S3Bucket, _state);
                                            Hash::hash(S3BucketOwner, _state);
                                            Hash::hash(S3Prefix, _state);
                                            Hash::hash(S3SseAlgorithm, _state);
                                            Hash::hash(S3SseKmsKeyId, _state);
                                            Hash::hash(ExportFormat, _state);
                                            Hash::hash(ExportType, _state);
                                            Hash::hash(IncrementalExportSpecification, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExportTableToPointInTimeInput {
                                fn default() -> ExportTableToPointInTimeInput {
                                    ExportTableToPointInTimeInput::ExportTableToPointInTimeInput {
                                        TableArn: Default::default(),
                                        ExportTime: Default::default(),
                                        ClientToken: Default::default(),
                                        S3Bucket: Default::default(),
                                        S3BucketOwner: Default::default(),
                                        S3Prefix: Default::default(),
                                        S3SseAlgorithm: Default::default(),
                                        S3SseKmsKeyId: Default::default(),
                                        ExportFormat: Default::default(),
                                        ExportType: Default::default(),
                                        IncrementalExportSpecification: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ExportTableToPointInTimeInput>
                                for ExportTableToPointInTimeInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1681,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExportTableToPointInTimeOutput {
                                ExportTableToPointInTimeOutput {
                                    ExportDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportDescription>>>
                                }
                            }

                            impl ExportTableToPointInTimeOutput {
                                /// Returns a borrow of the field ExportDescription
                                pub fn ExportDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportDescription>>> {
                                    match self {
                                        ExportTableToPointInTimeOutput::ExportTableToPointInTimeOutput{ExportDescription, } => ExportDescription,
                                    }
                                }
                            }

                            impl Debug
                                for ExportTableToPointInTimeOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExportTableToPointInTimeOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExportTableToPointInTimeOutput::ExportTableToPointInTimeOutput{ExportDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportTableToPointInTimeOutput.ExportTableToPointInTimeOutput(")?;
                                            DafnyPrint::fmt_print(ExportDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ExportTableToPointInTimeOutput {}

                            impl Hash
                                for ExportTableToPointInTimeOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExportTableToPointInTimeOutput::ExportTableToPointInTimeOutput{ExportDescription, } => {
                                            Hash::hash(ExportDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExportTableToPointInTimeOutput {
                                fn default() -> ExportTableToPointInTimeOutput {
                                    ExportTableToPointInTimeOutput::ExportTableToPointInTimeOutput {
                                        ExportDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ExportTableToPointInTimeOutput>
                                for ExportTableToPointInTimeOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1684,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExportType {
                                FULL_EXPORT {},
                                INCREMENTAL_EXPORT {}
                            }

                            impl ExportType {}

                            impl Debug
                                for ExportType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExportType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExportType::FULL_EXPORT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportType.FULL__EXPORT")?;
                                            Ok(())
                                        },
                                        ExportType::INCREMENTAL_EXPORT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportType.INCREMENTAL__EXPORT")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ExportType {
                                /// Enumerates all possible values of ExportType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ExportType>> {
                                    seq![Arc::new(ExportType::FULL_EXPORT {}), Arc::new(ExportType::INCREMENTAL_EXPORT {})].iter()
                                }
                            }

                            impl Eq
                                for ExportType {}

                            impl Hash
                                for ExportType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExportType::FULL_EXPORT{} => {

                                        },
                                        ExportType::INCREMENTAL_EXPORT{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExportType {
                                fn default() -> ExportType {
                                    ExportType::FULL_EXPORT {}
                                }
                            }

                            impl AsRef<ExportType>
                                for ExportType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1687,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExportViewType {
                                NEW_IMAGE {},
                                NEW_AND_OLD_IMAGES {}
                            }

                            impl ExportViewType {}

                            impl Debug
                                for ExportViewType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExportViewType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExportViewType::NEW_IMAGE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportViewType.NEW__IMAGE")?;
                                            Ok(())
                                        },
                                        ExportViewType::NEW_AND_OLD_IMAGES{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportViewType.NEW__AND__OLD__IMAGES")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ExportViewType {
                                /// Enumerates all possible values of ExportViewType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ExportViewType>> {
                                    seq![Arc::new(ExportViewType::NEW_IMAGE {}), Arc::new(ExportViewType::NEW_AND_OLD_IMAGES {})].iter()
                                }
                            }

                            impl Eq
                                for ExportViewType {}

                            impl Hash
                                for ExportViewType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExportViewType::NEW_IMAGE{} => {

                                        },
                                        ExportViewType::NEW_AND_OLD_IMAGES{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExportViewType {
                                fn default() -> ExportViewType {
                                    ExportViewType::NEW_IMAGE {}
                                }
                            }

                            impl AsRef<ExportViewType>
                                for ExportViewType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1695,3)
                            #[derive(PartialEq, Clone)]
                            pub enum FailureException {
                                FailureException {
                                    ExceptionName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExceptionDescription: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl FailureException {
                                /// Returns a borrow of the field ExceptionName
                                pub fn ExceptionName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        FailureException::FailureException{ExceptionName, ExceptionDescription, } => ExceptionName,
                                    }
                                }
                                /// Returns a borrow of the field ExceptionDescription
                                pub fn ExceptionDescription(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        FailureException::FailureException{ExceptionName, ExceptionDescription, } => ExceptionDescription,
                                    }
                                }
                            }

                            impl Debug
                                for FailureException {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for FailureException {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        FailureException::FailureException{ExceptionName, ExceptionDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.FailureException.FailureException(")?;
                                            DafnyPrint::fmt_print(ExceptionName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExceptionDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for FailureException {}

                            impl Hash
                                for FailureException {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        FailureException::FailureException{ExceptionName, ExceptionDescription, } => {
                                            Hash::hash(ExceptionName, _state);
                                            Hash::hash(ExceptionDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for FailureException {
                                fn default() -> FailureException {
                                    FailureException::FailureException {
                                        ExceptionName: Default::default(),
                                        ExceptionDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<FailureException>
                                for FailureException {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1701,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Get {
                                Get {
                                    Key: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>,
                                    TableName: Sequence<DafnyCharUTF16>,
                                    ProjectionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>
                                }
                            }

                            impl Get {
                                /// Returns a borrow of the field Key
                                pub fn Key(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        Get::Get{Key, TableName, ProjectionExpression, ExpressionAttributeNames, } => Key,
                                    }
                                }
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Get::Get{Key, TableName, ProjectionExpression, ExpressionAttributeNames, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field ProjectionExpression
                                pub fn ProjectionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        Get::Get{Key, TableName, ProjectionExpression, ExpressionAttributeNames, } => ProjectionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        Get::Get{Key, TableName, ProjectionExpression, ExpressionAttributeNames, } => ExpressionAttributeNames,
                                    }
                                }
                            }

                            impl Debug
                                for Get {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Get {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Get::Get{Key, TableName, ProjectionExpression, ExpressionAttributeNames, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Get.Get(")?;
                                            DafnyPrint::fmt_print(Key, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProjectionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Get {}

                            impl Hash
                                for Get {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Get::Get{Key, TableName, ProjectionExpression, ExpressionAttributeNames, } => {
                                            Hash::hash(Key, _state);
                                            Hash::hash(TableName, _state);
                                            Hash::hash(ProjectionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Get {
                                fn default() -> Get {
                                    Get::Get {
                                        Key: Default::default(),
                                        TableName: Default::default(),
                                        ProjectionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Get>
                                for Get {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1707,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetItemInput {
                                GetItemInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    Key: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>,
                                    AttributesToGet: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeNameList>>,
                                    ConsistentRead: Arc<Option<bool>>,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>,
                                    ProjectionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>
                                }
                            }

                            impl GetItemInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GetItemInput::GetItemInput{TableName, Key, AttributesToGet, ConsistentRead, ReturnConsumedCapacity, ProjectionExpression, ExpressionAttributeNames, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field Key
                                pub fn Key(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        GetItemInput::GetItemInput{TableName, Key, AttributesToGet, ConsistentRead, ReturnConsumedCapacity, ProjectionExpression, ExpressionAttributeNames, } => Key,
                                    }
                                }
                                /// Returns a borrow of the field AttributesToGet
                                pub fn AttributesToGet(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeNameList>> {
                                    match self {
                                        GetItemInput::GetItemInput{TableName, Key, AttributesToGet, ConsistentRead, ReturnConsumedCapacity, ProjectionExpression, ExpressionAttributeNames, } => AttributesToGet,
                                    }
                                }
                                /// Returns a borrow of the field ConsistentRead
                                pub fn ConsistentRead(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        GetItemInput::GetItemInput{TableName, Key, AttributesToGet, ConsistentRead, ReturnConsumedCapacity, ProjectionExpression, ExpressionAttributeNames, } => ConsistentRead,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        GetItemInput::GetItemInput{TableName, Key, AttributesToGet, ConsistentRead, ReturnConsumedCapacity, ProjectionExpression, ExpressionAttributeNames, } => ReturnConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ProjectionExpression
                                pub fn ProjectionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetItemInput::GetItemInput{TableName, Key, AttributesToGet, ConsistentRead, ReturnConsumedCapacity, ProjectionExpression, ExpressionAttributeNames, } => ProjectionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        GetItemInput::GetItemInput{TableName, Key, AttributesToGet, ConsistentRead, ReturnConsumedCapacity, ProjectionExpression, ExpressionAttributeNames, } => ExpressionAttributeNames,
                                    }
                                }
                            }

                            impl Debug
                                for GetItemInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetItemInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetItemInput::GetItemInput{TableName, Key, AttributesToGet, ConsistentRead, ReturnConsumedCapacity, ProjectionExpression, ExpressionAttributeNames, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemInput.GetItemInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Key, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttributesToGet, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsistentRead, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProjectionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetItemInput {}

                            impl Hash
                                for GetItemInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetItemInput::GetItemInput{TableName, Key, AttributesToGet, ConsistentRead, ReturnConsumedCapacity, ProjectionExpression, ExpressionAttributeNames, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(Key, _state);
                                            Hash::hash(AttributesToGet, _state);
                                            Hash::hash(ConsistentRead, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state);
                                            Hash::hash(ProjectionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetItemInput {
                                fn default() -> GetItemInput {
                                    GetItemInput::GetItemInput {
                                        TableName: Default::default(),
                                        Key: Default::default(),
                                        AttributesToGet: Default::default(),
                                        ConsistentRead: Default::default(),
                                        ReturnConsumedCapacity: Default::default(),
                                        ProjectionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetItemInput>
                                for GetItemInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1716,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetItemOutput {
                                GetItemOutput {
                                    Item: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>
                                }
                            }

                            impl GetItemOutput {
                                /// Returns a borrow of the field Item
                                pub fn Item(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        GetItemOutput::GetItemOutput{Item, ConsumedCapacity, } => Item,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>> {
                                    match self {
                                        GetItemOutput::GetItemOutput{Item, ConsumedCapacity, } => ConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for GetItemOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetItemOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetItemOutput::GetItemOutput{Item, ConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemOutput.GetItemOutput(")?;
                                            DafnyPrint::fmt_print(Item, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetItemOutput {}

                            impl Hash
                                for GetItemOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetItemOutput::GetItemOutput{Item, ConsumedCapacity, } => {
                                            Hash::hash(Item, _state);
                                            Hash::hash(ConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetItemOutput {
                                fn default() -> GetItemOutput {
                                    GetItemOutput::GetItemOutput {
                                        Item: Default::default(),
                                        ConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetItemOutput>
                                for GetItemOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1720,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetResourcePolicyInput {
                                GetResourcePolicyInput {
                                    ResourceArn: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl GetResourcePolicyInput {
                                /// Returns a borrow of the field ResourceArn
                                pub fn ResourceArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GetResourcePolicyInput::GetResourcePolicyInput{ResourceArn, } => ResourceArn,
                                    }
                                }
                            }

                            impl Debug
                                for GetResourcePolicyInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetResourcePolicyInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetResourcePolicyInput::GetResourcePolicyInput{ResourceArn, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GetResourcePolicyInput.GetResourcePolicyInput(")?;
                                            DafnyPrint::fmt_print(ResourceArn, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetResourcePolicyInput {}

                            impl Hash
                                for GetResourcePolicyInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetResourcePolicyInput::GetResourcePolicyInput{ResourceArn, } => {
                                            Hash::hash(ResourceArn, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetResourcePolicyInput {
                                fn default() -> GetResourcePolicyInput {
                                    GetResourcePolicyInput::GetResourcePolicyInput {
                                        ResourceArn: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetResourcePolicyInput>
                                for GetResourcePolicyInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1723,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetResourcePolicyOutput {
                                GetResourcePolicyOutput {
                                    Policy: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    RevisionId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl GetResourcePolicyOutput {
                                /// Returns a borrow of the field Policy
                                pub fn Policy(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetResourcePolicyOutput::GetResourcePolicyOutput{Policy, RevisionId, } => Policy,
                                    }
                                }
                                /// Returns a borrow of the field RevisionId
                                pub fn RevisionId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetResourcePolicyOutput::GetResourcePolicyOutput{Policy, RevisionId, } => RevisionId,
                                    }
                                }
                            }

                            impl Debug
                                for GetResourcePolicyOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetResourcePolicyOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetResourcePolicyOutput::GetResourcePolicyOutput{Policy, RevisionId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GetResourcePolicyOutput.GetResourcePolicyOutput(")?;
                                            DafnyPrint::fmt_print(Policy, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RevisionId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetResourcePolicyOutput {}

                            impl Hash
                                for GetResourcePolicyOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetResourcePolicyOutput::GetResourcePolicyOutput{Policy, RevisionId, } => {
                                            Hash::hash(Policy, _state);
                                            Hash::hash(RevisionId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetResourcePolicyOutput {
                                fn default() -> GetResourcePolicyOutput {
                                    GetResourcePolicyOutput::GetResourcePolicyOutput {
                                        Policy: Default::default(),
                                        RevisionId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetResourcePolicyOutput>
                                for GetResourcePolicyOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1727,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GlobalSecondaryIndex {
                                GlobalSecondaryIndex {
                                    IndexName: Sequence<DafnyCharUTF16>,
                                    KeySchema: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema,
                                    Projection: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>,
                                    ProvisionedThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>>,
                                    OnDemandThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>
                                }
                            }

                            impl GlobalSecondaryIndex {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GlobalSecondaryIndex::GlobalSecondaryIndex{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema {
                                    match self {
                                        GlobalSecondaryIndex::GlobalSecondaryIndex{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field Projection
                                pub fn Projection(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection> {
                                    match self {
                                        GlobalSecondaryIndex::GlobalSecondaryIndex{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => Projection,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughput
                                pub fn ProvisionedThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>> {
                                    match self {
                                        GlobalSecondaryIndex::GlobalSecondaryIndex{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => ProvisionedThroughput,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughput
                                pub fn OnDemandThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        GlobalSecondaryIndex::GlobalSecondaryIndex{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => OnDemandThroughput,
                                    }
                                }
                            }

                            impl Debug
                                for GlobalSecondaryIndex {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GlobalSecondaryIndex {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GlobalSecondaryIndex::GlobalSecondaryIndex{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndex.GlobalSecondaryIndex(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Projection, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughput, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GlobalSecondaryIndex {}

                            impl Hash
                                for GlobalSecondaryIndex {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GlobalSecondaryIndex::GlobalSecondaryIndex{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(Projection, _state);
                                            Hash::hash(ProvisionedThroughput, _state);
                                            Hash::hash(OnDemandThroughput, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GlobalSecondaryIndex {
                                fn default() -> GlobalSecondaryIndex {
                                    GlobalSecondaryIndex::GlobalSecondaryIndex {
                                        IndexName: Default::default(),
                                        KeySchema: Default::default(),
                                        Projection: Default::default(),
                                        ProvisionedThroughput: Default::default(),
                                        OnDemandThroughput: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GlobalSecondaryIndex>
                                for GlobalSecondaryIndex {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1734,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GlobalSecondaryIndexAutoScalingUpdate {
                                GlobalSecondaryIndexAutoScalingUpdate {
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ProvisionedWriteCapacityAutoScalingUpdate: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>>
                                }
                            }

                            impl GlobalSecondaryIndexAutoScalingUpdate {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GlobalSecondaryIndexAutoScalingUpdate::GlobalSecondaryIndexAutoScalingUpdate{IndexName, ProvisionedWriteCapacityAutoScalingUpdate, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedWriteCapacityAutoScalingUpdate
                                pub fn ProvisionedWriteCapacityAutoScalingUpdate(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>> {
                                    match self {
                                        GlobalSecondaryIndexAutoScalingUpdate::GlobalSecondaryIndexAutoScalingUpdate{IndexName, ProvisionedWriteCapacityAutoScalingUpdate, } => ProvisionedWriteCapacityAutoScalingUpdate,
                                    }
                                }
                            }

                            impl Debug
                                for GlobalSecondaryIndexAutoScalingUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GlobalSecondaryIndexAutoScalingUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GlobalSecondaryIndexAutoScalingUpdate::GlobalSecondaryIndexAutoScalingUpdate{IndexName, ProvisionedWriteCapacityAutoScalingUpdate, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexAutoScalingUpdate.GlobalSecondaryIndexAutoScalingUpdate(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedWriteCapacityAutoScalingUpdate, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GlobalSecondaryIndexAutoScalingUpdate {}

                            impl Hash
                                for GlobalSecondaryIndexAutoScalingUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GlobalSecondaryIndexAutoScalingUpdate::GlobalSecondaryIndexAutoScalingUpdate{IndexName, ProvisionedWriteCapacityAutoScalingUpdate, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ProvisionedWriteCapacityAutoScalingUpdate, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GlobalSecondaryIndexAutoScalingUpdate {
                                fn default() -> GlobalSecondaryIndexAutoScalingUpdate {
                                    GlobalSecondaryIndexAutoScalingUpdate::GlobalSecondaryIndexAutoScalingUpdate {
                                        IndexName: Default::default(),
                                        ProvisionedWriteCapacityAutoScalingUpdate: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GlobalSecondaryIndexAutoScalingUpdate>
                                for GlobalSecondaryIndexAutoScalingUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1738,3)
                            pub type GlobalSecondaryIndexAutoScalingUpdateList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexAutoScalingUpdate>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1742,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GlobalSecondaryIndexDescription {
                                GlobalSecondaryIndexDescription {
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeySchema: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema>>,
                                    Projection: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>>>,
                                    IndexStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus>>>,
                                    Backfilling: Arc<Option<bool>>,
                                    ProvisionedThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputDescription>>>,
                                    IndexSizeBytes: Arc<Option<i64>>,
                                    ItemCount: Arc<Option<i64>>,
                                    IndexArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    OnDemandThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>
                                }
                            }

                            impl GlobalSecondaryIndexDescription {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema>> {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field Projection
                                pub fn Projection(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>>> {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => Projection,
                                    }
                                }
                                /// Returns a borrow of the field IndexStatus
                                pub fn IndexStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus>>> {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => IndexStatus,
                                    }
                                }
                                /// Returns a borrow of the field Backfilling
                                pub fn Backfilling(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => Backfilling,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughput
                                pub fn ProvisionedThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputDescription>>> {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => ProvisionedThroughput,
                                    }
                                }
                                /// Returns a borrow of the field IndexSizeBytes
                                pub fn IndexSizeBytes(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => IndexSizeBytes,
                                    }
                                }
                                /// Returns a borrow of the field ItemCount
                                pub fn ItemCount(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => ItemCount,
                                    }
                                }
                                /// Returns a borrow of the field IndexArn
                                pub fn IndexArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => IndexArn,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughput
                                pub fn OnDemandThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => OnDemandThroughput,
                                    }
                                }
                            }

                            impl Debug
                                for GlobalSecondaryIndexDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GlobalSecondaryIndexDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexDescription.GlobalSecondaryIndexDescription(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Projection, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Backfilling, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexSizeBytes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ItemCount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughput, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GlobalSecondaryIndexDescription {}

                            impl Hash
                                for GlobalSecondaryIndexDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexStatus, Backfilling, ProvisionedThroughput, IndexSizeBytes, ItemCount, IndexArn, OnDemandThroughput, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(Projection, _state);
                                            Hash::hash(IndexStatus, _state);
                                            Hash::hash(Backfilling, _state);
                                            Hash::hash(ProvisionedThroughput, _state);
                                            Hash::hash(IndexSizeBytes, _state);
                                            Hash::hash(ItemCount, _state);
                                            Hash::hash(IndexArn, _state);
                                            Hash::hash(OnDemandThroughput, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GlobalSecondaryIndexDescription {
                                fn default() -> GlobalSecondaryIndexDescription {
                                    GlobalSecondaryIndexDescription::GlobalSecondaryIndexDescription {
                                        IndexName: Default::default(),
                                        KeySchema: Default::default(),
                                        Projection: Default::default(),
                                        IndexStatus: Default::default(),
                                        Backfilling: Default::default(),
                                        ProvisionedThroughput: Default::default(),
                                        IndexSizeBytes: Default::default(),
                                        ItemCount: Default::default(),
                                        IndexArn: Default::default(),
                                        OnDemandThroughput: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GlobalSecondaryIndexDescription>
                                for GlobalSecondaryIndexDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1756,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GlobalSecondaryIndexInfo {
                                GlobalSecondaryIndexInfo {
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeySchema: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema>>,
                                    Projection: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>>>,
                                    ProvisionedThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>>,
                                    OnDemandThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>
                                }
                            }

                            impl GlobalSecondaryIndexInfo {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GlobalSecondaryIndexInfo::GlobalSecondaryIndexInfo{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema>> {
                                    match self {
                                        GlobalSecondaryIndexInfo::GlobalSecondaryIndexInfo{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field Projection
                                pub fn Projection(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>>> {
                                    match self {
                                        GlobalSecondaryIndexInfo::GlobalSecondaryIndexInfo{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => Projection,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughput
                                pub fn ProvisionedThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>> {
                                    match self {
                                        GlobalSecondaryIndexInfo::GlobalSecondaryIndexInfo{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => ProvisionedThroughput,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughput
                                pub fn OnDemandThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        GlobalSecondaryIndexInfo::GlobalSecondaryIndexInfo{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => OnDemandThroughput,
                                    }
                                }
                            }

                            impl Debug
                                for GlobalSecondaryIndexInfo {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GlobalSecondaryIndexInfo {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GlobalSecondaryIndexInfo::GlobalSecondaryIndexInfo{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexInfo.GlobalSecondaryIndexInfo(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Projection, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughput, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GlobalSecondaryIndexInfo {}

                            impl Hash
                                for GlobalSecondaryIndexInfo {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GlobalSecondaryIndexInfo::GlobalSecondaryIndexInfo{IndexName, KeySchema, Projection, ProvisionedThroughput, OnDemandThroughput, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(Projection, _state);
                                            Hash::hash(ProvisionedThroughput, _state);
                                            Hash::hash(OnDemandThroughput, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GlobalSecondaryIndexInfo {
                                fn default() -> GlobalSecondaryIndexInfo {
                                    GlobalSecondaryIndexInfo::GlobalSecondaryIndexInfo {
                                        IndexName: Default::default(),
                                        KeySchema: Default::default(),
                                        Projection: Default::default(),
                                        ProvisionedThroughput: Default::default(),
                                        OnDemandThroughput: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GlobalSecondaryIndexInfo>
                                for GlobalSecondaryIndexInfo {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1764,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GlobalSecondaryIndexUpdate {
                                GlobalSecondaryIndexUpdate {
                                    Update: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateGlobalSecondaryIndexAction>>>,
                                    Create: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateGlobalSecondaryIndexAction>>>,
                                    Delete: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteGlobalSecondaryIndexAction>>>
                                }
                            }

                            impl GlobalSecondaryIndexUpdate {
                                /// Returns a borrow of the field Update
                                pub fn Update(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateGlobalSecondaryIndexAction>>> {
                                    match self {
                                        GlobalSecondaryIndexUpdate::GlobalSecondaryIndexUpdate{Update, Create, Delete, } => Update,
                                    }
                                }
                                /// Returns a borrow of the field Create
                                pub fn Create(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateGlobalSecondaryIndexAction>>> {
                                    match self {
                                        GlobalSecondaryIndexUpdate::GlobalSecondaryIndexUpdate{Update, Create, Delete, } => Create,
                                    }
                                }
                                /// Returns a borrow of the field Delete
                                pub fn Delete(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteGlobalSecondaryIndexAction>>> {
                                    match self {
                                        GlobalSecondaryIndexUpdate::GlobalSecondaryIndexUpdate{Update, Create, Delete, } => Delete,
                                    }
                                }
                            }

                            impl Debug
                                for GlobalSecondaryIndexUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GlobalSecondaryIndexUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GlobalSecondaryIndexUpdate::GlobalSecondaryIndexUpdate{Update, Create, Delete, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexUpdate.GlobalSecondaryIndexUpdate(")?;
                                            DafnyPrint::fmt_print(Update, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Create, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Delete, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GlobalSecondaryIndexUpdate {}

                            impl Hash
                                for GlobalSecondaryIndexUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GlobalSecondaryIndexUpdate::GlobalSecondaryIndexUpdate{Update, Create, Delete, } => {
                                            Hash::hash(Update, _state);
                                            Hash::hash(Create, _state);
                                            Hash::hash(Delete, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GlobalSecondaryIndexUpdate {
                                fn default() -> GlobalSecondaryIndexUpdate {
                                    GlobalSecondaryIndexUpdate::GlobalSecondaryIndexUpdate {
                                        Update: Default::default(),
                                        Create: Default::default(),
                                        Delete: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GlobalSecondaryIndexUpdate>
                                for GlobalSecondaryIndexUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1770,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GlobalTable {
                                GlobalTable {
                                    GlobalTableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ReplicationGroup: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Replica>>>>
                                }
                            }

                            impl GlobalTable {
                                /// Returns a borrow of the field GlobalTableName
                                pub fn GlobalTableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GlobalTable::GlobalTable{GlobalTableName, ReplicationGroup, } => GlobalTableName,
                                    }
                                }
                                /// Returns a borrow of the field ReplicationGroup
                                pub fn ReplicationGroup(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Replica>>>> {
                                    match self {
                                        GlobalTable::GlobalTable{GlobalTableName, ReplicationGroup, } => ReplicationGroup,
                                    }
                                }
                            }

                            impl Debug
                                for GlobalTable {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GlobalTable {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GlobalTable::GlobalTable{GlobalTableName, ReplicationGroup, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTable.GlobalTable(")?;
                                            DafnyPrint::fmt_print(GlobalTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicationGroup, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GlobalTable {}

                            impl Hash
                                for GlobalTable {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GlobalTable::GlobalTable{GlobalTableName, ReplicationGroup, } => {
                                            Hash::hash(GlobalTableName, _state);
                                            Hash::hash(ReplicationGroup, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GlobalTable {
                                fn default() -> GlobalTable {
                                    GlobalTable::GlobalTable {
                                        GlobalTableName: Default::default(),
                                        ReplicationGroup: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GlobalTable>
                                for GlobalTable {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1775,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GlobalTableDescription {
                                GlobalTableDescription {
                                    ReplicationGroup: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaDescription>>>>,
                                    GlobalTableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CreationDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    GlobalTableStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableStatus>>>,
                                    GlobalTableName: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl GlobalTableDescription {
                                /// Returns a borrow of the field ReplicationGroup
                                pub fn ReplicationGroup(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaDescription>>>> {
                                    match self {
                                        GlobalTableDescription::GlobalTableDescription{ReplicationGroup, GlobalTableArn, CreationDateTime, GlobalTableStatus, GlobalTableName, } => ReplicationGroup,
                                    }
                                }
                                /// Returns a borrow of the field GlobalTableArn
                                pub fn GlobalTableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GlobalTableDescription::GlobalTableDescription{ReplicationGroup, GlobalTableArn, CreationDateTime, GlobalTableStatus, GlobalTableName, } => GlobalTableArn,
                                    }
                                }
                                /// Returns a borrow of the field CreationDateTime
                                pub fn CreationDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GlobalTableDescription::GlobalTableDescription{ReplicationGroup, GlobalTableArn, CreationDateTime, GlobalTableStatus, GlobalTableName, } => CreationDateTime,
                                    }
                                }
                                /// Returns a borrow of the field GlobalTableStatus
                                pub fn GlobalTableStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableStatus>>> {
                                    match self {
                                        GlobalTableDescription::GlobalTableDescription{ReplicationGroup, GlobalTableArn, CreationDateTime, GlobalTableStatus, GlobalTableName, } => GlobalTableStatus,
                                    }
                                }
                                /// Returns a borrow of the field GlobalTableName
                                pub fn GlobalTableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GlobalTableDescription::GlobalTableDescription{ReplicationGroup, GlobalTableArn, CreationDateTime, GlobalTableStatus, GlobalTableName, } => GlobalTableName,
                                    }
                                }
                            }

                            impl Debug
                                for GlobalTableDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GlobalTableDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GlobalTableDescription::GlobalTableDescription{ReplicationGroup, GlobalTableArn, CreationDateTime, GlobalTableStatus, GlobalTableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableDescription.GlobalTableDescription(")?;
                                            DafnyPrint::fmt_print(ReplicationGroup, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalTableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CreationDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalTableStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalTableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GlobalTableDescription {}

                            impl Hash
                                for GlobalTableDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GlobalTableDescription::GlobalTableDescription{ReplicationGroup, GlobalTableArn, CreationDateTime, GlobalTableStatus, GlobalTableName, } => {
                                            Hash::hash(ReplicationGroup, _state);
                                            Hash::hash(GlobalTableArn, _state);
                                            Hash::hash(CreationDateTime, _state);
                                            Hash::hash(GlobalTableStatus, _state);
                                            Hash::hash(GlobalTableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GlobalTableDescription {
                                fn default() -> GlobalTableDescription {
                                    GlobalTableDescription::GlobalTableDescription {
                                        ReplicationGroup: Default::default(),
                                        GlobalTableArn: Default::default(),
                                        CreationDateTime: Default::default(),
                                        GlobalTableStatus: Default::default(),
                                        GlobalTableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GlobalTableDescription>
                                for GlobalTableDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1782,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GlobalTableGlobalSecondaryIndexSettingsUpdate {
                                GlobalTableGlobalSecondaryIndexSettingsUpdate {
                                    IndexName: Sequence<DafnyCharUTF16>,
                                    ProvisionedWriteCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    ProvisionedWriteCapacityAutoScalingSettingsUpdate: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>>
                                }
                            }

                            impl GlobalTableGlobalSecondaryIndexSettingsUpdate {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GlobalTableGlobalSecondaryIndexSettingsUpdate::GlobalTableGlobalSecondaryIndexSettingsUpdate{IndexName, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettingsUpdate, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedWriteCapacityUnits
                                pub fn ProvisionedWriteCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        GlobalTableGlobalSecondaryIndexSettingsUpdate::GlobalTableGlobalSecondaryIndexSettingsUpdate{IndexName, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettingsUpdate, } => ProvisionedWriteCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedWriteCapacityAutoScalingSettingsUpdate
                                pub fn ProvisionedWriteCapacityAutoScalingSettingsUpdate(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>> {
                                    match self {
                                        GlobalTableGlobalSecondaryIndexSettingsUpdate::GlobalTableGlobalSecondaryIndexSettingsUpdate{IndexName, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettingsUpdate, } => ProvisionedWriteCapacityAutoScalingSettingsUpdate,
                                    }
                                }
                            }

                            impl Debug
                                for GlobalTableGlobalSecondaryIndexSettingsUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GlobalTableGlobalSecondaryIndexSettingsUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GlobalTableGlobalSecondaryIndexSettingsUpdate::GlobalTableGlobalSecondaryIndexSettingsUpdate{IndexName, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettingsUpdate, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableGlobalSecondaryIndexSettingsUpdate.GlobalTableGlobalSecondaryIndexSettingsUpdate(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedWriteCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedWriteCapacityAutoScalingSettingsUpdate, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GlobalTableGlobalSecondaryIndexSettingsUpdate {}

                            impl Hash
                                for GlobalTableGlobalSecondaryIndexSettingsUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GlobalTableGlobalSecondaryIndexSettingsUpdate::GlobalTableGlobalSecondaryIndexSettingsUpdate{IndexName, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettingsUpdate, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ProvisionedWriteCapacityUnits, _state);
                                            Hash::hash(ProvisionedWriteCapacityAutoScalingSettingsUpdate, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GlobalTableGlobalSecondaryIndexSettingsUpdate {
                                fn default() -> GlobalTableGlobalSecondaryIndexSettingsUpdate {
                                    GlobalTableGlobalSecondaryIndexSettingsUpdate::GlobalTableGlobalSecondaryIndexSettingsUpdate {
                                        IndexName: Default::default(),
                                        ProvisionedWriteCapacityUnits: Default::default(),
                                        ProvisionedWriteCapacityAutoScalingSettingsUpdate: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GlobalTableGlobalSecondaryIndexSettingsUpdate>
                                for GlobalTableGlobalSecondaryIndexSettingsUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1787,3)
                            pub type GlobalTableGlobalSecondaryIndexSettingsUpdateList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableGlobalSecondaryIndexSettingsUpdate>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1792,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GlobalTableStatus {
                                CREATING {},
                                ACTIVE {},
                                DELETING {},
                                UPDATING {}
                            }

                            impl GlobalTableStatus {}

                            impl Debug
                                for GlobalTableStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GlobalTableStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GlobalTableStatus::CREATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableStatus.CREATING")?;
                                            Ok(())
                                        },
                                        GlobalTableStatus::ACTIVE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableStatus.ACTIVE")?;
                                            Ok(())
                                        },
                                        GlobalTableStatus::DELETING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableStatus.DELETING")?;
                                            Ok(())
                                        },
                                        GlobalTableStatus::UPDATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableStatus.UPDATING")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl GlobalTableStatus {
                                /// Enumerates all possible values of GlobalTableStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<GlobalTableStatus>> {
                                    seq![Arc::new(GlobalTableStatus::CREATING {}), Arc::new(GlobalTableStatus::ACTIVE {}), Arc::new(GlobalTableStatus::DELETING {}), Arc::new(GlobalTableStatus::UPDATING {})].iter()
                                }
                            }

                            impl Eq
                                for GlobalTableStatus {}

                            impl Hash
                                for GlobalTableStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GlobalTableStatus::CREATING{} => {

                                        },
                                        GlobalTableStatus::ACTIVE{} => {

                                        },
                                        GlobalTableStatus::DELETING{} => {

                                        },
                                        GlobalTableStatus::UPDATING{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for GlobalTableStatus {
                                fn default() -> GlobalTableStatus {
                                    GlobalTableStatus::CREATING {}
                                }
                            }

                            impl AsRef<GlobalTableStatus>
                                for GlobalTableStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1797,3)
                            pub type ImportArn = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1801,3)
                            pub type ImportedItemCount = i64;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1805,3)
                            pub type ImportNextToken = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1809,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ImportStatus {
                                IN_PROGRESS {},
                                COMPLETED {},
                                CANCELLING {},
                                CANCELLED {},
                                FAILED {}
                            }

                            impl ImportStatus {}

                            impl Debug
                                for ImportStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ImportStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ImportStatus::IN_PROGRESS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportStatus.IN__PROGRESS")?;
                                            Ok(())
                                        },
                                        ImportStatus::COMPLETED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportStatus.COMPLETED")?;
                                            Ok(())
                                        },
                                        ImportStatus::CANCELLING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportStatus.CANCELLING")?;
                                            Ok(())
                                        },
                                        ImportStatus::CANCELLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportStatus.CANCELLED")?;
                                            Ok(())
                                        },
                                        ImportStatus::FAILED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportStatus.FAILED")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ImportStatus {
                                /// Enumerates all possible values of ImportStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ImportStatus>> {
                                    seq![Arc::new(ImportStatus::IN_PROGRESS {}), Arc::new(ImportStatus::COMPLETED {}), Arc::new(ImportStatus::CANCELLING {}), Arc::new(ImportStatus::CANCELLED {}), Arc::new(ImportStatus::FAILED {})].iter()
                                }
                            }

                            impl Eq
                                for ImportStatus {}

                            impl Hash
                                for ImportStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ImportStatus::IN_PROGRESS{} => {

                                        },
                                        ImportStatus::COMPLETED{} => {

                                        },
                                        ImportStatus::CANCELLING{} => {

                                        },
                                        ImportStatus::CANCELLED{} => {

                                        },
                                        ImportStatus::FAILED{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ImportStatus {
                                fn default() -> ImportStatus {
                                    ImportStatus::IN_PROGRESS {}
                                }
                            }

                            impl AsRef<ImportStatus>
                                for ImportStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1815,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ImportSummary {
                                ImportSummary {
                                    ImportArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ImportStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportStatus>>>,
                                    TableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3BucketSource: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::S3BucketSource>>>,
                                    CloudWatchLogGroupArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    InputFormat: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputFormat>>>,
                                    StartTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    EndTime: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ImportSummary {
                                /// Returns a borrow of the field ImportArn
                                pub fn ImportArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportSummary::ImportSummary{ImportArn, ImportStatus, TableArn, S3BucketSource, CloudWatchLogGroupArn, InputFormat, StartTime, EndTime, } => ImportArn,
                                    }
                                }
                                /// Returns a borrow of the field ImportStatus
                                pub fn ImportStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportStatus>>> {
                                    match self {
                                        ImportSummary::ImportSummary{ImportArn, ImportStatus, TableArn, S3BucketSource, CloudWatchLogGroupArn, InputFormat, StartTime, EndTime, } => ImportStatus,
                                    }
                                }
                                /// Returns a borrow of the field TableArn
                                pub fn TableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportSummary::ImportSummary{ImportArn, ImportStatus, TableArn, S3BucketSource, CloudWatchLogGroupArn, InputFormat, StartTime, EndTime, } => TableArn,
                                    }
                                }
                                /// Returns a borrow of the field S3BucketSource
                                pub fn S3BucketSource(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::S3BucketSource>>> {
                                    match self {
                                        ImportSummary::ImportSummary{ImportArn, ImportStatus, TableArn, S3BucketSource, CloudWatchLogGroupArn, InputFormat, StartTime, EndTime, } => S3BucketSource,
                                    }
                                }
                                /// Returns a borrow of the field CloudWatchLogGroupArn
                                pub fn CloudWatchLogGroupArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportSummary::ImportSummary{ImportArn, ImportStatus, TableArn, S3BucketSource, CloudWatchLogGroupArn, InputFormat, StartTime, EndTime, } => CloudWatchLogGroupArn,
                                    }
                                }
                                /// Returns a borrow of the field InputFormat
                                pub fn InputFormat(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputFormat>>> {
                                    match self {
                                        ImportSummary::ImportSummary{ImportArn, ImportStatus, TableArn, S3BucketSource, CloudWatchLogGroupArn, InputFormat, StartTime, EndTime, } => InputFormat,
                                    }
                                }
                                /// Returns a borrow of the field StartTime
                                pub fn StartTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportSummary::ImportSummary{ImportArn, ImportStatus, TableArn, S3BucketSource, CloudWatchLogGroupArn, InputFormat, StartTime, EndTime, } => StartTime,
                                    }
                                }
                                /// Returns a borrow of the field EndTime
                                pub fn EndTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportSummary::ImportSummary{ImportArn, ImportStatus, TableArn, S3BucketSource, CloudWatchLogGroupArn, InputFormat, StartTime, EndTime, } => EndTime,
                                    }
                                }
                            }

                            impl Debug
                                for ImportSummary {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ImportSummary {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ImportSummary::ImportSummary{ImportArn, ImportStatus, TableArn, S3BucketSource, CloudWatchLogGroupArn, InputFormat, StartTime, EndTime, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportSummary.ImportSummary(")?;
                                            DafnyPrint::fmt_print(ImportArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ImportStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3BucketSource, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CloudWatchLogGroupArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(InputFormat, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StartTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EndTime, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ImportSummary {}

                            impl Hash
                                for ImportSummary {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ImportSummary::ImportSummary{ImportArn, ImportStatus, TableArn, S3BucketSource, CloudWatchLogGroupArn, InputFormat, StartTime, EndTime, } => {
                                            Hash::hash(ImportArn, _state);
                                            Hash::hash(ImportStatus, _state);
                                            Hash::hash(TableArn, _state);
                                            Hash::hash(S3BucketSource, _state);
                                            Hash::hash(CloudWatchLogGroupArn, _state);
                                            Hash::hash(InputFormat, _state);
                                            Hash::hash(StartTime, _state);
                                            Hash::hash(EndTime, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ImportSummary {
                                fn default() -> ImportSummary {
                                    ImportSummary::ImportSummary {
                                        ImportArn: Default::default(),
                                        ImportStatus: Default::default(),
                                        TableArn: Default::default(),
                                        S3BucketSource: Default::default(),
                                        CloudWatchLogGroupArn: Default::default(),
                                        InputFormat: Default::default(),
                                        StartTime: Default::default(),
                                        EndTime: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ImportSummary>
                                for ImportSummary {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1826,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ImportTableDescription {
                                ImportTableDescription {
                                    ImportArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ImportStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportStatus>>>,
                                    TableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TableId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ClientToken: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3BucketSource: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::S3BucketSource>>>,
                                    ErrorCount: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ErrorCount>>,
                                    CloudWatchLogGroupArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    InputFormat: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputFormat>>>,
                                    InputFormatOptions: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputFormatOptions>>>,
                                    InputCompressionType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputCompressionType>>>,
                                    TableCreationParameters: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableCreationParameters>>>,
                                    StartTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    EndTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ProcessedSizeBytes: Arc<Option<i64>>,
                                    ProcessedItemCount: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProcessedItemCount>>,
                                    ImportedItemCount: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportedItemCount>>,
                                    FailureCode: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    FailureMessage: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ImportTableDescription {
                                /// Returns a borrow of the field ImportArn
                                pub fn ImportArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => ImportArn,
                                    }
                                }
                                /// Returns a borrow of the field ImportStatus
                                pub fn ImportStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportStatus>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => ImportStatus,
                                    }
                                }
                                /// Returns a borrow of the field TableArn
                                pub fn TableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => TableArn,
                                    }
                                }
                                /// Returns a borrow of the field TableId
                                pub fn TableId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => TableId,
                                    }
                                }
                                /// Returns a borrow of the field ClientToken
                                pub fn ClientToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => ClientToken,
                                    }
                                }
                                /// Returns a borrow of the field S3BucketSource
                                pub fn S3BucketSource(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::S3BucketSource>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => S3BucketSource,
                                    }
                                }
                                /// Returns a borrow of the field ErrorCount
                                pub fn ErrorCount(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ErrorCount>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => ErrorCount,
                                    }
                                }
                                /// Returns a borrow of the field CloudWatchLogGroupArn
                                pub fn CloudWatchLogGroupArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => CloudWatchLogGroupArn,
                                    }
                                }
                                /// Returns a borrow of the field InputFormat
                                pub fn InputFormat(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputFormat>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => InputFormat,
                                    }
                                }
                                /// Returns a borrow of the field InputFormatOptions
                                pub fn InputFormatOptions(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputFormatOptions>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => InputFormatOptions,
                                    }
                                }
                                /// Returns a borrow of the field InputCompressionType
                                pub fn InputCompressionType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputCompressionType>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => InputCompressionType,
                                    }
                                }
                                /// Returns a borrow of the field TableCreationParameters
                                pub fn TableCreationParameters(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableCreationParameters>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => TableCreationParameters,
                                    }
                                }
                                /// Returns a borrow of the field StartTime
                                pub fn StartTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => StartTime,
                                    }
                                }
                                /// Returns a borrow of the field EndTime
                                pub fn EndTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => EndTime,
                                    }
                                }
                                /// Returns a borrow of the field ProcessedSizeBytes
                                pub fn ProcessedSizeBytes(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => ProcessedSizeBytes,
                                    }
                                }
                                /// Returns a borrow of the field ProcessedItemCount
                                pub fn ProcessedItemCount(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProcessedItemCount>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => ProcessedItemCount,
                                    }
                                }
                                /// Returns a borrow of the field ImportedItemCount
                                pub fn ImportedItemCount(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportedItemCount>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => ImportedItemCount,
                                    }
                                }
                                /// Returns a borrow of the field FailureCode
                                pub fn FailureCode(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => FailureCode,
                                    }
                                }
                                /// Returns a borrow of the field FailureMessage
                                pub fn FailureMessage(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => FailureMessage,
                                    }
                                }
                            }

                            impl Debug
                                for ImportTableDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ImportTableDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableDescription.ImportTableDescription(")?;
                                            DafnyPrint::fmt_print(ImportArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ImportStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ClientToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3BucketSource, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ErrorCount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CloudWatchLogGroupArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(InputFormat, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(InputFormatOptions, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(InputCompressionType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableCreationParameters, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StartTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EndTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProcessedSizeBytes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProcessedItemCount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ImportedItemCount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(FailureCode, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(FailureMessage, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ImportTableDescription {}

                            impl Hash
                                for ImportTableDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ImportTableDescription::ImportTableDescription{ImportArn, ImportStatus, TableArn, TableId, ClientToken, S3BucketSource, ErrorCount, CloudWatchLogGroupArn, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, StartTime, EndTime, ProcessedSizeBytes, ProcessedItemCount, ImportedItemCount, FailureCode, FailureMessage, } => {
                                            Hash::hash(ImportArn, _state);
                                            Hash::hash(ImportStatus, _state);
                                            Hash::hash(TableArn, _state);
                                            Hash::hash(TableId, _state);
                                            Hash::hash(ClientToken, _state);
                                            Hash::hash(S3BucketSource, _state);
                                            Hash::hash(ErrorCount, _state);
                                            Hash::hash(CloudWatchLogGroupArn, _state);
                                            Hash::hash(InputFormat, _state);
                                            Hash::hash(InputFormatOptions, _state);
                                            Hash::hash(InputCompressionType, _state);
                                            Hash::hash(TableCreationParameters, _state);
                                            Hash::hash(StartTime, _state);
                                            Hash::hash(EndTime, _state);
                                            Hash::hash(ProcessedSizeBytes, _state);
                                            Hash::hash(ProcessedItemCount, _state);
                                            Hash::hash(ImportedItemCount, _state);
                                            Hash::hash(FailureCode, _state);
                                            Hash::hash(FailureMessage, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ImportTableDescription {
                                fn default() -> ImportTableDescription {
                                    ImportTableDescription::ImportTableDescription {
                                        ImportArn: Default::default(),
                                        ImportStatus: Default::default(),
                                        TableArn: Default::default(),
                                        TableId: Default::default(),
                                        ClientToken: Default::default(),
                                        S3BucketSource: Default::default(),
                                        ErrorCount: Default::default(),
                                        CloudWatchLogGroupArn: Default::default(),
                                        InputFormat: Default::default(),
                                        InputFormatOptions: Default::default(),
                                        InputCompressionType: Default::default(),
                                        TableCreationParameters: Default::default(),
                                        StartTime: Default::default(),
                                        EndTime: Default::default(),
                                        ProcessedSizeBytes: Default::default(),
                                        ProcessedItemCount: Default::default(),
                                        ImportedItemCount: Default::default(),
                                        FailureCode: Default::default(),
                                        FailureMessage: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ImportTableDescription>
                                for ImportTableDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1847,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ImportTableInput {
                                ImportTableInput {
                                    ClientToken: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3BucketSource: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::S3BucketSource>,
                                    InputFormat: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputFormat>,
                                    InputFormatOptions: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputFormatOptions>>>,
                                    InputCompressionType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputCompressionType>>>,
                                    TableCreationParameters: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableCreationParameters>
                                }
                            }

                            impl ImportTableInput {
                                /// Returns a borrow of the field ClientToken
                                pub fn ClientToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportTableInput::ImportTableInput{ClientToken, S3BucketSource, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, } => ClientToken,
                                    }
                                }
                                /// Returns a borrow of the field S3BucketSource
                                pub fn S3BucketSource(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::S3BucketSource> {
                                    match self {
                                        ImportTableInput::ImportTableInput{ClientToken, S3BucketSource, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, } => S3BucketSource,
                                    }
                                }
                                /// Returns a borrow of the field InputFormat
                                pub fn InputFormat(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputFormat> {
                                    match self {
                                        ImportTableInput::ImportTableInput{ClientToken, S3BucketSource, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, } => InputFormat,
                                    }
                                }
                                /// Returns a borrow of the field InputFormatOptions
                                pub fn InputFormatOptions(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputFormatOptions>>> {
                                    match self {
                                        ImportTableInput::ImportTableInput{ClientToken, S3BucketSource, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, } => InputFormatOptions,
                                    }
                                }
                                /// Returns a borrow of the field InputCompressionType
                                pub fn InputCompressionType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::InputCompressionType>>> {
                                    match self {
                                        ImportTableInput::ImportTableInput{ClientToken, S3BucketSource, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, } => InputCompressionType,
                                    }
                                }
                                /// Returns a borrow of the field TableCreationParameters
                                pub fn TableCreationParameters(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableCreationParameters> {
                                    match self {
                                        ImportTableInput::ImportTableInput{ClientToken, S3BucketSource, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, } => TableCreationParameters,
                                    }
                                }
                            }

                            impl Debug
                                for ImportTableInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ImportTableInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ImportTableInput::ImportTableInput{ClientToken, S3BucketSource, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableInput.ImportTableInput(")?;
                                            DafnyPrint::fmt_print(ClientToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3BucketSource, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(InputFormat, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(InputFormatOptions, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(InputCompressionType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableCreationParameters, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ImportTableInput {}

                            impl Hash
                                for ImportTableInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ImportTableInput::ImportTableInput{ClientToken, S3BucketSource, InputFormat, InputFormatOptions, InputCompressionType, TableCreationParameters, } => {
                                            Hash::hash(ClientToken, _state);
                                            Hash::hash(S3BucketSource, _state);
                                            Hash::hash(InputFormat, _state);
                                            Hash::hash(InputFormatOptions, _state);
                                            Hash::hash(InputCompressionType, _state);
                                            Hash::hash(TableCreationParameters, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ImportTableInput {
                                fn default() -> ImportTableInput {
                                    ImportTableInput::ImportTableInput {
                                        ClientToken: Default::default(),
                                        S3BucketSource: Default::default(),
                                        InputFormat: Default::default(),
                                        InputFormatOptions: Default::default(),
                                        InputCompressionType: Default::default(),
                                        TableCreationParameters: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ImportTableInput>
                                for ImportTableInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1855,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ImportTableOutput {
                                ImportTableOutput {
                                    ImportTableDescription: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportTableDescription>
                                }
                            }

                            impl ImportTableOutput {
                                /// Returns a borrow of the field ImportTableDescription
                                pub fn ImportTableDescription(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportTableDescription> {
                                    match self {
                                        ImportTableOutput::ImportTableOutput{ImportTableDescription, } => ImportTableDescription,
                                    }
                                }
                            }

                            impl Debug
                                for ImportTableOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ImportTableOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ImportTableOutput::ImportTableOutput{ImportTableDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableOutput.ImportTableOutput(")?;
                                            DafnyPrint::fmt_print(ImportTableDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ImportTableOutput {}

                            impl Hash
                                for ImportTableOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ImportTableOutput::ImportTableOutput{ImportTableDescription, } => {
                                            Hash::hash(ImportTableDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ImportTableOutput {
                                fn default() -> ImportTableOutput {
                                    ImportTableOutput::ImportTableOutput {
                                        ImportTableDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ImportTableOutput>
                                for ImportTableOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1858,3)
                            #[derive(PartialEq, Clone)]
                            pub enum IncrementalExportSpecification {
                                IncrementalExportSpecification {
                                    ExportFromTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExportToTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExportViewType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportViewType>>>
                                }
                            }

                            impl IncrementalExportSpecification {
                                /// Returns a borrow of the field ExportFromTime
                                pub fn ExportFromTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        IncrementalExportSpecification::IncrementalExportSpecification{ExportFromTime, ExportToTime, ExportViewType, } => ExportFromTime,
                                    }
                                }
                                /// Returns a borrow of the field ExportToTime
                                pub fn ExportToTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        IncrementalExportSpecification::IncrementalExportSpecification{ExportFromTime, ExportToTime, ExportViewType, } => ExportToTime,
                                    }
                                }
                                /// Returns a borrow of the field ExportViewType
                                pub fn ExportViewType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportViewType>>> {
                                    match self {
                                        IncrementalExportSpecification::IncrementalExportSpecification{ExportFromTime, ExportToTime, ExportViewType, } => ExportViewType,
                                    }
                                }
                            }

                            impl Debug
                                for IncrementalExportSpecification {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for IncrementalExportSpecification {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        IncrementalExportSpecification::IncrementalExportSpecification{ExportFromTime, ExportToTime, ExportViewType, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.IncrementalExportSpecification.IncrementalExportSpecification(")?;
                                            DafnyPrint::fmt_print(ExportFromTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportToTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExportViewType, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for IncrementalExportSpecification {}

                            impl Hash
                                for IncrementalExportSpecification {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        IncrementalExportSpecification::IncrementalExportSpecification{ExportFromTime, ExportToTime, ExportViewType, } => {
                                            Hash::hash(ExportFromTime, _state);
                                            Hash::hash(ExportToTime, _state);
                                            Hash::hash(ExportViewType, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for IncrementalExportSpecification {
                                fn default() -> IncrementalExportSpecification {
                                    IncrementalExportSpecification::IncrementalExportSpecification {
                                        ExportFromTime: Default::default(),
                                        ExportToTime: Default::default(),
                                        ExportViewType: Default::default()
                                    }
                                }
                            }

                            impl AsRef<IncrementalExportSpecification>
                                for IncrementalExportSpecification {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1863,3)
                            pub type IndexName = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1867,3)
                            #[derive(PartialEq, Clone)]
                            pub enum IndexStatus {
                                CREATING {},
                                UPDATING {},
                                DELETING {},
                                ACTIVE {}
                            }

                            impl IndexStatus {}

                            impl Debug
                                for IndexStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for IndexStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        IndexStatus::CREATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus.CREATING")?;
                                            Ok(())
                                        },
                                        IndexStatus::UPDATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus.UPDATING")?;
                                            Ok(())
                                        },
                                        IndexStatus::DELETING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus.DELETING")?;
                                            Ok(())
                                        },
                                        IndexStatus::ACTIVE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus.ACTIVE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl IndexStatus {
                                /// Enumerates all possible values of IndexStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<IndexStatus>> {
                                    seq![Arc::new(IndexStatus::CREATING {}), Arc::new(IndexStatus::UPDATING {}), Arc::new(IndexStatus::DELETING {}), Arc::new(IndexStatus::ACTIVE {})].iter()
                                }
                            }

                            impl Eq
                                for IndexStatus {}

                            impl Hash
                                for IndexStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        IndexStatus::CREATING{} => {

                                        },
                                        IndexStatus::UPDATING{} => {

                                        },
                                        IndexStatus::DELETING{} => {

                                        },
                                        IndexStatus::ACTIVE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for IndexStatus {
                                fn default() -> IndexStatus {
                                    IndexStatus::CREATING {}
                                }
                            }

                            impl AsRef<IndexStatus>
                                for IndexStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1872,3)
                            #[derive(PartialEq, Clone)]
                            pub enum InputCompressionType {
                                GZIP {},
                                ZSTD {},
                                NONE {}
                            }

                            impl InputCompressionType {}

                            impl Debug
                                for InputCompressionType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for InputCompressionType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        InputCompressionType::GZIP{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.InputCompressionType.GZIP")?;
                                            Ok(())
                                        },
                                        InputCompressionType::ZSTD{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.InputCompressionType.ZSTD")?;
                                            Ok(())
                                        },
                                        InputCompressionType::NONE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.InputCompressionType.NONE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl InputCompressionType {
                                /// Enumerates all possible values of InputCompressionType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<InputCompressionType>> {
                                    seq![Arc::new(InputCompressionType::GZIP {}), Arc::new(InputCompressionType::ZSTD {}), Arc::new(InputCompressionType::NONE {})].iter()
                                }
                            }

                            impl Eq
                                for InputCompressionType {}

                            impl Hash
                                for InputCompressionType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        InputCompressionType::GZIP{} => {

                                        },
                                        InputCompressionType::ZSTD{} => {

                                        },
                                        InputCompressionType::NONE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for InputCompressionType {
                                fn default() -> InputCompressionType {
                                    InputCompressionType::GZIP {}
                                }
                            }

                            impl AsRef<InputCompressionType>
                                for InputCompressionType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1876,3)
                            #[derive(PartialEq, Clone)]
                            pub enum InputFormat {
                                DYNAMODB_JSON {},
                                ION {},
                                CSV {}
                            }

                            impl InputFormat {}

                            impl Debug
                                for InputFormat {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for InputFormat {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        InputFormat::DYNAMODB_JSON{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.InputFormat.DYNAMODB__JSON")?;
                                            Ok(())
                                        },
                                        InputFormat::ION{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.InputFormat.ION")?;
                                            Ok(())
                                        },
                                        InputFormat::CSV{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.InputFormat.CSV")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl InputFormat {
                                /// Enumerates all possible values of InputFormat
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<InputFormat>> {
                                    seq![Arc::new(InputFormat::DYNAMODB_JSON {}), Arc::new(InputFormat::ION {}), Arc::new(InputFormat::CSV {})].iter()
                                }
                            }

                            impl Eq
                                for InputFormat {}

                            impl Hash
                                for InputFormat {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        InputFormat::DYNAMODB_JSON{} => {

                                        },
                                        InputFormat::ION{} => {

                                        },
                                        InputFormat::CSV{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for InputFormat {
                                fn default() -> InputFormat {
                                    InputFormat::DYNAMODB_JSON {}
                                }
                            }

                            impl AsRef<InputFormat>
                                for InputFormat {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1880,3)
                            #[derive(PartialEq, Clone)]
                            pub enum InputFormatOptions {
                                InputFormatOptions {
                                    Csv: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CsvOptions>>>
                                }
                            }

                            impl InputFormatOptions {
                                /// Returns a borrow of the field Csv
                                pub fn Csv(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CsvOptions>>> {
                                    match self {
                                        InputFormatOptions::InputFormatOptions{Csv, } => Csv,
                                    }
                                }
                            }

                            impl Debug
                                for InputFormatOptions {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for InputFormatOptions {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        InputFormatOptions::InputFormatOptions{Csv, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.InputFormatOptions.InputFormatOptions(")?;
                                            DafnyPrint::fmt_print(Csv, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for InputFormatOptions {}

                            impl Hash
                                for InputFormatOptions {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        InputFormatOptions::InputFormatOptions{Csv, } => {
                                            Hash::hash(Csv, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for InputFormatOptions {
                                fn default() -> InputFormatOptions {
                                    InputFormatOptions::InputFormatOptions {
                                        Csv: Default::default()
                                    }
                                }
                            }

                            impl AsRef<InputFormatOptions>
                                for InputFormatOptions {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1886,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ItemCollectionMetrics {
                                ItemCollectionMetrics {
                                    ItemCollectionKey: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    SizeEstimateRangeGB: Arc<Option<Sequence<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionSizeEstimateBound>>>
                                }
                            }

                            impl ItemCollectionMetrics {
                                /// Returns a borrow of the field ItemCollectionKey
                                pub fn ItemCollectionKey(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        ItemCollectionMetrics::ItemCollectionMetrics{ItemCollectionKey, SizeEstimateRangeGB, } => ItemCollectionKey,
                                    }
                                }
                                /// Returns a borrow of the field SizeEstimateRangeGB
                                pub fn SizeEstimateRangeGB(&self) -> &Arc<Option<Sequence<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionSizeEstimateBound>>> {
                                    match self {
                                        ItemCollectionMetrics::ItemCollectionMetrics{ItemCollectionKey, SizeEstimateRangeGB, } => SizeEstimateRangeGB,
                                    }
                                }
                            }

                            impl Debug
                                for ItemCollectionMetrics {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ItemCollectionMetrics {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ItemCollectionMetrics::ItemCollectionMetrics{ItemCollectionKey, SizeEstimateRangeGB, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemCollectionMetrics.ItemCollectionMetrics(")?;
                                            DafnyPrint::fmt_print(ItemCollectionKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SizeEstimateRangeGB, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ItemCollectionMetrics {}

                            impl Hash
                                for ItemCollectionMetrics {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ItemCollectionMetrics::ItemCollectionMetrics{ItemCollectionKey, SizeEstimateRangeGB, } => {
                                            Hash::hash(ItemCollectionKey, _state);
                                            Hash::hash(SizeEstimateRangeGB, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ItemCollectionMetrics {
                                fn default() -> ItemCollectionMetrics {
                                    ItemCollectionMetrics::ItemCollectionMetrics {
                                        ItemCollectionKey: Default::default(),
                                        SizeEstimateRangeGB: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ItemCollectionMetrics>
                                for ItemCollectionMetrics {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1892,3)
                            pub type ItemCollectionSizeEstimateBound = Sequence<u8>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1897,3)
                            pub type ItemCount = i64;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1902,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ItemResponse {
                                ItemResponse {
                                    Item: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>
                                }
                            }

                            impl ItemResponse {
                                /// Returns a borrow of the field Item
                                pub fn Item(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        ItemResponse::ItemResponse{Item, } => Item,
                                    }
                                }
                            }

                            impl Debug
                                for ItemResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ItemResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ItemResponse::ItemResponse{Item, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemResponse.ItemResponse(")?;
                                            DafnyPrint::fmt_print(Item, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ItemResponse {}

                            impl Hash
                                for ItemResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ItemResponse::ItemResponse{Item, } => {
                                            Hash::hash(Item, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ItemResponse {
                                fn default() -> ItemResponse {
                                    ItemResponse::ItemResponse {
                                        Item: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ItemResponse>
                                for ItemResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1905,3)
                            pub type ItemResponseList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemResponse>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1912,3)
                            pub type KeyList = Sequence<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1916,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeysAndAttributes {
                                KeysAndAttributes {
                                    Keys: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyList,
                                    AttributesToGet: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeNameList>>,
                                    ConsistentRead: Arc<Option<bool>>,
                                    ProjectionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>
                                }
                            }

                            impl KeysAndAttributes {
                                /// Returns a borrow of the field Keys
                                pub fn Keys(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyList {
                                    match self {
                                        KeysAndAttributes::KeysAndAttributes{Keys, AttributesToGet, ConsistentRead, ProjectionExpression, ExpressionAttributeNames, } => Keys,
                                    }
                                }
                                /// Returns a borrow of the field AttributesToGet
                                pub fn AttributesToGet(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeNameList>> {
                                    match self {
                                        KeysAndAttributes::KeysAndAttributes{Keys, AttributesToGet, ConsistentRead, ProjectionExpression, ExpressionAttributeNames, } => AttributesToGet,
                                    }
                                }
                                /// Returns a borrow of the field ConsistentRead
                                pub fn ConsistentRead(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        KeysAndAttributes::KeysAndAttributes{Keys, AttributesToGet, ConsistentRead, ProjectionExpression, ExpressionAttributeNames, } => ConsistentRead,
                                    }
                                }
                                /// Returns a borrow of the field ProjectionExpression
                                pub fn ProjectionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeysAndAttributes::KeysAndAttributes{Keys, AttributesToGet, ConsistentRead, ProjectionExpression, ExpressionAttributeNames, } => ProjectionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        KeysAndAttributes::KeysAndAttributes{Keys, AttributesToGet, ConsistentRead, ProjectionExpression, ExpressionAttributeNames, } => ExpressionAttributeNames,
                                    }
                                }
                            }

                            impl Debug
                                for KeysAndAttributes {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeysAndAttributes {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeysAndAttributes::KeysAndAttributes{Keys, AttributesToGet, ConsistentRead, ProjectionExpression, ExpressionAttributeNames, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KeysAndAttributes.KeysAndAttributes(")?;
                                            DafnyPrint::fmt_print(Keys, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttributesToGet, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsistentRead, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProjectionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for KeysAndAttributes {}

                            impl Hash
                                for KeysAndAttributes {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeysAndAttributes::KeysAndAttributes{Keys, AttributesToGet, ConsistentRead, ProjectionExpression, ExpressionAttributeNames, } => {
                                            Hash::hash(Keys, _state);
                                            Hash::hash(AttributesToGet, _state);
                                            Hash::hash(ConsistentRead, _state);
                                            Hash::hash(ProjectionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeysAndAttributes {
                                fn default() -> KeysAndAttributes {
                                    KeysAndAttributes::KeysAndAttributes {
                                        Keys: Default::default(),
                                        AttributesToGet: Default::default(),
                                        ConsistentRead: Default::default(),
                                        ProjectionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default()
                                    }
                                }
                            }

                            impl AsRef<KeysAndAttributes>
                                for KeysAndAttributes {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1923,3)
                            pub type KeySchema = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchemaElement>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1927,3)
                            pub type KeySchemaAttributeName = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1931,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeySchemaElement {
                                KeySchemaElement {
                                    AttributeName: Sequence<DafnyCharUTF16>,
                                    KeyType: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyType>
                                }
                            }

                            impl KeySchemaElement {
                                /// Returns a borrow of the field AttributeName
                                pub fn AttributeName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        KeySchemaElement::KeySchemaElement{AttributeName, KeyType, } => AttributeName,
                                    }
                                }
                                /// Returns a borrow of the field KeyType
                                pub fn KeyType(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyType> {
                                    match self {
                                        KeySchemaElement::KeySchemaElement{AttributeName, KeyType, } => KeyType,
                                    }
                                }
                            }

                            impl Debug
                                for KeySchemaElement {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeySchemaElement {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeySchemaElement::KeySchemaElement{AttributeName, KeyType, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KeySchemaElement.KeySchemaElement(")?;
                                            DafnyPrint::fmt_print(AttributeName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyType, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for KeySchemaElement {}

                            impl Hash
                                for KeySchemaElement {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeySchemaElement::KeySchemaElement{AttributeName, KeyType, } => {
                                            Hash::hash(AttributeName, _state);
                                            Hash::hash(KeyType, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeySchemaElement {
                                fn default() -> KeySchemaElement {
                                    KeySchemaElement::KeySchemaElement {
                                        AttributeName: Default::default(),
                                        KeyType: Default::default()
                                    }
                                }
                            }

                            impl AsRef<KeySchemaElement>
                                for KeySchemaElement {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1935,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeyType {
                                HASH {},
                                RANGE {}
                            }

                            impl KeyType {}

                            impl Debug
                                for KeyType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeyType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeyType::HASH{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KeyType.HASH")?;
                                            Ok(())
                                        },
                                        KeyType::RANGE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KeyType.RANGE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl KeyType {
                                /// Enumerates all possible values of KeyType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KeyType>> {
                                    seq![Arc::new(KeyType::HASH {}), Arc::new(KeyType::RANGE {})].iter()
                                }
                            }

                            impl Eq
                                for KeyType {}

                            impl Hash
                                for KeyType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeyType::HASH{} => {

                                        },
                                        KeyType::RANGE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeyType {
                                fn default() -> KeyType {
                                    KeyType::HASH {}
                                }
                            }

                            impl AsRef<KeyType>
                                for KeyType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1938,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KinesisDataStreamDestination {
                                KinesisDataStreamDestination {
                                    StreamArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    DestinationStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DestinationStatus>>>,
                                    DestinationStatusDescription: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ApproximateCreationDateTimePrecision: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ApproximateCreationDateTimePrecision>>>
                                }
                            }

                            impl KinesisDataStreamDestination {
                                /// Returns a borrow of the field StreamArn
                                pub fn StreamArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KinesisDataStreamDestination::KinesisDataStreamDestination{StreamArn, DestinationStatus, DestinationStatusDescription, ApproximateCreationDateTimePrecision, } => StreamArn,
                                    }
                                }
                                /// Returns a borrow of the field DestinationStatus
                                pub fn DestinationStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DestinationStatus>>> {
                                    match self {
                                        KinesisDataStreamDestination::KinesisDataStreamDestination{StreamArn, DestinationStatus, DestinationStatusDescription, ApproximateCreationDateTimePrecision, } => DestinationStatus,
                                    }
                                }
                                /// Returns a borrow of the field DestinationStatusDescription
                                pub fn DestinationStatusDescription(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KinesisDataStreamDestination::KinesisDataStreamDestination{StreamArn, DestinationStatus, DestinationStatusDescription, ApproximateCreationDateTimePrecision, } => DestinationStatusDescription,
                                    }
                                }
                                /// Returns a borrow of the field ApproximateCreationDateTimePrecision
                                pub fn ApproximateCreationDateTimePrecision(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ApproximateCreationDateTimePrecision>>> {
                                    match self {
                                        KinesisDataStreamDestination::KinesisDataStreamDestination{StreamArn, DestinationStatus, DestinationStatusDescription, ApproximateCreationDateTimePrecision, } => ApproximateCreationDateTimePrecision,
                                    }
                                }
                            }

                            impl Debug
                                for KinesisDataStreamDestination {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KinesisDataStreamDestination {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KinesisDataStreamDestination::KinesisDataStreamDestination{StreamArn, DestinationStatus, DestinationStatusDescription, ApproximateCreationDateTimePrecision, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KinesisDataStreamDestination.KinesisDataStreamDestination(")?;
                                            DafnyPrint::fmt_print(StreamArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DestinationStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DestinationStatusDescription, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ApproximateCreationDateTimePrecision, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for KinesisDataStreamDestination {}

                            impl Hash
                                for KinesisDataStreamDestination {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KinesisDataStreamDestination::KinesisDataStreamDestination{StreamArn, DestinationStatus, DestinationStatusDescription, ApproximateCreationDateTimePrecision, } => {
                                            Hash::hash(StreamArn, _state);
                                            Hash::hash(DestinationStatus, _state);
                                            Hash::hash(DestinationStatusDescription, _state);
                                            Hash::hash(ApproximateCreationDateTimePrecision, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for KinesisDataStreamDestination {
                                fn default() -> KinesisDataStreamDestination {
                                    KinesisDataStreamDestination::KinesisDataStreamDestination {
                                        StreamArn: Default::default(),
                                        DestinationStatus: Default::default(),
                                        DestinationStatusDescription: Default::default(),
                                        ApproximateCreationDateTimePrecision: Default::default()
                                    }
                                }
                            }

                            impl AsRef<KinesisDataStreamDestination>
                                for KinesisDataStreamDestination {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1945,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KinesisStreamingDestinationInput {
                                KinesisStreamingDestinationInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    StreamArn: Sequence<DafnyCharUTF16>,
                                    EnableKinesisStreamingConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>>
                                }
                            }

                            impl KinesisStreamingDestinationInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        KinesisStreamingDestinationInput::KinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field StreamArn
                                pub fn StreamArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        KinesisStreamingDestinationInput::KinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => StreamArn,
                                    }
                                }
                                /// Returns a borrow of the field EnableKinesisStreamingConfiguration
                                pub fn EnableKinesisStreamingConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>> {
                                    match self {
                                        KinesisStreamingDestinationInput::KinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => EnableKinesisStreamingConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for KinesisStreamingDestinationInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KinesisStreamingDestinationInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KinesisStreamingDestinationInput::KinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KinesisStreamingDestinationInput.KinesisStreamingDestinationInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EnableKinesisStreamingConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for KinesisStreamingDestinationInput {}

                            impl Hash
                                for KinesisStreamingDestinationInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KinesisStreamingDestinationInput::KinesisStreamingDestinationInput{TableName, StreamArn, EnableKinesisStreamingConfiguration, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(StreamArn, _state);
                                            Hash::hash(EnableKinesisStreamingConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for KinesisStreamingDestinationInput {
                                fn default() -> KinesisStreamingDestinationInput {
                                    KinesisStreamingDestinationInput::KinesisStreamingDestinationInput {
                                        TableName: Default::default(),
                                        StreamArn: Default::default(),
                                        EnableKinesisStreamingConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<KinesisStreamingDestinationInput>
                                for KinesisStreamingDestinationInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1950,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KinesisStreamingDestinationOutput {
                                KinesisStreamingDestinationOutput {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    StreamArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    DestinationStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DestinationStatus>>>,
                                    EnableKinesisStreamingConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>>
                                }
                            }

                            impl KinesisStreamingDestinationOutput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KinesisStreamingDestinationOutput::KinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field StreamArn
                                pub fn StreamArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KinesisStreamingDestinationOutput::KinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => StreamArn,
                                    }
                                }
                                /// Returns a borrow of the field DestinationStatus
                                pub fn DestinationStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DestinationStatus>>> {
                                    match self {
                                        KinesisStreamingDestinationOutput::KinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => DestinationStatus,
                                    }
                                }
                                /// Returns a borrow of the field EnableKinesisStreamingConfiguration
                                pub fn EnableKinesisStreamingConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::EnableKinesisStreamingConfiguration>>> {
                                    match self {
                                        KinesisStreamingDestinationOutput::KinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => EnableKinesisStreamingConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for KinesisStreamingDestinationOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KinesisStreamingDestinationOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KinesisStreamingDestinationOutput::KinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.KinesisStreamingDestinationOutput.KinesisStreamingDestinationOutput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DestinationStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EnableKinesisStreamingConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for KinesisStreamingDestinationOutput {}

                            impl Hash
                                for KinesisStreamingDestinationOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KinesisStreamingDestinationOutput::KinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, EnableKinesisStreamingConfiguration, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(StreamArn, _state);
                                            Hash::hash(DestinationStatus, _state);
                                            Hash::hash(EnableKinesisStreamingConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for KinesisStreamingDestinationOutput {
                                fn default() -> KinesisStreamingDestinationOutput {
                                    KinesisStreamingDestinationOutput::KinesisStreamingDestinationOutput {
                                        TableName: Default::default(),
                                        StreamArn: Default::default(),
                                        DestinationStatus: Default::default(),
                                        EnableKinesisStreamingConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<KinesisStreamingDestinationOutput>
                                for KinesisStreamingDestinationOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1959,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListBackupsInput {
                                ListBackupsInput {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupsInputLimit>>,
                                    TimeRangeLowerBound: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TimeRangeUpperBound: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExclusiveStartBackupArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    BackupType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupTypeFilter>>>
                                }
                            }

                            impl ListBackupsInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListBackupsInput::ListBackupsInput{TableName, Limit, TimeRangeLowerBound, TimeRangeUpperBound, ExclusiveStartBackupArn, BackupType, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupsInputLimit>> {
                                    match self {
                                        ListBackupsInput::ListBackupsInput{TableName, Limit, TimeRangeLowerBound, TimeRangeUpperBound, ExclusiveStartBackupArn, BackupType, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field TimeRangeLowerBound
                                pub fn TimeRangeLowerBound(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListBackupsInput::ListBackupsInput{TableName, Limit, TimeRangeLowerBound, TimeRangeUpperBound, ExclusiveStartBackupArn, BackupType, } => TimeRangeLowerBound,
                                    }
                                }
                                /// Returns a borrow of the field TimeRangeUpperBound
                                pub fn TimeRangeUpperBound(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListBackupsInput::ListBackupsInput{TableName, Limit, TimeRangeLowerBound, TimeRangeUpperBound, ExclusiveStartBackupArn, BackupType, } => TimeRangeUpperBound,
                                    }
                                }
                                /// Returns a borrow of the field ExclusiveStartBackupArn
                                pub fn ExclusiveStartBackupArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListBackupsInput::ListBackupsInput{TableName, Limit, TimeRangeLowerBound, TimeRangeUpperBound, ExclusiveStartBackupArn, BackupType, } => ExclusiveStartBackupArn,
                                    }
                                }
                                /// Returns a borrow of the field BackupType
                                pub fn BackupType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupTypeFilter>>> {
                                    match self {
                                        ListBackupsInput::ListBackupsInput{TableName, Limit, TimeRangeLowerBound, TimeRangeUpperBound, ExclusiveStartBackupArn, BackupType, } => BackupType,
                                    }
                                }
                            }

                            impl Debug
                                for ListBackupsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListBackupsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListBackupsInput::ListBackupsInput{TableName, Limit, TimeRangeLowerBound, TimeRangeUpperBound, ExclusiveStartBackupArn, BackupType, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListBackupsInput.ListBackupsInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TimeRangeLowerBound, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TimeRangeUpperBound, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExclusiveStartBackupArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupType, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListBackupsInput {}

                            impl Hash
                                for ListBackupsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListBackupsInput::ListBackupsInput{TableName, Limit, TimeRangeLowerBound, TimeRangeUpperBound, ExclusiveStartBackupArn, BackupType, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(Limit, _state);
                                            Hash::hash(TimeRangeLowerBound, _state);
                                            Hash::hash(TimeRangeUpperBound, _state);
                                            Hash::hash(ExclusiveStartBackupArn, _state);
                                            Hash::hash(BackupType, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListBackupsInput {
                                fn default() -> ListBackupsInput {
                                    ListBackupsInput::ListBackupsInput {
                                        TableName: Default::default(),
                                        Limit: Default::default(),
                                        TimeRangeLowerBound: Default::default(),
                                        TimeRangeUpperBound: Default::default(),
                                        ExclusiveStartBackupArn: Default::default(),
                                        BackupType: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListBackupsInput>
                                for ListBackupsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1967,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListBackupsOutput {
                                ListBackupsOutput {
                                    BackupSummaries: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupSummary>>>>,
                                    LastEvaluatedBackupArn: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListBackupsOutput {
                                /// Returns a borrow of the field BackupSummaries
                                pub fn BackupSummaries(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BackupSummary>>>> {
                                    match self {
                                        ListBackupsOutput::ListBackupsOutput{BackupSummaries, LastEvaluatedBackupArn, } => BackupSummaries,
                                    }
                                }
                                /// Returns a borrow of the field LastEvaluatedBackupArn
                                pub fn LastEvaluatedBackupArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListBackupsOutput::ListBackupsOutput{BackupSummaries, LastEvaluatedBackupArn, } => LastEvaluatedBackupArn,
                                    }
                                }
                            }

                            impl Debug
                                for ListBackupsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListBackupsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListBackupsOutput::ListBackupsOutput{BackupSummaries, LastEvaluatedBackupArn, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListBackupsOutput.ListBackupsOutput(")?;
                                            DafnyPrint::fmt_print(BackupSummaries, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastEvaluatedBackupArn, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListBackupsOutput {}

                            impl Hash
                                for ListBackupsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListBackupsOutput::ListBackupsOutput{BackupSummaries, LastEvaluatedBackupArn, } => {
                                            Hash::hash(BackupSummaries, _state);
                                            Hash::hash(LastEvaluatedBackupArn, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListBackupsOutput {
                                fn default() -> ListBackupsOutput {
                                    ListBackupsOutput::ListBackupsOutput {
                                        BackupSummaries: Default::default(),
                                        LastEvaluatedBackupArn: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListBackupsOutput>
                                for ListBackupsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1971,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListContributorInsightsInput {
                                ListContributorInsightsInput {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    NextToken: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    MaxResults: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListContributorInsightsLimit>>
                                }
                            }

                            impl ListContributorInsightsInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListContributorInsightsInput::ListContributorInsightsInput{TableName, NextToken, MaxResults, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field NextToken
                                pub fn NextToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListContributorInsightsInput::ListContributorInsightsInput{TableName, NextToken, MaxResults, } => NextToken,
                                    }
                                }
                                /// Returns a borrow of the field MaxResults
                                pub fn MaxResults(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListContributorInsightsLimit>> {
                                    match self {
                                        ListContributorInsightsInput::ListContributorInsightsInput{TableName, NextToken, MaxResults, } => MaxResults,
                                    }
                                }
                            }

                            impl Debug
                                for ListContributorInsightsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListContributorInsightsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListContributorInsightsInput::ListContributorInsightsInput{TableName, NextToken, MaxResults, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListContributorInsightsInput.ListContributorInsightsInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MaxResults, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListContributorInsightsInput {}

                            impl Hash
                                for ListContributorInsightsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListContributorInsightsInput::ListContributorInsightsInput{TableName, NextToken, MaxResults, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(NextToken, _state);
                                            Hash::hash(MaxResults, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListContributorInsightsInput {
                                fn default() -> ListContributorInsightsInput {
                                    ListContributorInsightsInput::ListContributorInsightsInput {
                                        TableName: Default::default(),
                                        NextToken: Default::default(),
                                        MaxResults: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListContributorInsightsInput>
                                for ListContributorInsightsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1976,3)
                            pub type ListContributorInsightsLimit = i32;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1980,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListContributorInsightsOutput {
                                ListContributorInsightsOutput {
                                    ContributorInsightsSummaries: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContributorInsightsSummary>>>>,
                                    NextToken: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListContributorInsightsOutput {
                                /// Returns a borrow of the field ContributorInsightsSummaries
                                pub fn ContributorInsightsSummaries(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContributorInsightsSummary>>>> {
                                    match self {
                                        ListContributorInsightsOutput::ListContributorInsightsOutput{ContributorInsightsSummaries, NextToken, } => ContributorInsightsSummaries,
                                    }
                                }
                                /// Returns a borrow of the field NextToken
                                pub fn NextToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListContributorInsightsOutput::ListContributorInsightsOutput{ContributorInsightsSummaries, NextToken, } => NextToken,
                                    }
                                }
                            }

                            impl Debug
                                for ListContributorInsightsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListContributorInsightsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListContributorInsightsOutput::ListContributorInsightsOutput{ContributorInsightsSummaries, NextToken, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListContributorInsightsOutput.ListContributorInsightsOutput(")?;
                                            DafnyPrint::fmt_print(ContributorInsightsSummaries, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextToken, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListContributorInsightsOutput {}

                            impl Hash
                                for ListContributorInsightsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListContributorInsightsOutput::ListContributorInsightsOutput{ContributorInsightsSummaries, NextToken, } => {
                                            Hash::hash(ContributorInsightsSummaries, _state);
                                            Hash::hash(NextToken, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListContributorInsightsOutput {
                                fn default() -> ListContributorInsightsOutput {
                                    ListContributorInsightsOutput::ListContributorInsightsOutput {
                                        ContributorInsightsSummaries: Default::default(),
                                        NextToken: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListContributorInsightsOutput>
                                for ListContributorInsightsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1984,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListExportsInput {
                                ListExportsInput {
                                    TableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    MaxResults: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListExportsMaxLimit>>,
                                    NextToken: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListExportsInput {
                                /// Returns a borrow of the field TableArn
                                pub fn TableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListExportsInput::ListExportsInput{TableArn, MaxResults, NextToken, } => TableArn,
                                    }
                                }
                                /// Returns a borrow of the field MaxResults
                                pub fn MaxResults(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListExportsMaxLimit>> {
                                    match self {
                                        ListExportsInput::ListExportsInput{TableArn, MaxResults, NextToken, } => MaxResults,
                                    }
                                }
                                /// Returns a borrow of the field NextToken
                                pub fn NextToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListExportsInput::ListExportsInput{TableArn, MaxResults, NextToken, } => NextToken,
                                    }
                                }
                            }

                            impl Debug
                                for ListExportsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListExportsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListExportsInput::ListExportsInput{TableArn, MaxResults, NextToken, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListExportsInput.ListExportsInput(")?;
                                            DafnyPrint::fmt_print(TableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MaxResults, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextToken, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListExportsInput {}

                            impl Hash
                                for ListExportsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListExportsInput::ListExportsInput{TableArn, MaxResults, NextToken, } => {
                                            Hash::hash(TableArn, _state);
                                            Hash::hash(MaxResults, _state);
                                            Hash::hash(NextToken, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListExportsInput {
                                fn default() -> ListExportsInput {
                                    ListExportsInput::ListExportsInput {
                                        TableArn: Default::default(),
                                        MaxResults: Default::default(),
                                        NextToken: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListExportsInput>
                                for ListExportsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1989,3)
                            pub type ListExportsMaxLimit = i32;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1993,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListExportsOutput {
                                ListExportsOutput {
                                    ExportSummaries: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportSummary>>>>,
                                    NextToken: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListExportsOutput {
                                /// Returns a borrow of the field ExportSummaries
                                pub fn ExportSummaries(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExportSummary>>>> {
                                    match self {
                                        ListExportsOutput::ListExportsOutput{ExportSummaries, NextToken, } => ExportSummaries,
                                    }
                                }
                                /// Returns a borrow of the field NextToken
                                pub fn NextToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListExportsOutput::ListExportsOutput{ExportSummaries, NextToken, } => NextToken,
                                    }
                                }
                            }

                            impl Debug
                                for ListExportsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListExportsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListExportsOutput::ListExportsOutput{ExportSummaries, NextToken, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListExportsOutput.ListExportsOutput(")?;
                                            DafnyPrint::fmt_print(ExportSummaries, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextToken, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListExportsOutput {}

                            impl Hash
                                for ListExportsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListExportsOutput::ListExportsOutput{ExportSummaries, NextToken, } => {
                                            Hash::hash(ExportSummaries, _state);
                                            Hash::hash(NextToken, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListExportsOutput {
                                fn default() -> ListExportsOutput {
                                    ListExportsOutput::ListExportsOutput {
                                        ExportSummaries: Default::default(),
                                        NextToken: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListExportsOutput>
                                for ListExportsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(1997,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListGlobalTablesInput {
                                ListGlobalTablesInput {
                                    ExclusiveStartGlobalTableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveIntegerObject>>,
                                    RegionName: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListGlobalTablesInput {
                                /// Returns a borrow of the field ExclusiveStartGlobalTableName
                                pub fn ExclusiveStartGlobalTableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListGlobalTablesInput::ListGlobalTablesInput{ExclusiveStartGlobalTableName, Limit, RegionName, } => ExclusiveStartGlobalTableName,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveIntegerObject>> {
                                    match self {
                                        ListGlobalTablesInput::ListGlobalTablesInput{ExclusiveStartGlobalTableName, Limit, RegionName, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListGlobalTablesInput::ListGlobalTablesInput{ExclusiveStartGlobalTableName, Limit, RegionName, } => RegionName,
                                    }
                                }
                            }

                            impl Debug
                                for ListGlobalTablesInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListGlobalTablesInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListGlobalTablesInput::ListGlobalTablesInput{ExclusiveStartGlobalTableName, Limit, RegionName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListGlobalTablesInput.ListGlobalTablesInput(")?;
                                            DafnyPrint::fmt_print(ExclusiveStartGlobalTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListGlobalTablesInput {}

                            impl Hash
                                for ListGlobalTablesInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListGlobalTablesInput::ListGlobalTablesInput{ExclusiveStartGlobalTableName, Limit, RegionName, } => {
                                            Hash::hash(ExclusiveStartGlobalTableName, _state);
                                            Hash::hash(Limit, _state);
                                            Hash::hash(RegionName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListGlobalTablesInput {
                                fn default() -> ListGlobalTablesInput {
                                    ListGlobalTablesInput::ListGlobalTablesInput {
                                        ExclusiveStartGlobalTableName: Default::default(),
                                        Limit: Default::default(),
                                        RegionName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListGlobalTablesInput>
                                for ListGlobalTablesInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2002,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListGlobalTablesOutput {
                                ListGlobalTablesOutput {
                                    GlobalTables: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTable>>>>,
                                    LastEvaluatedGlobalTableName: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListGlobalTablesOutput {
                                /// Returns a borrow of the field GlobalTables
                                pub fn GlobalTables(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTable>>>> {
                                    match self {
                                        ListGlobalTablesOutput::ListGlobalTablesOutput{GlobalTables, LastEvaluatedGlobalTableName, } => GlobalTables,
                                    }
                                }
                                /// Returns a borrow of the field LastEvaluatedGlobalTableName
                                pub fn LastEvaluatedGlobalTableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListGlobalTablesOutput::ListGlobalTablesOutput{GlobalTables, LastEvaluatedGlobalTableName, } => LastEvaluatedGlobalTableName,
                                    }
                                }
                            }

                            impl Debug
                                for ListGlobalTablesOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListGlobalTablesOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListGlobalTablesOutput::ListGlobalTablesOutput{GlobalTables, LastEvaluatedGlobalTableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListGlobalTablesOutput.ListGlobalTablesOutput(")?;
                                            DafnyPrint::fmt_print(GlobalTables, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastEvaluatedGlobalTableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListGlobalTablesOutput {}

                            impl Hash
                                for ListGlobalTablesOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListGlobalTablesOutput::ListGlobalTablesOutput{GlobalTables, LastEvaluatedGlobalTableName, } => {
                                            Hash::hash(GlobalTables, _state);
                                            Hash::hash(LastEvaluatedGlobalTableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListGlobalTablesOutput {
                                fn default() -> ListGlobalTablesOutput {
                                    ListGlobalTablesOutput::ListGlobalTablesOutput {
                                        GlobalTables: Default::default(),
                                        LastEvaluatedGlobalTableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListGlobalTablesOutput>
                                for ListGlobalTablesOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2006,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListImportsInput {
                                ListImportsInput {
                                    TableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    PageSize: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListImportsMaxLimit>>,
                                    NextToken: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListImportsInput {
                                /// Returns a borrow of the field TableArn
                                pub fn TableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListImportsInput::ListImportsInput{TableArn, PageSize, NextToken, } => TableArn,
                                    }
                                }
                                /// Returns a borrow of the field PageSize
                                pub fn PageSize(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListImportsMaxLimit>> {
                                    match self {
                                        ListImportsInput::ListImportsInput{TableArn, PageSize, NextToken, } => PageSize,
                                    }
                                }
                                /// Returns a borrow of the field NextToken
                                pub fn NextToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListImportsInput::ListImportsInput{TableArn, PageSize, NextToken, } => NextToken,
                                    }
                                }
                            }

                            impl Debug
                                for ListImportsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListImportsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListImportsInput::ListImportsInput{TableArn, PageSize, NextToken, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListImportsInput.ListImportsInput(")?;
                                            DafnyPrint::fmt_print(TableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PageSize, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextToken, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListImportsInput {}

                            impl Hash
                                for ListImportsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListImportsInput::ListImportsInput{TableArn, PageSize, NextToken, } => {
                                            Hash::hash(TableArn, _state);
                                            Hash::hash(PageSize, _state);
                                            Hash::hash(NextToken, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListImportsInput {
                                fn default() -> ListImportsInput {
                                    ListImportsInput::ListImportsInput {
                                        TableArn: Default::default(),
                                        PageSize: Default::default(),
                                        NextToken: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListImportsInput>
                                for ListImportsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2011,3)
                            pub type ListImportsMaxLimit = i32;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2015,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListImportsOutput {
                                ListImportsOutput {
                                    ImportSummaryList: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportSummary>>>>,
                                    NextToken: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListImportsOutput {
                                /// Returns a borrow of the field ImportSummaryList
                                pub fn ImportSummaryList(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ImportSummary>>>> {
                                    match self {
                                        ListImportsOutput::ListImportsOutput{ImportSummaryList, NextToken, } => ImportSummaryList,
                                    }
                                }
                                /// Returns a borrow of the field NextToken
                                pub fn NextToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListImportsOutput::ListImportsOutput{ImportSummaryList, NextToken, } => NextToken,
                                    }
                                }
                            }

                            impl Debug
                                for ListImportsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListImportsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListImportsOutput::ListImportsOutput{ImportSummaryList, NextToken, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListImportsOutput.ListImportsOutput(")?;
                                            DafnyPrint::fmt_print(ImportSummaryList, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextToken, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListImportsOutput {}

                            impl Hash
                                for ListImportsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListImportsOutput::ListImportsOutput{ImportSummaryList, NextToken, } => {
                                            Hash::hash(ImportSummaryList, _state);
                                            Hash::hash(NextToken, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListImportsOutput {
                                fn default() -> ListImportsOutput {
                                    ListImportsOutput::ListImportsOutput {
                                        ImportSummaryList: Default::default(),
                                        NextToken: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListImportsOutput>
                                for ListImportsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2019,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListTablesInput {
                                ListTablesInput {
                                    ExclusiveStartTableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListTablesInputLimit>>
                                }
                            }

                            impl ListTablesInput {
                                /// Returns a borrow of the field ExclusiveStartTableName
                                pub fn ExclusiveStartTableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListTablesInput::ListTablesInput{ExclusiveStartTableName, Limit, } => ExclusiveStartTableName,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ListTablesInputLimit>> {
                                    match self {
                                        ListTablesInput::ListTablesInput{ExclusiveStartTableName, Limit, } => Limit,
                                    }
                                }
                            }

                            impl Debug
                                for ListTablesInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListTablesInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListTablesInput::ListTablesInput{ExclusiveStartTableName, Limit, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTablesInput.ListTablesInput(")?;
                                            DafnyPrint::fmt_print(ExclusiveStartTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListTablesInput {}

                            impl Hash
                                for ListTablesInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListTablesInput::ListTablesInput{ExclusiveStartTableName, Limit, } => {
                                            Hash::hash(ExclusiveStartTableName, _state);
                                            Hash::hash(Limit, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListTablesInput {
                                fn default() -> ListTablesInput {
                                    ListTablesInput::ListTablesInput {
                                        ExclusiveStartTableName: Default::default(),
                                        Limit: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListTablesInput>
                                for ListTablesInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2023,3)
                            pub type ListTablesInputLimit = i32;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2027,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListTablesOutput {
                                ListTablesOutput {
                                    TableNames: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>,
                                    LastEvaluatedTableName: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListTablesOutput {
                                /// Returns a borrow of the field TableNames
                                pub fn TableNames(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        ListTablesOutput::ListTablesOutput{TableNames, LastEvaluatedTableName, } => TableNames,
                                    }
                                }
                                /// Returns a borrow of the field LastEvaluatedTableName
                                pub fn LastEvaluatedTableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListTablesOutput::ListTablesOutput{TableNames, LastEvaluatedTableName, } => LastEvaluatedTableName,
                                    }
                                }
                            }

                            impl Debug
                                for ListTablesOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListTablesOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListTablesOutput::ListTablesOutput{TableNames, LastEvaluatedTableName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTablesOutput.ListTablesOutput(")?;
                                            DafnyPrint::fmt_print(TableNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastEvaluatedTableName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListTablesOutput {}

                            impl Hash
                                for ListTablesOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListTablesOutput::ListTablesOutput{TableNames, LastEvaluatedTableName, } => {
                                            Hash::hash(TableNames, _state);
                                            Hash::hash(LastEvaluatedTableName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListTablesOutput {
                                fn default() -> ListTablesOutput {
                                    ListTablesOutput::ListTablesOutput {
                                        TableNames: Default::default(),
                                        LastEvaluatedTableName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListTablesOutput>
                                for ListTablesOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2031,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListTagsOfResourceInput {
                                ListTagsOfResourceInput {
                                    ResourceArn: Sequence<DafnyCharUTF16>,
                                    NextToken: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListTagsOfResourceInput {
                                /// Returns a borrow of the field ResourceArn
                                pub fn ResourceArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ListTagsOfResourceInput::ListTagsOfResourceInput{ResourceArn, NextToken, } => ResourceArn,
                                    }
                                }
                                /// Returns a borrow of the field NextToken
                                pub fn NextToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListTagsOfResourceInput::ListTagsOfResourceInput{ResourceArn, NextToken, } => NextToken,
                                    }
                                }
                            }

                            impl Debug
                                for ListTagsOfResourceInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListTagsOfResourceInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListTagsOfResourceInput::ListTagsOfResourceInput{ResourceArn, NextToken, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTagsOfResourceInput.ListTagsOfResourceInput(")?;
                                            DafnyPrint::fmt_print(ResourceArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextToken, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListTagsOfResourceInput {}

                            impl Hash
                                for ListTagsOfResourceInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListTagsOfResourceInput::ListTagsOfResourceInput{ResourceArn, NextToken, } => {
                                            Hash::hash(ResourceArn, _state);
                                            Hash::hash(NextToken, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListTagsOfResourceInput {
                                fn default() -> ListTagsOfResourceInput {
                                    ListTagsOfResourceInput::ListTagsOfResourceInput {
                                        ResourceArn: Default::default(),
                                        NextToken: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListTagsOfResourceInput>
                                for ListTagsOfResourceInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2035,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListTagsOfResourceOutput {
                                ListTagsOfResourceOutput {
                                    Tags: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Tag>>>>,
                                    NextToken: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListTagsOfResourceOutput {
                                /// Returns a borrow of the field Tags
                                pub fn Tags(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Tag>>>> {
                                    match self {
                                        ListTagsOfResourceOutput::ListTagsOfResourceOutput{Tags, NextToken, } => Tags,
                                    }
                                }
                                /// Returns a borrow of the field NextToken
                                pub fn NextToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListTagsOfResourceOutput::ListTagsOfResourceOutput{Tags, NextToken, } => NextToken,
                                    }
                                }
                            }

                            impl Debug
                                for ListTagsOfResourceOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListTagsOfResourceOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListTagsOfResourceOutput::ListTagsOfResourceOutput{Tags, NextToken, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTagsOfResourceOutput.ListTagsOfResourceOutput(")?;
                                            DafnyPrint::fmt_print(Tags, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextToken, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListTagsOfResourceOutput {}

                            impl Hash
                                for ListTagsOfResourceOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListTagsOfResourceOutput::ListTagsOfResourceOutput{Tags, NextToken, } => {
                                            Hash::hash(Tags, _state);
                                            Hash::hash(NextToken, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListTagsOfResourceOutput {
                                fn default() -> ListTagsOfResourceOutput {
                                    ListTagsOfResourceOutput::ListTagsOfResourceOutput {
                                        Tags: Default::default(),
                                        NextToken: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListTagsOfResourceOutput>
                                for ListTagsOfResourceOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2039,3)
                            #[derive(PartialEq, Clone)]
                            pub enum LocalSecondaryIndex {
                                LocalSecondaryIndex {
                                    IndexName: Sequence<DafnyCharUTF16>,
                                    KeySchema: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema,
                                    Projection: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>
                                }
                            }

                            impl LocalSecondaryIndex {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        LocalSecondaryIndex::LocalSecondaryIndex{IndexName, KeySchema, Projection, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema {
                                    match self {
                                        LocalSecondaryIndex::LocalSecondaryIndex{IndexName, KeySchema, Projection, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field Projection
                                pub fn Projection(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection> {
                                    match self {
                                        LocalSecondaryIndex::LocalSecondaryIndex{IndexName, KeySchema, Projection, } => Projection,
                                    }
                                }
                            }

                            impl Debug
                                for LocalSecondaryIndex {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for LocalSecondaryIndex {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        LocalSecondaryIndex::LocalSecondaryIndex{IndexName, KeySchema, Projection, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndex.LocalSecondaryIndex(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Projection, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for LocalSecondaryIndex {}

                            impl Hash
                                for LocalSecondaryIndex {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        LocalSecondaryIndex::LocalSecondaryIndex{IndexName, KeySchema, Projection, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(Projection, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for LocalSecondaryIndex {
                                fn default() -> LocalSecondaryIndex {
                                    LocalSecondaryIndex::LocalSecondaryIndex {
                                        IndexName: Default::default(),
                                        KeySchema: Default::default(),
                                        Projection: Default::default()
                                    }
                                }
                            }

                            impl AsRef<LocalSecondaryIndex>
                                for LocalSecondaryIndex {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2044,3)
                            #[derive(PartialEq, Clone)]
                            pub enum LocalSecondaryIndexDescription {
                                LocalSecondaryIndexDescription {
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeySchema: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema>>,
                                    Projection: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>>>,
                                    IndexSizeBytes: Arc<Option<i64>>,
                                    ItemCount: Arc<Option<i64>>,
                                    IndexArn: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl LocalSecondaryIndexDescription {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema>> {
                                    match self {
                                        LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field Projection
                                pub fn Projection(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>>> {
                                    match self {
                                        LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => Projection,
                                    }
                                }
                                /// Returns a borrow of the field IndexSizeBytes
                                pub fn IndexSizeBytes(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => IndexSizeBytes,
                                    }
                                }
                                /// Returns a borrow of the field ItemCount
                                pub fn ItemCount(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => ItemCount,
                                    }
                                }
                                /// Returns a borrow of the field IndexArn
                                pub fn IndexArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => IndexArn,
                                    }
                                }
                            }

                            impl Debug
                                for LocalSecondaryIndexDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for LocalSecondaryIndexDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndexDescription.LocalSecondaryIndexDescription(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Projection, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexSizeBytes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ItemCount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexArn, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for LocalSecondaryIndexDescription {}

                            impl Hash
                                for LocalSecondaryIndexDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        LocalSecondaryIndexDescription::LocalSecondaryIndexDescription{IndexName, KeySchema, Projection, IndexSizeBytes, ItemCount, IndexArn, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(Projection, _state);
                                            Hash::hash(IndexSizeBytes, _state);
                                            Hash::hash(ItemCount, _state);
                                            Hash::hash(IndexArn, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for LocalSecondaryIndexDescription {
                                fn default() -> LocalSecondaryIndexDescription {
                                    LocalSecondaryIndexDescription::LocalSecondaryIndexDescription {
                                        IndexName: Default::default(),
                                        KeySchema: Default::default(),
                                        Projection: Default::default(),
                                        IndexSizeBytes: Default::default(),
                                        ItemCount: Default::default(),
                                        IndexArn: Default::default()
                                    }
                                }
                            }

                            impl AsRef<LocalSecondaryIndexDescription>
                                for LocalSecondaryIndexDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2054,3)
                            #[derive(PartialEq, Clone)]
                            pub enum LocalSecondaryIndexInfo {
                                LocalSecondaryIndexInfo {
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeySchema: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema>>,
                                    Projection: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>>>
                                }
                            }

                            impl LocalSecondaryIndexInfo {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        LocalSecondaryIndexInfo::LocalSecondaryIndexInfo{IndexName, KeySchema, Projection, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema>> {
                                    match self {
                                        LocalSecondaryIndexInfo::LocalSecondaryIndexInfo{IndexName, KeySchema, Projection, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field Projection
                                pub fn Projection(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Projection>>> {
                                    match self {
                                        LocalSecondaryIndexInfo::LocalSecondaryIndexInfo{IndexName, KeySchema, Projection, } => Projection,
                                    }
                                }
                            }

                            impl Debug
                                for LocalSecondaryIndexInfo {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for LocalSecondaryIndexInfo {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        LocalSecondaryIndexInfo::LocalSecondaryIndexInfo{IndexName, KeySchema, Projection, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndexInfo.LocalSecondaryIndexInfo(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Projection, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for LocalSecondaryIndexInfo {}

                            impl Hash
                                for LocalSecondaryIndexInfo {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        LocalSecondaryIndexInfo::LocalSecondaryIndexInfo{IndexName, KeySchema, Projection, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(Projection, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for LocalSecondaryIndexInfo {
                                fn default() -> LocalSecondaryIndexInfo {
                                    LocalSecondaryIndexInfo::LocalSecondaryIndexInfo {
                                        IndexName: Default::default(),
                                        KeySchema: Default::default(),
                                        Projection: Default::default()
                                    }
                                }
                            }

                            impl AsRef<LocalSecondaryIndexInfo>
                                for LocalSecondaryIndexInfo {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2064,3)
                            pub type NonKeyAttributeName = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2068,3)
                            pub type NonKeyAttributeNameList = Sequence<Sequence<DafnyCharUTF16>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2072,3)
                            pub type NonNegativeLongObject = i64;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2079,3)
                            #[derive(PartialEq, Clone)]
                            pub enum OnDemandThroughput {
                                OnDemandThroughput {
                                    MaxReadRequestUnits: Arc<Option<i64>>,
                                    MaxWriteRequestUnits: Arc<Option<i64>>
                                }
                            }

                            impl OnDemandThroughput {
                                /// Returns a borrow of the field MaxReadRequestUnits
                                pub fn MaxReadRequestUnits(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        OnDemandThroughput::OnDemandThroughput{MaxReadRequestUnits, MaxWriteRequestUnits, } => MaxReadRequestUnits,
                                    }
                                }
                                /// Returns a borrow of the field MaxWriteRequestUnits
                                pub fn MaxWriteRequestUnits(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        OnDemandThroughput::OnDemandThroughput{MaxReadRequestUnits, MaxWriteRequestUnits, } => MaxWriteRequestUnits,
                                    }
                                }
                            }

                            impl Debug
                                for OnDemandThroughput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for OnDemandThroughput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        OnDemandThroughput::OnDemandThroughput{MaxReadRequestUnits, MaxWriteRequestUnits, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.OnDemandThroughput.OnDemandThroughput(")?;
                                            DafnyPrint::fmt_print(MaxReadRequestUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MaxWriteRequestUnits, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for OnDemandThroughput {}

                            impl Hash
                                for OnDemandThroughput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        OnDemandThroughput::OnDemandThroughput{MaxReadRequestUnits, MaxWriteRequestUnits, } => {
                                            Hash::hash(MaxReadRequestUnits, _state);
                                            Hash::hash(MaxWriteRequestUnits, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for OnDemandThroughput {
                                fn default() -> OnDemandThroughput {
                                    OnDemandThroughput::OnDemandThroughput {
                                        MaxReadRequestUnits: Default::default(),
                                        MaxWriteRequestUnits: Default::default()
                                    }
                                }
                            }

                            impl AsRef<OnDemandThroughput>
                                for OnDemandThroughput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2083,3)
                            #[derive(PartialEq, Clone)]
                            pub enum OnDemandThroughputOverride {
                                OnDemandThroughputOverride {
                                    MaxReadRequestUnits: Arc<Option<i64>>
                                }
                            }

                            impl OnDemandThroughputOverride {
                                /// Returns a borrow of the field MaxReadRequestUnits
                                pub fn MaxReadRequestUnits(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        OnDemandThroughputOverride::OnDemandThroughputOverride{MaxReadRequestUnits, } => MaxReadRequestUnits,
                                    }
                                }
                            }

                            impl Debug
                                for OnDemandThroughputOverride {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for OnDemandThroughputOverride {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        OnDemandThroughputOverride::OnDemandThroughputOverride{MaxReadRequestUnits, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.OnDemandThroughputOverride.OnDemandThroughputOverride(")?;
                                            DafnyPrint::fmt_print(MaxReadRequestUnits, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for OnDemandThroughputOverride {}

                            impl Hash
                                for OnDemandThroughputOverride {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        OnDemandThroughputOverride::OnDemandThroughputOverride{MaxReadRequestUnits, } => {
                                            Hash::hash(MaxReadRequestUnits, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for OnDemandThroughputOverride {
                                fn default() -> OnDemandThroughputOverride {
                                    OnDemandThroughputOverride::OnDemandThroughputOverride {
                                        MaxReadRequestUnits: Default::default()
                                    }
                                }
                            }

                            impl AsRef<OnDemandThroughputOverride>
                                for OnDemandThroughputOverride {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2086,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ParameterizedStatement {
                                ParameterizedStatement {
                                    Statement: Sequence<DafnyCharUTF16>,
                                    Parameters: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PreparedStatementParameters>>,
                                    ReturnValuesOnConditionCheckFailure: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>>
                                }
                            }

                            impl ParameterizedStatement {
                                /// Returns a borrow of the field Statement
                                pub fn Statement(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ParameterizedStatement::ParameterizedStatement{Statement, Parameters, ReturnValuesOnConditionCheckFailure, } => Statement,
                                    }
                                }
                                /// Returns a borrow of the field Parameters
                                pub fn Parameters(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PreparedStatementParameters>> {
                                    match self {
                                        ParameterizedStatement::ParameterizedStatement{Statement, Parameters, ReturnValuesOnConditionCheckFailure, } => Parameters,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure
                                pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>> {
                                    match self {
                                        ParameterizedStatement::ParameterizedStatement{Statement, Parameters, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure,
                                    }
                                }
                            }

                            impl Debug
                                for ParameterizedStatement {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ParameterizedStatement {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ParameterizedStatement::ParameterizedStatement{Statement, Parameters, ReturnValuesOnConditionCheckFailure, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ParameterizedStatement.ParameterizedStatement(")?;
                                            DafnyPrint::fmt_print(Statement, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Parameters, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ParameterizedStatement {}

                            impl Hash
                                for ParameterizedStatement {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ParameterizedStatement::ParameterizedStatement{Statement, Parameters, ReturnValuesOnConditionCheckFailure, } => {
                                            Hash::hash(Statement, _state);
                                            Hash::hash(Parameters, _state);
                                            Hash::hash(ReturnValuesOnConditionCheckFailure, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ParameterizedStatement {
                                fn default() -> ParameterizedStatement {
                                    ParameterizedStatement::ParameterizedStatement {
                                        Statement: Default::default(),
                                        Parameters: Default::default(),
                                        ReturnValuesOnConditionCheckFailure: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ParameterizedStatement>
                                for ParameterizedStatement {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2091,3)
                            pub type ParameterizedStatements = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ParameterizedStatement>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2095,3)
                            pub type PartiQLBatchRequest = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BatchStatementRequest>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2100,3)
                            pub type PartiQLNextToken = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2104,3)
                            pub type PartiQLStatement = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2108,3)
                            #[derive(PartialEq, Clone)]
                            pub enum PointInTimeRecoveryDescription {
                                PointInTimeRecoveryDescription {
                                    PointInTimeRecoveryStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PointInTimeRecoveryStatus>>>,
                                    EarliestRestorableDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    LatestRestorableDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl PointInTimeRecoveryDescription {
                                /// Returns a borrow of the field PointInTimeRecoveryStatus
                                pub fn PointInTimeRecoveryStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PointInTimeRecoveryStatus>>> {
                                    match self {
                                        PointInTimeRecoveryDescription::PointInTimeRecoveryDescription{PointInTimeRecoveryStatus, EarliestRestorableDateTime, LatestRestorableDateTime, } => PointInTimeRecoveryStatus,
                                    }
                                }
                                /// Returns a borrow of the field EarliestRestorableDateTime
                                pub fn EarliestRestorableDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        PointInTimeRecoveryDescription::PointInTimeRecoveryDescription{PointInTimeRecoveryStatus, EarliestRestorableDateTime, LatestRestorableDateTime, } => EarliestRestorableDateTime,
                                    }
                                }
                                /// Returns a borrow of the field LatestRestorableDateTime
                                pub fn LatestRestorableDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        PointInTimeRecoveryDescription::PointInTimeRecoveryDescription{PointInTimeRecoveryStatus, EarliestRestorableDateTime, LatestRestorableDateTime, } => LatestRestorableDateTime,
                                    }
                                }
                            }

                            impl Debug
                                for PointInTimeRecoveryDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for PointInTimeRecoveryDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        PointInTimeRecoveryDescription::PointInTimeRecoveryDescription{PointInTimeRecoveryStatus, EarliestRestorableDateTime, LatestRestorableDateTime, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoveryDescription.PointInTimeRecoveryDescription(")?;
                                            DafnyPrint::fmt_print(PointInTimeRecoveryStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EarliestRestorableDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LatestRestorableDateTime, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for PointInTimeRecoveryDescription {}

                            impl Hash
                                for PointInTimeRecoveryDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        PointInTimeRecoveryDescription::PointInTimeRecoveryDescription{PointInTimeRecoveryStatus, EarliestRestorableDateTime, LatestRestorableDateTime, } => {
                                            Hash::hash(PointInTimeRecoveryStatus, _state);
                                            Hash::hash(EarliestRestorableDateTime, _state);
                                            Hash::hash(LatestRestorableDateTime, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for PointInTimeRecoveryDescription {
                                fn default() -> PointInTimeRecoveryDescription {
                                    PointInTimeRecoveryDescription::PointInTimeRecoveryDescription {
                                        PointInTimeRecoveryStatus: Default::default(),
                                        EarliestRestorableDateTime: Default::default(),
                                        LatestRestorableDateTime: Default::default()
                                    }
                                }
                            }

                            impl AsRef<PointInTimeRecoveryDescription>
                                for PointInTimeRecoveryDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2113,3)
                            #[derive(PartialEq, Clone)]
                            pub enum PointInTimeRecoverySpecification {
                                PointInTimeRecoverySpecification {
                                    PointInTimeRecoveryEnabled: bool
                                }
                            }

                            impl PointInTimeRecoverySpecification {
                                /// Returns a borrow of the field PointInTimeRecoveryEnabled
                                pub fn PointInTimeRecoveryEnabled(&self) -> &bool {
                                    match self {
                                        PointInTimeRecoverySpecification::PointInTimeRecoverySpecification{PointInTimeRecoveryEnabled, } => PointInTimeRecoveryEnabled,
                                    }
                                }
                            }

                            impl Debug
                                for PointInTimeRecoverySpecification {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for PointInTimeRecoverySpecification {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        PointInTimeRecoverySpecification::PointInTimeRecoverySpecification{PointInTimeRecoveryEnabled, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoverySpecification.PointInTimeRecoverySpecification(")?;
                                            DafnyPrint::fmt_print(PointInTimeRecoveryEnabled, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for PointInTimeRecoverySpecification {}

                            impl Hash
                                for PointInTimeRecoverySpecification {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        PointInTimeRecoverySpecification::PointInTimeRecoverySpecification{PointInTimeRecoveryEnabled, } => {
                                            Hash::hash(PointInTimeRecoveryEnabled, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for PointInTimeRecoverySpecification {
                                fn default() -> PointInTimeRecoverySpecification {
                                    PointInTimeRecoverySpecification::PointInTimeRecoverySpecification {
                                        PointInTimeRecoveryEnabled: Default::default()
                                    }
                                }
                            }

                            impl AsRef<PointInTimeRecoverySpecification>
                                for PointInTimeRecoverySpecification {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2116,3)
                            #[derive(PartialEq, Clone)]
                            pub enum PointInTimeRecoveryStatus {
                                ENABLED {},
                                DISABLED {}
                            }

                            impl PointInTimeRecoveryStatus {}

                            impl Debug
                                for PointInTimeRecoveryStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for PointInTimeRecoveryStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        PointInTimeRecoveryStatus::ENABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoveryStatus.ENABLED")?;
                                            Ok(())
                                        },
                                        PointInTimeRecoveryStatus::DISABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoveryStatus.DISABLED")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl PointInTimeRecoveryStatus {
                                /// Enumerates all possible values of PointInTimeRecoveryStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<PointInTimeRecoveryStatus>> {
                                    seq![Arc::new(PointInTimeRecoveryStatus::ENABLED {}), Arc::new(PointInTimeRecoveryStatus::DISABLED {})].iter()
                                }
                            }

                            impl Eq
                                for PointInTimeRecoveryStatus {}

                            impl Hash
                                for PointInTimeRecoveryStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        PointInTimeRecoveryStatus::ENABLED{} => {

                                        },
                                        PointInTimeRecoveryStatus::DISABLED{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for PointInTimeRecoveryStatus {
                                fn default() -> PointInTimeRecoveryStatus {
                                    PointInTimeRecoveryStatus::ENABLED {}
                                }
                            }

                            impl AsRef<PointInTimeRecoveryStatus>
                                for PointInTimeRecoveryStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2119,3)
                            pub type PolicyRevisionId = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2123,3)
                            pub type PositiveIntegerObject = i32;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2127,3)
                            pub type PositiveLongObject = i64;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2131,3)
                            pub type PreparedStatementParameters = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2135,3)
                            pub type ProcessedItemCount = i64;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2139,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Projection {
                                Projection {
                                    ProjectionType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProjectionType>>>,
                                    NonKeyAttributes: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::NonKeyAttributeNameList>>
                                }
                            }

                            impl Projection {
                                /// Returns a borrow of the field ProjectionType
                                pub fn ProjectionType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProjectionType>>> {
                                    match self {
                                        Projection::Projection{ProjectionType, NonKeyAttributes, } => ProjectionType,
                                    }
                                }
                                /// Returns a borrow of the field NonKeyAttributes
                                pub fn NonKeyAttributes(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::NonKeyAttributeNameList>> {
                                    match self {
                                        Projection::Projection{ProjectionType, NonKeyAttributes, } => NonKeyAttributes,
                                    }
                                }
                            }

                            impl Debug
                                for Projection {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Projection {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Projection::Projection{ProjectionType, NonKeyAttributes, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Projection.Projection(")?;
                                            DafnyPrint::fmt_print(ProjectionType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NonKeyAttributes, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Projection {}

                            impl Hash
                                for Projection {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Projection::Projection{ProjectionType, NonKeyAttributes, } => {
                                            Hash::hash(ProjectionType, _state);
                                            Hash::hash(NonKeyAttributes, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Projection {
                                fn default() -> Projection {
                                    Projection::Projection {
                                        ProjectionType: Default::default(),
                                        NonKeyAttributes: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Projection>
                                for Projection {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2144,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ProjectionType {
                                ALL {},
                                KEYS_ONLY {},
                                INCLUDE {}
                            }

                            impl ProjectionType {}

                            impl Debug
                                for ProjectionType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ProjectionType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ProjectionType::ALL{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProjectionType.ALL")?;
                                            Ok(())
                                        },
                                        ProjectionType::KEYS_ONLY{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProjectionType.KEYS__ONLY")?;
                                            Ok(())
                                        },
                                        ProjectionType::INCLUDE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProjectionType.INCLUDE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ProjectionType {
                                /// Enumerates all possible values of ProjectionType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ProjectionType>> {
                                    seq![Arc::new(ProjectionType::ALL {}), Arc::new(ProjectionType::KEYS_ONLY {}), Arc::new(ProjectionType::INCLUDE {})].iter()
                                }
                            }

                            impl Eq
                                for ProjectionType {}

                            impl Hash
                                for ProjectionType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ProjectionType::ALL{} => {

                                        },
                                        ProjectionType::KEYS_ONLY{} => {

                                        },
                                        ProjectionType::INCLUDE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ProjectionType {
                                fn default() -> ProjectionType {
                                    ProjectionType::ALL {}
                                }
                            }

                            impl AsRef<ProjectionType>
                                for ProjectionType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2148,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ProvisionedThroughput {
                                ProvisionedThroughput {
                                    ReadCapacityUnits: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject,
                                    WriteCapacityUnits: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject
                                }
                            }

                            impl ProvisionedThroughput {
                                /// Returns a borrow of the field ReadCapacityUnits
                                pub fn ReadCapacityUnits(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject {
                                    match self {
                                        ProvisionedThroughput::ProvisionedThroughput{ReadCapacityUnits, WriteCapacityUnits, } => ReadCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field WriteCapacityUnits
                                pub fn WriteCapacityUnits(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject {
                                    match self {
                                        ProvisionedThroughput::ProvisionedThroughput{ReadCapacityUnits, WriteCapacityUnits, } => WriteCapacityUnits,
                                    }
                                }
                            }

                            impl Debug
                                for ProvisionedThroughput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ProvisionedThroughput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ProvisionedThroughput::ProvisionedThroughput{ReadCapacityUnits, WriteCapacityUnits, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughput.ProvisionedThroughput(")?;
                                            DafnyPrint::fmt_print(ReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(WriteCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ProvisionedThroughput {}

                            impl Hash
                                for ProvisionedThroughput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ProvisionedThroughput::ProvisionedThroughput{ReadCapacityUnits, WriteCapacityUnits, } => {
                                            Hash::hash(ReadCapacityUnits, _state);
                                            Hash::hash(WriteCapacityUnits, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ProvisionedThroughput {
                                fn default() -> ProvisionedThroughput {
                                    ProvisionedThroughput::ProvisionedThroughput {
                                        ReadCapacityUnits: Default::default(),
                                        WriteCapacityUnits: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ProvisionedThroughput>
                                for ProvisionedThroughput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2152,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ProvisionedThroughputDescription {
                                ProvisionedThroughputDescription {
                                    LastIncreaseDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    LastDecreaseDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    NumberOfDecreasesToday: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    ReadCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::NonNegativeLongObject>>,
                                    WriteCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::NonNegativeLongObject>>
                                }
                            }

                            impl ProvisionedThroughputDescription {
                                /// Returns a borrow of the field LastIncreaseDateTime
                                pub fn LastIncreaseDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => LastIncreaseDateTime,
                                    }
                                }
                                /// Returns a borrow of the field LastDecreaseDateTime
                                pub fn LastDecreaseDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => LastDecreaseDateTime,
                                    }
                                }
                                /// Returns a borrow of the field NumberOfDecreasesToday
                                pub fn NumberOfDecreasesToday(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => NumberOfDecreasesToday,
                                    }
                                }
                                /// Returns a borrow of the field ReadCapacityUnits
                                pub fn ReadCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::NonNegativeLongObject>> {
                                    match self {
                                        ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => ReadCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field WriteCapacityUnits
                                pub fn WriteCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::NonNegativeLongObject>> {
                                    match self {
                                        ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => WriteCapacityUnits,
                                    }
                                }
                            }

                            impl Debug
                                for ProvisionedThroughputDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ProvisionedThroughputDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughputDescription.ProvisionedThroughputDescription(")?;
                                            DafnyPrint::fmt_print(LastIncreaseDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastDecreaseDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NumberOfDecreasesToday, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(WriteCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ProvisionedThroughputDescription {}

                            impl Hash
                                for ProvisionedThroughputDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ProvisionedThroughputDescription::ProvisionedThroughputDescription{LastIncreaseDateTime, LastDecreaseDateTime, NumberOfDecreasesToday, ReadCapacityUnits, WriteCapacityUnits, } => {
                                            Hash::hash(LastIncreaseDateTime, _state);
                                            Hash::hash(LastDecreaseDateTime, _state);
                                            Hash::hash(NumberOfDecreasesToday, _state);
                                            Hash::hash(ReadCapacityUnits, _state);
                                            Hash::hash(WriteCapacityUnits, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ProvisionedThroughputDescription {
                                fn default() -> ProvisionedThroughputDescription {
                                    ProvisionedThroughputDescription::ProvisionedThroughputDescription {
                                        LastIncreaseDateTime: Default::default(),
                                        LastDecreaseDateTime: Default::default(),
                                        NumberOfDecreasesToday: Default::default(),
                                        ReadCapacityUnits: Default::default(),
                                        WriteCapacityUnits: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ProvisionedThroughputDescription>
                                for ProvisionedThroughputDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2159,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ProvisionedThroughputOverride {
                                ProvisionedThroughputOverride {
                                    ReadCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>
                                }
                            }

                            impl ProvisionedThroughputOverride {
                                /// Returns a borrow of the field ReadCapacityUnits
                                pub fn ReadCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        ProvisionedThroughputOverride::ProvisionedThroughputOverride{ReadCapacityUnits, } => ReadCapacityUnits,
                                    }
                                }
                            }

                            impl Debug
                                for ProvisionedThroughputOverride {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ProvisionedThroughputOverride {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ProvisionedThroughputOverride::ProvisionedThroughputOverride{ReadCapacityUnits, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughputOverride.ProvisionedThroughputOverride(")?;
                                            DafnyPrint::fmt_print(ReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ProvisionedThroughputOverride {}

                            impl Hash
                                for ProvisionedThroughputOverride {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ProvisionedThroughputOverride::ProvisionedThroughputOverride{ReadCapacityUnits, } => {
                                            Hash::hash(ReadCapacityUnits, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ProvisionedThroughputOverride {
                                fn default() -> ProvisionedThroughputOverride {
                                    ProvisionedThroughputOverride::ProvisionedThroughputOverride {
                                        ReadCapacityUnits: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ProvisionedThroughputOverride>
                                for ProvisionedThroughputOverride {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2162,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Put {
                                Put {
                                    Item: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>,
                                    TableName: Sequence<DafnyCharUTF16>,
                                    ConditionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    ExpressionAttributeValues: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ReturnValuesOnConditionCheckFailure: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>>
                                }
                            }

                            impl Put {
                                /// Returns a borrow of the field Item
                                pub fn Item(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        Put::Put{Item, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Item,
                                    }
                                }
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Put::Put{Item, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field ConditionExpression
                                pub fn ConditionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        Put::Put{Item, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        Put::Put{Item, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeNames,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeValues
                                pub fn ExpressionAttributeValues(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        Put::Put{Item, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeValues,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure
                                pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>> {
                                    match self {
                                        Put::Put{Item, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure,
                                    }
                                }
                            }

                            impl Debug
                                for Put {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Put {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Put::Put{Item, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Put.Put(")?;
                                            DafnyPrint::fmt_print(Item, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Put {}

                            impl Hash
                                for Put {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Put::Put{Item, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            Hash::hash(Item, _state);
                                            Hash::hash(TableName, _state);
                                            Hash::hash(ConditionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state);
                                            Hash::hash(ExpressionAttributeValues, _state);
                                            Hash::hash(ReturnValuesOnConditionCheckFailure, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Put {
                                fn default() -> Put {
                                    Put::Put {
                                        Item: Default::default(),
                                        TableName: Default::default(),
                                        ConditionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default(),
                                        ExpressionAttributeValues: Default::default(),
                                        ReturnValuesOnConditionCheckFailure: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Put>
                                for Put {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2170,3)
                            #[derive(PartialEq, Clone)]
                            pub enum PutItemInput {
                                PutItemInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    Item: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>,
                                    Expected: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExpectedAttributeValue>>>>,
                                    ReturnValues: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue>>>,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>,
                                    ReturnItemCollectionMetrics: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics>>>,
                                    ConditionalOperator: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator>>>,
                                    ConditionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    ExpressionAttributeValues: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ReturnValuesOnConditionCheckFailure: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>>
                                }
                            }

                            impl PutItemInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field Item
                                pub fn Item(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Item,
                                    }
                                }
                                /// Returns a borrow of the field Expected
                                pub fn Expected(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExpectedAttributeValue>>>> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Expected,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValues
                                pub fn ReturnValues(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue>>> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValues,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ReturnItemCollectionMetrics
                                pub fn ReturnItemCollectionMetrics(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics>>> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnItemCollectionMetrics,
                                    }
                                }
                                /// Returns a borrow of the field ConditionalOperator
                                pub fn ConditionalOperator(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator>>> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionalOperator,
                                    }
                                }
                                /// Returns a borrow of the field ConditionExpression
                                pub fn ConditionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeNames,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeValues
                                pub fn ExpressionAttributeValues(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeValues,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure
                                pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>> {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure,
                                    }
                                }
                            }

                            impl Debug
                                for PutItemInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for PutItemInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemInput.PutItemInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Item, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Expected, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnItemCollectionMetrics, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionalOperator, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for PutItemInput {}

                            impl Hash
                                for PutItemInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        PutItemInput::PutItemInput{TableName, Item, Expected, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ConditionalOperator, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(Item, _state);
                                            Hash::hash(Expected, _state);
                                            Hash::hash(ReturnValues, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state);
                                            Hash::hash(ReturnItemCollectionMetrics, _state);
                                            Hash::hash(ConditionalOperator, _state);
                                            Hash::hash(ConditionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state);
                                            Hash::hash(ExpressionAttributeValues, _state);
                                            Hash::hash(ReturnValuesOnConditionCheckFailure, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for PutItemInput {
                                fn default() -> PutItemInput {
                                    PutItemInput::PutItemInput {
                                        TableName: Default::default(),
                                        Item: Default::default(),
                                        Expected: Default::default(),
                                        ReturnValues: Default::default(),
                                        ReturnConsumedCapacity: Default::default(),
                                        ReturnItemCollectionMetrics: Default::default(),
                                        ConditionalOperator: Default::default(),
                                        ConditionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default(),
                                        ExpressionAttributeValues: Default::default(),
                                        ReturnValuesOnConditionCheckFailure: Default::default()
                                    }
                                }
                            }

                            impl AsRef<PutItemInput>
                                for PutItemInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2184,3)
                            #[derive(PartialEq, Clone)]
                            pub enum PutItemOutput {
                                PutItemOutput {
                                    Attributes: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>,
                                    ItemCollectionMetrics: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics>>>
                                }
                            }

                            impl PutItemOutput {
                                /// Returns a borrow of the field Attributes
                                pub fn Attributes(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        PutItemOutput::PutItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => Attributes,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>> {
                                    match self {
                                        PutItemOutput::PutItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => ConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ItemCollectionMetrics
                                pub fn ItemCollectionMetrics(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics>>> {
                                    match self {
                                        PutItemOutput::PutItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => ItemCollectionMetrics,
                                    }
                                }
                            }

                            impl Debug
                                for PutItemOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for PutItemOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        PutItemOutput::PutItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemOutput.PutItemOutput(")?;
                                            DafnyPrint::fmt_print(Attributes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ItemCollectionMetrics, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for PutItemOutput {}

                            impl Hash
                                for PutItemOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        PutItemOutput::PutItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => {
                                            Hash::hash(Attributes, _state);
                                            Hash::hash(ConsumedCapacity, _state);
                                            Hash::hash(ItemCollectionMetrics, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for PutItemOutput {
                                fn default() -> PutItemOutput {
                                    PutItemOutput::PutItemOutput {
                                        Attributes: Default::default(),
                                        ConsumedCapacity: Default::default(),
                                        ItemCollectionMetrics: Default::default()
                                    }
                                }
                            }

                            impl AsRef<PutItemOutput>
                                for PutItemOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2189,3)
                            #[derive(PartialEq, Clone)]
                            pub enum PutRequest {
                                PutRequest {
                                    Item: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>
                                }
                            }

                            impl PutRequest {
                                /// Returns a borrow of the field Item
                                pub fn Item(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        PutRequest::PutRequest{Item, } => Item,
                                    }
                                }
                            }

                            impl Debug
                                for PutRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for PutRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        PutRequest::PutRequest{Item, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PutRequest.PutRequest(")?;
                                            DafnyPrint::fmt_print(Item, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for PutRequest {}

                            impl Hash
                                for PutRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        PutRequest::PutRequest{Item, } => {
                                            Hash::hash(Item, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for PutRequest {
                                fn default() -> PutRequest {
                                    PutRequest::PutRequest {
                                        Item: Default::default()
                                    }
                                }
                            }

                            impl AsRef<PutRequest>
                                for PutRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2192,3)
                            #[derive(PartialEq, Clone)]
                            pub enum PutResourcePolicyInput {
                                PutResourcePolicyInput {
                                    ResourceArn: Sequence<DafnyCharUTF16>,
                                    Policy: Sequence<DafnyCharUTF16>,
                                    ExpectedRevisionId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ConfirmRemoveSelfResourceAccess: Arc<Option<bool>>
                                }
                            }

                            impl PutResourcePolicyInput {
                                /// Returns a borrow of the field ResourceArn
                                pub fn ResourceArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        PutResourcePolicyInput::PutResourcePolicyInput{ResourceArn, Policy, ExpectedRevisionId, ConfirmRemoveSelfResourceAccess, } => ResourceArn,
                                    }
                                }
                                /// Returns a borrow of the field Policy
                                pub fn Policy(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        PutResourcePolicyInput::PutResourcePolicyInput{ResourceArn, Policy, ExpectedRevisionId, ConfirmRemoveSelfResourceAccess, } => Policy,
                                    }
                                }
                                /// Returns a borrow of the field ExpectedRevisionId
                                pub fn ExpectedRevisionId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        PutResourcePolicyInput::PutResourcePolicyInput{ResourceArn, Policy, ExpectedRevisionId, ConfirmRemoveSelfResourceAccess, } => ExpectedRevisionId,
                                    }
                                }
                                /// Returns a borrow of the field ConfirmRemoveSelfResourceAccess
                                pub fn ConfirmRemoveSelfResourceAccess(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        PutResourcePolicyInput::PutResourcePolicyInput{ResourceArn, Policy, ExpectedRevisionId, ConfirmRemoveSelfResourceAccess, } => ConfirmRemoveSelfResourceAccess,
                                    }
                                }
                            }

                            impl Debug
                                for PutResourcePolicyInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for PutResourcePolicyInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        PutResourcePolicyInput::PutResourcePolicyInput{ResourceArn, Policy, ExpectedRevisionId, ConfirmRemoveSelfResourceAccess, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PutResourcePolicyInput.PutResourcePolicyInput(")?;
                                            DafnyPrint::fmt_print(ResourceArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Policy, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpectedRevisionId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConfirmRemoveSelfResourceAccess, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for PutResourcePolicyInput {}

                            impl Hash
                                for PutResourcePolicyInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        PutResourcePolicyInput::PutResourcePolicyInput{ResourceArn, Policy, ExpectedRevisionId, ConfirmRemoveSelfResourceAccess, } => {
                                            Hash::hash(ResourceArn, _state);
                                            Hash::hash(Policy, _state);
                                            Hash::hash(ExpectedRevisionId, _state);
                                            Hash::hash(ConfirmRemoveSelfResourceAccess, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for PutResourcePolicyInput {
                                fn default() -> PutResourcePolicyInput {
                                    PutResourcePolicyInput::PutResourcePolicyInput {
                                        ResourceArn: Default::default(),
                                        Policy: Default::default(),
                                        ExpectedRevisionId: Default::default(),
                                        ConfirmRemoveSelfResourceAccess: Default::default()
                                    }
                                }
                            }

                            impl AsRef<PutResourcePolicyInput>
                                for PutResourcePolicyInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2198,3)
                            #[derive(PartialEq, Clone)]
                            pub enum PutResourcePolicyOutput {
                                PutResourcePolicyOutput {
                                    RevisionId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl PutResourcePolicyOutput {
                                /// Returns a borrow of the field RevisionId
                                pub fn RevisionId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        PutResourcePolicyOutput::PutResourcePolicyOutput{RevisionId, } => RevisionId,
                                    }
                                }
                            }

                            impl Debug
                                for PutResourcePolicyOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for PutResourcePolicyOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        PutResourcePolicyOutput::PutResourcePolicyOutput{RevisionId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.PutResourcePolicyOutput.PutResourcePolicyOutput(")?;
                                            DafnyPrint::fmt_print(RevisionId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for PutResourcePolicyOutput {}

                            impl Hash
                                for PutResourcePolicyOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        PutResourcePolicyOutput::PutResourcePolicyOutput{RevisionId, } => {
                                            Hash::hash(RevisionId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for PutResourcePolicyOutput {
                                fn default() -> PutResourcePolicyOutput {
                                    PutResourcePolicyOutput::PutResourcePolicyOutput {
                                        RevisionId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<PutResourcePolicyOutput>
                                for PutResourcePolicyOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2201,3)
                            #[derive(PartialEq, Clone)]
                            pub enum QueryInput {
                                QueryInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Select: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Select>>>,
                                    AttributesToGet: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeNameList>>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveIntegerObject>>,
                                    ConsistentRead: Arc<Option<bool>>,
                                    KeyConditions: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Condition>>>>,
                                    QueryFilter: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Condition>>>>,
                                    ConditionalOperator: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator>>>,
                                    ScanIndexForward: Arc<Option<bool>>,
                                    ExclusiveStartKey: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>,
                                    ProjectionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    FilterExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyConditionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    ExpressionAttributeValues: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>
                                }
                            }

                            impl QueryInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field Select
                                pub fn Select(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Select>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => Select,
                                    }
                                }
                                /// Returns a borrow of the field AttributesToGet
                                pub fn AttributesToGet(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeNameList>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => AttributesToGet,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveIntegerObject>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field ConsistentRead
                                pub fn ConsistentRead(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ConsistentRead,
                                    }
                                }
                                /// Returns a borrow of the field KeyConditions
                                pub fn KeyConditions(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Condition>>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => KeyConditions,
                                    }
                                }
                                /// Returns a borrow of the field QueryFilter
                                pub fn QueryFilter(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Condition>>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => QueryFilter,
                                    }
                                }
                                /// Returns a borrow of the field ConditionalOperator
                                pub fn ConditionalOperator(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ConditionalOperator,
                                    }
                                }
                                /// Returns a borrow of the field ScanIndexForward
                                pub fn ScanIndexForward(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ScanIndexForward,
                                    }
                                }
                                /// Returns a borrow of the field ExclusiveStartKey
                                pub fn ExclusiveStartKey(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ExclusiveStartKey,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ReturnConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ProjectionExpression
                                pub fn ProjectionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ProjectionExpression,
                                    }
                                }
                                /// Returns a borrow of the field FilterExpression
                                pub fn FilterExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => FilterExpression,
                                    }
                                }
                                /// Returns a borrow of the field KeyConditionExpression
                                pub fn KeyConditionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => KeyConditionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ExpressionAttributeNames,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeValues
                                pub fn ExpressionAttributeValues(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => ExpressionAttributeValues,
                                    }
                                }
                            }

                            impl Debug
                                for QueryInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for QueryInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryInput.QueryInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Select, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttributesToGet, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsistentRead, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyConditions, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(QueryFilter, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionalOperator, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ScanIndexForward, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExclusiveStartKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProjectionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(FilterExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyConditionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for QueryInput {}

                            impl Hash
                                for QueryInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        QueryInput::QueryInput{TableName, IndexName, Select, AttributesToGet, Limit, ConsistentRead, KeyConditions, QueryFilter, ConditionalOperator, ScanIndexForward, ExclusiveStartKey, ReturnConsumedCapacity, ProjectionExpression, FilterExpression, KeyConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(Select, _state);
                                            Hash::hash(AttributesToGet, _state);
                                            Hash::hash(Limit, _state);
                                            Hash::hash(ConsistentRead, _state);
                                            Hash::hash(KeyConditions, _state);
                                            Hash::hash(QueryFilter, _state);
                                            Hash::hash(ConditionalOperator, _state);
                                            Hash::hash(ScanIndexForward, _state);
                                            Hash::hash(ExclusiveStartKey, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state);
                                            Hash::hash(ProjectionExpression, _state);
                                            Hash::hash(FilterExpression, _state);
                                            Hash::hash(KeyConditionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state);
                                            Hash::hash(ExpressionAttributeValues, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for QueryInput {
                                fn default() -> QueryInput {
                                    QueryInput::QueryInput {
                                        TableName: Default::default(),
                                        IndexName: Default::default(),
                                        Select: Default::default(),
                                        AttributesToGet: Default::default(),
                                        Limit: Default::default(),
                                        ConsistentRead: Default::default(),
                                        KeyConditions: Default::default(),
                                        QueryFilter: Default::default(),
                                        ConditionalOperator: Default::default(),
                                        ScanIndexForward: Default::default(),
                                        ExclusiveStartKey: Default::default(),
                                        ReturnConsumedCapacity: Default::default(),
                                        ProjectionExpression: Default::default(),
                                        FilterExpression: Default::default(),
                                        KeyConditionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default(),
                                        ExpressionAttributeValues: Default::default()
                                    }
                                }
                            }

                            impl AsRef<QueryInput>
                                for QueryInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2220,3)
                            #[derive(PartialEq, Clone)]
                            pub enum QueryOutput {
                                QueryOutput {
                                    Items: Arc<Option<Sequence<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>>,
                                    Count: Arc<Option<i32>>,
                                    ScannedCount: Arc<Option<i32>>,
                                    LastEvaluatedKey: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>
                                }
                            }

                            impl QueryOutput {
                                /// Returns a borrow of the field Items
                                pub fn Items(&self) -> &Arc<Option<Sequence<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>> {
                                    match self {
                                        QueryOutput::QueryOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => Items,
                                    }
                                }
                                /// Returns a borrow of the field Count
                                pub fn Count(&self) -> &Arc<Option<i32>> {
                                    match self {
                                        QueryOutput::QueryOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => Count,
                                    }
                                }
                                /// Returns a borrow of the field ScannedCount
                                pub fn ScannedCount(&self) -> &Arc<Option<i32>> {
                                    match self {
                                        QueryOutput::QueryOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => ScannedCount,
                                    }
                                }
                                /// Returns a borrow of the field LastEvaluatedKey
                                pub fn LastEvaluatedKey(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        QueryOutput::QueryOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => LastEvaluatedKey,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>> {
                                    match self {
                                        QueryOutput::QueryOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => ConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for QueryOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for QueryOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        QueryOutput::QueryOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryOutput.QueryOutput(")?;
                                            DafnyPrint::fmt_print(Items, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Count, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ScannedCount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastEvaluatedKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for QueryOutput {}

                            impl Hash
                                for QueryOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        QueryOutput::QueryOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => {
                                            Hash::hash(Items, _state);
                                            Hash::hash(Count, _state);
                                            Hash::hash(ScannedCount, _state);
                                            Hash::hash(LastEvaluatedKey, _state);
                                            Hash::hash(ConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for QueryOutput {
                                fn default() -> QueryOutput {
                                    QueryOutput::QueryOutput {
                                        Items: Default::default(),
                                        Count: Default::default(),
                                        ScannedCount: Default::default(),
                                        LastEvaluatedKey: Default::default(),
                                        ConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<QueryOutput>
                                for QueryOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2228,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Replica {
                                Replica {
                                    RegionName: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl Replica {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        Replica::Replica{RegionName, } => RegionName,
                                    }
                                }
                            }

                            impl Debug
                                for Replica {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Replica {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Replica::Replica{RegionName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Replica.Replica(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Replica {}

                            impl Hash
                                for Replica {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Replica::Replica{RegionName, } => {
                                            Hash::hash(RegionName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Replica {
                                fn default() -> Replica {
                                    Replica::Replica {
                                        RegionName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Replica>
                                for Replica {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2231,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaAutoScalingDescription {
                                ReplicaAutoScalingDescription {
                                    RegionName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    GlobalSecondaryIndexes: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexAutoScalingDescription>>>>,
                                    ReplicaProvisionedReadCapacityAutoScalingSettings: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>>,
                                    ReplicaProvisionedWriteCapacityAutoScalingSettings: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>>,
                                    ReplicaStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus>>>
                                }
                            }

                            impl ReplicaAutoScalingDescription {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicaAutoScalingDescription::ReplicaAutoScalingDescription{RegionName, GlobalSecondaryIndexes, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaStatus, } => RegionName,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexes
                                pub fn GlobalSecondaryIndexes(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexAutoScalingDescription>>>> {
                                    match self {
                                        ReplicaAutoScalingDescription::ReplicaAutoScalingDescription{RegionName, GlobalSecondaryIndexes, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaStatus, } => GlobalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaProvisionedReadCapacityAutoScalingSettings
                                pub fn ReplicaProvisionedReadCapacityAutoScalingSettings(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>> {
                                    match self {
                                        ReplicaAutoScalingDescription::ReplicaAutoScalingDescription{RegionName, GlobalSecondaryIndexes, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaStatus, } => ReplicaProvisionedReadCapacityAutoScalingSettings,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaProvisionedWriteCapacityAutoScalingSettings
                                pub fn ReplicaProvisionedWriteCapacityAutoScalingSettings(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>> {
                                    match self {
                                        ReplicaAutoScalingDescription::ReplicaAutoScalingDescription{RegionName, GlobalSecondaryIndexes, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaStatus, } => ReplicaProvisionedWriteCapacityAutoScalingSettings,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaStatus
                                pub fn ReplicaStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus>>> {
                                    match self {
                                        ReplicaAutoScalingDescription::ReplicaAutoScalingDescription{RegionName, GlobalSecondaryIndexes, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaStatus, } => ReplicaStatus,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaAutoScalingDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaAutoScalingDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaAutoScalingDescription::ReplicaAutoScalingDescription{RegionName, GlobalSecondaryIndexes, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaStatus, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaAutoScalingDescription.ReplicaAutoScalingDescription(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaProvisionedReadCapacityAutoScalingSettings, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaProvisionedWriteCapacityAutoScalingSettings, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaStatus, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaAutoScalingDescription {}

                            impl Hash
                                for ReplicaAutoScalingDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaAutoScalingDescription::ReplicaAutoScalingDescription{RegionName, GlobalSecondaryIndexes, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaStatus, } => {
                                            Hash::hash(RegionName, _state);
                                            Hash::hash(GlobalSecondaryIndexes, _state);
                                            Hash::hash(ReplicaProvisionedReadCapacityAutoScalingSettings, _state);
                                            Hash::hash(ReplicaProvisionedWriteCapacityAutoScalingSettings, _state);
                                            Hash::hash(ReplicaStatus, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaAutoScalingDescription {
                                fn default() -> ReplicaAutoScalingDescription {
                                    ReplicaAutoScalingDescription::ReplicaAutoScalingDescription {
                                        RegionName: Default::default(),
                                        GlobalSecondaryIndexes: Default::default(),
                                        ReplicaProvisionedReadCapacityAutoScalingSettings: Default::default(),
                                        ReplicaProvisionedWriteCapacityAutoScalingSettings: Default::default(),
                                        ReplicaStatus: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaAutoScalingDescription>
                                for ReplicaAutoScalingDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2239,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaAutoScalingUpdate {
                                ReplicaAutoScalingUpdate {
                                    RegionName: Sequence<DafnyCharUTF16>,
                                    ReplicaGlobalSecondaryIndexUpdates: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexAutoScalingUpdate>>>>,
                                    ReplicaProvisionedReadCapacityAutoScalingUpdate: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>>
                                }
                            }

                            impl ReplicaAutoScalingUpdate {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ReplicaAutoScalingUpdate::ReplicaAutoScalingUpdate{RegionName, ReplicaGlobalSecondaryIndexUpdates, ReplicaProvisionedReadCapacityAutoScalingUpdate, } => RegionName,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaGlobalSecondaryIndexUpdates
                                pub fn ReplicaGlobalSecondaryIndexUpdates(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexAutoScalingUpdate>>>> {
                                    match self {
                                        ReplicaAutoScalingUpdate::ReplicaAutoScalingUpdate{RegionName, ReplicaGlobalSecondaryIndexUpdates, ReplicaProvisionedReadCapacityAutoScalingUpdate, } => ReplicaGlobalSecondaryIndexUpdates,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaProvisionedReadCapacityAutoScalingUpdate
                                pub fn ReplicaProvisionedReadCapacityAutoScalingUpdate(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>> {
                                    match self {
                                        ReplicaAutoScalingUpdate::ReplicaAutoScalingUpdate{RegionName, ReplicaGlobalSecondaryIndexUpdates, ReplicaProvisionedReadCapacityAutoScalingUpdate, } => ReplicaProvisionedReadCapacityAutoScalingUpdate,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaAutoScalingUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaAutoScalingUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaAutoScalingUpdate::ReplicaAutoScalingUpdate{RegionName, ReplicaGlobalSecondaryIndexUpdates, ReplicaProvisionedReadCapacityAutoScalingUpdate, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaAutoScalingUpdate.ReplicaAutoScalingUpdate(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaGlobalSecondaryIndexUpdates, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaProvisionedReadCapacityAutoScalingUpdate, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaAutoScalingUpdate {}

                            impl Hash
                                for ReplicaAutoScalingUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaAutoScalingUpdate::ReplicaAutoScalingUpdate{RegionName, ReplicaGlobalSecondaryIndexUpdates, ReplicaProvisionedReadCapacityAutoScalingUpdate, } => {
                                            Hash::hash(RegionName, _state);
                                            Hash::hash(ReplicaGlobalSecondaryIndexUpdates, _state);
                                            Hash::hash(ReplicaProvisionedReadCapacityAutoScalingUpdate, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaAutoScalingUpdate {
                                fn default() -> ReplicaAutoScalingUpdate {
                                    ReplicaAutoScalingUpdate::ReplicaAutoScalingUpdate {
                                        RegionName: Default::default(),
                                        ReplicaGlobalSecondaryIndexUpdates: Default::default(),
                                        ReplicaProvisionedReadCapacityAutoScalingUpdate: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaAutoScalingUpdate>
                                for ReplicaAutoScalingUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2244,3)
                            pub type ReplicaAutoScalingUpdateList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaAutoScalingUpdate>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2248,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaDescription {
                                ReplicaDescription {
                                    RegionName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ReplicaStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus>>>,
                                    ReplicaStatusDescription: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ReplicaStatusPercentProgress: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KMSMasterKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ProvisionedThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride>>>,
                                    OnDemandThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughputOverride>>>,
                                    GlobalSecondaryIndexes: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexDescription>>>>,
                                    ReplicaInaccessibleDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ReplicaTableClassSummary: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClassSummary>>>
                                }
                            }

                            impl ReplicaDescription {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => RegionName,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaStatus
                                pub fn ReplicaStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus>>> {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => ReplicaStatus,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaStatusDescription
                                pub fn ReplicaStatusDescription(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => ReplicaStatusDescription,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaStatusPercentProgress
                                pub fn ReplicaStatusPercentProgress(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => ReplicaStatusPercentProgress,
                                    }
                                }
                                /// Returns a borrow of the field KMSMasterKeyId
                                pub fn KMSMasterKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => KMSMasterKeyId,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughputOverride
                                pub fn ProvisionedThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride>>> {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => ProvisionedThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughputOverride
                                pub fn OnDemandThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughputOverride>>> {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => OnDemandThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexes
                                pub fn GlobalSecondaryIndexes(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexDescription>>>> {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => GlobalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaInaccessibleDateTime
                                pub fn ReplicaInaccessibleDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => ReplicaInaccessibleDateTime,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaTableClassSummary
                                pub fn ReplicaTableClassSummary(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClassSummary>>> {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => ReplicaTableClassSummary,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaDescription.ReplicaDescription(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaStatusDescription, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaStatusPercentProgress, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KMSMasterKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaInaccessibleDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaTableClassSummary, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaDescription {}

                            impl Hash
                                for ReplicaDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaDescription::ReplicaDescription{RegionName, ReplicaStatus, ReplicaStatusDescription, ReplicaStatusPercentProgress, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, ReplicaInaccessibleDateTime, ReplicaTableClassSummary, } => {
                                            Hash::hash(RegionName, _state);
                                            Hash::hash(ReplicaStatus, _state);
                                            Hash::hash(ReplicaStatusDescription, _state);
                                            Hash::hash(ReplicaStatusPercentProgress, _state);
                                            Hash::hash(KMSMasterKeyId, _state);
                                            Hash::hash(ProvisionedThroughputOverride, _state);
                                            Hash::hash(OnDemandThroughputOverride, _state);
                                            Hash::hash(GlobalSecondaryIndexes, _state);
                                            Hash::hash(ReplicaInaccessibleDateTime, _state);
                                            Hash::hash(ReplicaTableClassSummary, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaDescription {
                                fn default() -> ReplicaDescription {
                                    ReplicaDescription::ReplicaDescription {
                                        RegionName: Default::default(),
                                        ReplicaStatus: Default::default(),
                                        ReplicaStatusDescription: Default::default(),
                                        ReplicaStatusPercentProgress: Default::default(),
                                        KMSMasterKeyId: Default::default(),
                                        ProvisionedThroughputOverride: Default::default(),
                                        OnDemandThroughputOverride: Default::default(),
                                        GlobalSecondaryIndexes: Default::default(),
                                        ReplicaInaccessibleDateTime: Default::default(),
                                        ReplicaTableClassSummary: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaDescription>
                                for ReplicaDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2261,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaGlobalSecondaryIndex {
                                ReplicaGlobalSecondaryIndex {
                                    IndexName: Sequence<DafnyCharUTF16>,
                                    ProvisionedThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride>>>,
                                    OnDemandThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughputOverride>>>
                                }
                            }

                            impl ReplicaGlobalSecondaryIndex {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ReplicaGlobalSecondaryIndex::ReplicaGlobalSecondaryIndex{IndexName, ProvisionedThroughputOverride, OnDemandThroughputOverride, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughputOverride
                                pub fn ProvisionedThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndex::ReplicaGlobalSecondaryIndex{IndexName, ProvisionedThroughputOverride, OnDemandThroughputOverride, } => ProvisionedThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughputOverride
                                pub fn OnDemandThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughputOverride>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndex::ReplicaGlobalSecondaryIndex{IndexName, ProvisionedThroughputOverride, OnDemandThroughputOverride, } => OnDemandThroughputOverride,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaGlobalSecondaryIndex {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaGlobalSecondaryIndex {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaGlobalSecondaryIndex::ReplicaGlobalSecondaryIndex{IndexName, ProvisionedThroughputOverride, OnDemandThroughputOverride, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndex.ReplicaGlobalSecondaryIndex(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaGlobalSecondaryIndex {}

                            impl Hash
                                for ReplicaGlobalSecondaryIndex {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaGlobalSecondaryIndex::ReplicaGlobalSecondaryIndex{IndexName, ProvisionedThroughputOverride, OnDemandThroughputOverride, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ProvisionedThroughputOverride, _state);
                                            Hash::hash(OnDemandThroughputOverride, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaGlobalSecondaryIndex {
                                fn default() -> ReplicaGlobalSecondaryIndex {
                                    ReplicaGlobalSecondaryIndex::ReplicaGlobalSecondaryIndex {
                                        IndexName: Default::default(),
                                        ProvisionedThroughputOverride: Default::default(),
                                        OnDemandThroughputOverride: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaGlobalSecondaryIndex>
                                for ReplicaGlobalSecondaryIndex {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2266,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaGlobalSecondaryIndexAutoScalingDescription {
                                ReplicaGlobalSecondaryIndexAutoScalingDescription {
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    IndexStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus>>>,
                                    ProvisionedReadCapacityAutoScalingSettings: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>>,
                                    ProvisionedWriteCapacityAutoScalingSettings: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>>
                                }
                            }

                            impl ReplicaGlobalSecondaryIndexAutoScalingDescription {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexAutoScalingDescription::ReplicaGlobalSecondaryIndexAutoScalingDescription{IndexName, IndexStatus, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityAutoScalingSettings, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field IndexStatus
                                pub fn IndexStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexAutoScalingDescription::ReplicaGlobalSecondaryIndexAutoScalingDescription{IndexName, IndexStatus, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityAutoScalingSettings, } => IndexStatus,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedReadCapacityAutoScalingSettings
                                pub fn ProvisionedReadCapacityAutoScalingSettings(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexAutoScalingDescription::ReplicaGlobalSecondaryIndexAutoScalingDescription{IndexName, IndexStatus, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityAutoScalingSettings, } => ProvisionedReadCapacityAutoScalingSettings,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedWriteCapacityAutoScalingSettings
                                pub fn ProvisionedWriteCapacityAutoScalingSettings(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexAutoScalingDescription::ReplicaGlobalSecondaryIndexAutoScalingDescription{IndexName, IndexStatus, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityAutoScalingSettings, } => ProvisionedWriteCapacityAutoScalingSettings,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaGlobalSecondaryIndexAutoScalingDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaGlobalSecondaryIndexAutoScalingDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaGlobalSecondaryIndexAutoScalingDescription::ReplicaGlobalSecondaryIndexAutoScalingDescription{IndexName, IndexStatus, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityAutoScalingSettings, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexAutoScalingDescription.ReplicaGlobalSecondaryIndexAutoScalingDescription(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedReadCapacityAutoScalingSettings, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedWriteCapacityAutoScalingSettings, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaGlobalSecondaryIndexAutoScalingDescription {}

                            impl Hash
                                for ReplicaGlobalSecondaryIndexAutoScalingDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaGlobalSecondaryIndexAutoScalingDescription::ReplicaGlobalSecondaryIndexAutoScalingDescription{IndexName, IndexStatus, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityAutoScalingSettings, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(IndexStatus, _state);
                                            Hash::hash(ProvisionedReadCapacityAutoScalingSettings, _state);
                                            Hash::hash(ProvisionedWriteCapacityAutoScalingSettings, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaGlobalSecondaryIndexAutoScalingDescription {
                                fn default() -> ReplicaGlobalSecondaryIndexAutoScalingDescription {
                                    ReplicaGlobalSecondaryIndexAutoScalingDescription::ReplicaGlobalSecondaryIndexAutoScalingDescription {
                                        IndexName: Default::default(),
                                        IndexStatus: Default::default(),
                                        ProvisionedReadCapacityAutoScalingSettings: Default::default(),
                                        ProvisionedWriteCapacityAutoScalingSettings: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaGlobalSecondaryIndexAutoScalingDescription>
                                for ReplicaGlobalSecondaryIndexAutoScalingDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2273,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaGlobalSecondaryIndexAutoScalingUpdate {
                                ReplicaGlobalSecondaryIndexAutoScalingUpdate {
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ProvisionedReadCapacityAutoScalingUpdate: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>>
                                }
                            }

                            impl ReplicaGlobalSecondaryIndexAutoScalingUpdate {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexAutoScalingUpdate::ReplicaGlobalSecondaryIndexAutoScalingUpdate{IndexName, ProvisionedReadCapacityAutoScalingUpdate, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedReadCapacityAutoScalingUpdate
                                pub fn ProvisionedReadCapacityAutoScalingUpdate(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexAutoScalingUpdate::ReplicaGlobalSecondaryIndexAutoScalingUpdate{IndexName, ProvisionedReadCapacityAutoScalingUpdate, } => ProvisionedReadCapacityAutoScalingUpdate,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaGlobalSecondaryIndexAutoScalingUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaGlobalSecondaryIndexAutoScalingUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaGlobalSecondaryIndexAutoScalingUpdate::ReplicaGlobalSecondaryIndexAutoScalingUpdate{IndexName, ProvisionedReadCapacityAutoScalingUpdate, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexAutoScalingUpdate.ReplicaGlobalSecondaryIndexAutoScalingUpdate(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedReadCapacityAutoScalingUpdate, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaGlobalSecondaryIndexAutoScalingUpdate {}

                            impl Hash
                                for ReplicaGlobalSecondaryIndexAutoScalingUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaGlobalSecondaryIndexAutoScalingUpdate::ReplicaGlobalSecondaryIndexAutoScalingUpdate{IndexName, ProvisionedReadCapacityAutoScalingUpdate, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ProvisionedReadCapacityAutoScalingUpdate, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaGlobalSecondaryIndexAutoScalingUpdate {
                                fn default() -> ReplicaGlobalSecondaryIndexAutoScalingUpdate {
                                    ReplicaGlobalSecondaryIndexAutoScalingUpdate::ReplicaGlobalSecondaryIndexAutoScalingUpdate {
                                        IndexName: Default::default(),
                                        ProvisionedReadCapacityAutoScalingUpdate: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaGlobalSecondaryIndexAutoScalingUpdate>
                                for ReplicaGlobalSecondaryIndexAutoScalingUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2278,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaGlobalSecondaryIndexDescription {
                                ReplicaGlobalSecondaryIndexDescription {
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ProvisionedThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride>>>,
                                    OnDemandThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughputOverride>>>
                                }
                            }

                            impl ReplicaGlobalSecondaryIndexDescription {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription{IndexName, ProvisionedThroughputOverride, OnDemandThroughputOverride, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughputOverride
                                pub fn ProvisionedThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription{IndexName, ProvisionedThroughputOverride, OnDemandThroughputOverride, } => ProvisionedThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughputOverride
                                pub fn OnDemandThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughputOverride>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription{IndexName, ProvisionedThroughputOverride, OnDemandThroughputOverride, } => OnDemandThroughputOverride,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaGlobalSecondaryIndexDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaGlobalSecondaryIndexDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription{IndexName, ProvisionedThroughputOverride, OnDemandThroughputOverride, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexDescription.ReplicaGlobalSecondaryIndexDescription(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaGlobalSecondaryIndexDescription {}

                            impl Hash
                                for ReplicaGlobalSecondaryIndexDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription{IndexName, ProvisionedThroughputOverride, OnDemandThroughputOverride, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ProvisionedThroughputOverride, _state);
                                            Hash::hash(OnDemandThroughputOverride, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaGlobalSecondaryIndexDescription {
                                fn default() -> ReplicaGlobalSecondaryIndexDescription {
                                    ReplicaGlobalSecondaryIndexDescription::ReplicaGlobalSecondaryIndexDescription {
                                        IndexName: Default::default(),
                                        ProvisionedThroughputOverride: Default::default(),
                                        OnDemandThroughputOverride: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaGlobalSecondaryIndexDescription>
                                for ReplicaGlobalSecondaryIndexDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2284,3)
                            pub type ReplicaGlobalSecondaryIndexList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndex>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2288,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaGlobalSecondaryIndexSettingsDescription {
                                ReplicaGlobalSecondaryIndexSettingsDescription {
                                    IndexName: Sequence<DafnyCharUTF16>,
                                    IndexStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus>>>,
                                    ProvisionedReadCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    ProvisionedReadCapacityAutoScalingSettings: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>>,
                                    ProvisionedWriteCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    ProvisionedWriteCapacityAutoScalingSettings: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>>
                                }
                            }

                            impl ReplicaGlobalSecondaryIndexSettingsDescription {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsDescription::ReplicaGlobalSecondaryIndexSettingsDescription{IndexName, IndexStatus, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettings, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field IndexStatus
                                pub fn IndexStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IndexStatus>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsDescription::ReplicaGlobalSecondaryIndexSettingsDescription{IndexName, IndexStatus, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettings, } => IndexStatus,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedReadCapacityUnits
                                pub fn ProvisionedReadCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsDescription::ReplicaGlobalSecondaryIndexSettingsDescription{IndexName, IndexStatus, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettings, } => ProvisionedReadCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedReadCapacityAutoScalingSettings
                                pub fn ProvisionedReadCapacityAutoScalingSettings(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsDescription::ReplicaGlobalSecondaryIndexSettingsDescription{IndexName, IndexStatus, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettings, } => ProvisionedReadCapacityAutoScalingSettings,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedWriteCapacityUnits
                                pub fn ProvisionedWriteCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsDescription::ReplicaGlobalSecondaryIndexSettingsDescription{IndexName, IndexStatus, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettings, } => ProvisionedWriteCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedWriteCapacityAutoScalingSettings
                                pub fn ProvisionedWriteCapacityAutoScalingSettings(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsDescription::ReplicaGlobalSecondaryIndexSettingsDescription{IndexName, IndexStatus, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettings, } => ProvisionedWriteCapacityAutoScalingSettings,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaGlobalSecondaryIndexSettingsDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaGlobalSecondaryIndexSettingsDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsDescription::ReplicaGlobalSecondaryIndexSettingsDescription{IndexName, IndexStatus, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettings, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexSettingsDescription.ReplicaGlobalSecondaryIndexSettingsDescription(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedReadCapacityAutoScalingSettings, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedWriteCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedWriteCapacityAutoScalingSettings, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaGlobalSecondaryIndexSettingsDescription {}

                            impl Hash
                                for ReplicaGlobalSecondaryIndexSettingsDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsDescription::ReplicaGlobalSecondaryIndexSettingsDescription{IndexName, IndexStatus, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettings, ProvisionedWriteCapacityUnits, ProvisionedWriteCapacityAutoScalingSettings, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(IndexStatus, _state);
                                            Hash::hash(ProvisionedReadCapacityUnits, _state);
                                            Hash::hash(ProvisionedReadCapacityAutoScalingSettings, _state);
                                            Hash::hash(ProvisionedWriteCapacityUnits, _state);
                                            Hash::hash(ProvisionedWriteCapacityAutoScalingSettings, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaGlobalSecondaryIndexSettingsDescription {
                                fn default() -> ReplicaGlobalSecondaryIndexSettingsDescription {
                                    ReplicaGlobalSecondaryIndexSettingsDescription::ReplicaGlobalSecondaryIndexSettingsDescription {
                                        IndexName: Default::default(),
                                        IndexStatus: Default::default(),
                                        ProvisionedReadCapacityUnits: Default::default(),
                                        ProvisionedReadCapacityAutoScalingSettings: Default::default(),
                                        ProvisionedWriteCapacityUnits: Default::default(),
                                        ProvisionedWriteCapacityAutoScalingSettings: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaGlobalSecondaryIndexSettingsDescription>
                                for ReplicaGlobalSecondaryIndexSettingsDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2297,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaGlobalSecondaryIndexSettingsUpdate {
                                ReplicaGlobalSecondaryIndexSettingsUpdate {
                                    IndexName: Sequence<DafnyCharUTF16>,
                                    ProvisionedReadCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    ProvisionedReadCapacityAutoScalingSettingsUpdate: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>>
                                }
                            }

                            impl ReplicaGlobalSecondaryIndexSettingsUpdate {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsUpdate::ReplicaGlobalSecondaryIndexSettingsUpdate{IndexName, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettingsUpdate, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedReadCapacityUnits
                                pub fn ProvisionedReadCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsUpdate::ReplicaGlobalSecondaryIndexSettingsUpdate{IndexName, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettingsUpdate, } => ProvisionedReadCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedReadCapacityAutoScalingSettingsUpdate
                                pub fn ProvisionedReadCapacityAutoScalingSettingsUpdate(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>> {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsUpdate::ReplicaGlobalSecondaryIndexSettingsUpdate{IndexName, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettingsUpdate, } => ProvisionedReadCapacityAutoScalingSettingsUpdate,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaGlobalSecondaryIndexSettingsUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaGlobalSecondaryIndexSettingsUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsUpdate::ReplicaGlobalSecondaryIndexSettingsUpdate{IndexName, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettingsUpdate, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexSettingsUpdate.ReplicaGlobalSecondaryIndexSettingsUpdate(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedReadCapacityAutoScalingSettingsUpdate, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaGlobalSecondaryIndexSettingsUpdate {}

                            impl Hash
                                for ReplicaGlobalSecondaryIndexSettingsUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaGlobalSecondaryIndexSettingsUpdate::ReplicaGlobalSecondaryIndexSettingsUpdate{IndexName, ProvisionedReadCapacityUnits, ProvisionedReadCapacityAutoScalingSettingsUpdate, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ProvisionedReadCapacityUnits, _state);
                                            Hash::hash(ProvisionedReadCapacityAutoScalingSettingsUpdate, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaGlobalSecondaryIndexSettingsUpdate {
                                fn default() -> ReplicaGlobalSecondaryIndexSettingsUpdate {
                                    ReplicaGlobalSecondaryIndexSettingsUpdate::ReplicaGlobalSecondaryIndexSettingsUpdate {
                                        IndexName: Default::default(),
                                        ProvisionedReadCapacityUnits: Default::default(),
                                        ProvisionedReadCapacityAutoScalingSettingsUpdate: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaGlobalSecondaryIndexSettingsUpdate>
                                for ReplicaGlobalSecondaryIndexSettingsUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2302,3)
                            pub type ReplicaGlobalSecondaryIndexSettingsUpdateList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexSettingsUpdate>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2307,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaSettingsDescription {
                                ReplicaSettingsDescription {
                                    RegionName: Sequence<DafnyCharUTF16>,
                                    ReplicaStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus>>>,
                                    ReplicaBillingModeSummary: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingModeSummary>>>,
                                    ReplicaProvisionedReadCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::NonNegativeLongObject>>,
                                    ReplicaProvisionedReadCapacityAutoScalingSettings: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>>,
                                    ReplicaProvisionedWriteCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::NonNegativeLongObject>>,
                                    ReplicaProvisionedWriteCapacityAutoScalingSettings: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>>,
                                    ReplicaGlobalSecondaryIndexSettings: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexSettingsDescription>>>>,
                                    ReplicaTableClassSummary: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClassSummary>>>
                                }
                            }

                            impl ReplicaSettingsDescription {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => RegionName,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaStatus
                                pub fn ReplicaStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaStatus>>> {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => ReplicaStatus,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaBillingModeSummary
                                pub fn ReplicaBillingModeSummary(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingModeSummary>>> {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => ReplicaBillingModeSummary,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaProvisionedReadCapacityUnits
                                pub fn ReplicaProvisionedReadCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::NonNegativeLongObject>> {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => ReplicaProvisionedReadCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaProvisionedReadCapacityAutoScalingSettings
                                pub fn ReplicaProvisionedReadCapacityAutoScalingSettings(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>> {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => ReplicaProvisionedReadCapacityAutoScalingSettings,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaProvisionedWriteCapacityUnits
                                pub fn ReplicaProvisionedWriteCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::NonNegativeLongObject>> {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => ReplicaProvisionedWriteCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaProvisionedWriteCapacityAutoScalingSettings
                                pub fn ReplicaProvisionedWriteCapacityAutoScalingSettings(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsDescription>>> {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => ReplicaProvisionedWriteCapacityAutoScalingSettings,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaGlobalSecondaryIndexSettings
                                pub fn ReplicaGlobalSecondaryIndexSettings(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexSettingsDescription>>>> {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => ReplicaGlobalSecondaryIndexSettings,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaTableClassSummary
                                pub fn ReplicaTableClassSummary(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClassSummary>>> {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => ReplicaTableClassSummary,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaSettingsDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaSettingsDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaSettingsDescription.ReplicaSettingsDescription(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaBillingModeSummary, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaProvisionedReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaProvisionedReadCapacityAutoScalingSettings, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaProvisionedWriteCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaProvisionedWriteCapacityAutoScalingSettings, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaGlobalSecondaryIndexSettings, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaTableClassSummary, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaSettingsDescription {}

                            impl Hash
                                for ReplicaSettingsDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaSettingsDescription::ReplicaSettingsDescription{RegionName, ReplicaStatus, ReplicaBillingModeSummary, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettings, ReplicaProvisionedWriteCapacityUnits, ReplicaProvisionedWriteCapacityAutoScalingSettings, ReplicaGlobalSecondaryIndexSettings, ReplicaTableClassSummary, } => {
                                            Hash::hash(RegionName, _state);
                                            Hash::hash(ReplicaStatus, _state);
                                            Hash::hash(ReplicaBillingModeSummary, _state);
                                            Hash::hash(ReplicaProvisionedReadCapacityUnits, _state);
                                            Hash::hash(ReplicaProvisionedReadCapacityAutoScalingSettings, _state);
                                            Hash::hash(ReplicaProvisionedWriteCapacityUnits, _state);
                                            Hash::hash(ReplicaProvisionedWriteCapacityAutoScalingSettings, _state);
                                            Hash::hash(ReplicaGlobalSecondaryIndexSettings, _state);
                                            Hash::hash(ReplicaTableClassSummary, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaSettingsDescription {
                                fn default() -> ReplicaSettingsDescription {
                                    ReplicaSettingsDescription::ReplicaSettingsDescription {
                                        RegionName: Default::default(),
                                        ReplicaStatus: Default::default(),
                                        ReplicaBillingModeSummary: Default::default(),
                                        ReplicaProvisionedReadCapacityUnits: Default::default(),
                                        ReplicaProvisionedReadCapacityAutoScalingSettings: Default::default(),
                                        ReplicaProvisionedWriteCapacityUnits: Default::default(),
                                        ReplicaProvisionedWriteCapacityAutoScalingSettings: Default::default(),
                                        ReplicaGlobalSecondaryIndexSettings: Default::default(),
                                        ReplicaTableClassSummary: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaSettingsDescription>
                                for ReplicaSettingsDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2319,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaSettingsUpdate {
                                ReplicaSettingsUpdate {
                                    RegionName: Sequence<DafnyCharUTF16>,
                                    ReplicaProvisionedReadCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>>,
                                    ReplicaGlobalSecondaryIndexSettingsUpdate: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexSettingsUpdateList>>,
                                    ReplicaTableClass: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>>
                                }
                            }

                            impl ReplicaSettingsUpdate {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ReplicaSettingsUpdate::ReplicaSettingsUpdate{RegionName, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, ReplicaGlobalSecondaryIndexSettingsUpdate, ReplicaTableClass, } => RegionName,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaProvisionedReadCapacityUnits
                                pub fn ReplicaProvisionedReadCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        ReplicaSettingsUpdate::ReplicaSettingsUpdate{RegionName, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, ReplicaGlobalSecondaryIndexSettingsUpdate, ReplicaTableClass, } => ReplicaProvisionedReadCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate
                                pub fn ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>> {
                                    match self {
                                        ReplicaSettingsUpdate::ReplicaSettingsUpdate{RegionName, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, ReplicaGlobalSecondaryIndexSettingsUpdate, ReplicaTableClass, } => ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaGlobalSecondaryIndexSettingsUpdate
                                pub fn ReplicaGlobalSecondaryIndexSettingsUpdate(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexSettingsUpdateList>> {
                                    match self {
                                        ReplicaSettingsUpdate::ReplicaSettingsUpdate{RegionName, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, ReplicaGlobalSecondaryIndexSettingsUpdate, ReplicaTableClass, } => ReplicaGlobalSecondaryIndexSettingsUpdate,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaTableClass
                                pub fn ReplicaTableClass(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>> {
                                    match self {
                                        ReplicaSettingsUpdate::ReplicaSettingsUpdate{RegionName, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, ReplicaGlobalSecondaryIndexSettingsUpdate, ReplicaTableClass, } => ReplicaTableClass,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaSettingsUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaSettingsUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaSettingsUpdate::ReplicaSettingsUpdate{RegionName, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, ReplicaGlobalSecondaryIndexSettingsUpdate, ReplicaTableClass, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaSettingsUpdate.ReplicaSettingsUpdate(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaProvisionedReadCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaGlobalSecondaryIndexSettingsUpdate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaTableClass, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaSettingsUpdate {}

                            impl Hash
                                for ReplicaSettingsUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaSettingsUpdate::ReplicaSettingsUpdate{RegionName, ReplicaProvisionedReadCapacityUnits, ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, ReplicaGlobalSecondaryIndexSettingsUpdate, ReplicaTableClass, } => {
                                            Hash::hash(RegionName, _state);
                                            Hash::hash(ReplicaProvisionedReadCapacityUnits, _state);
                                            Hash::hash(ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, _state);
                                            Hash::hash(ReplicaGlobalSecondaryIndexSettingsUpdate, _state);
                                            Hash::hash(ReplicaTableClass, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaSettingsUpdate {
                                fn default() -> ReplicaSettingsUpdate {
                                    ReplicaSettingsUpdate::ReplicaSettingsUpdate {
                                        RegionName: Default::default(),
                                        ReplicaProvisionedReadCapacityUnits: Default::default(),
                                        ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate: Default::default(),
                                        ReplicaGlobalSecondaryIndexSettingsUpdate: Default::default(),
                                        ReplicaTableClass: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaSettingsUpdate>
                                for ReplicaSettingsUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2326,3)
                            pub type ReplicaSettingsUpdateList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaSettingsUpdate>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2330,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaStatus {
                                CREATING {},
                                CREATION_FAILED {},
                                UPDATING {},
                                DELETING {},
                                ACTIVE {},
                                REGION_DISABLED {},
                                INACCESSIBLE_ENCRYPTION_CREDENTIALS {}
                            }

                            impl ReplicaStatus {}

                            impl Debug
                                for ReplicaStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaStatus::CREATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.CREATING")?;
                                            Ok(())
                                        },
                                        ReplicaStatus::CREATION_FAILED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.CREATION__FAILED")?;
                                            Ok(())
                                        },
                                        ReplicaStatus::UPDATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.UPDATING")?;
                                            Ok(())
                                        },
                                        ReplicaStatus::DELETING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.DELETING")?;
                                            Ok(())
                                        },
                                        ReplicaStatus::ACTIVE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.ACTIVE")?;
                                            Ok(())
                                        },
                                        ReplicaStatus::REGION_DISABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.REGION__DISABLED")?;
                                            Ok(())
                                        },
                                        ReplicaStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.INACCESSIBLE__ENCRYPTION__CREDENTIALS")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ReplicaStatus {
                                /// Enumerates all possible values of ReplicaStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ReplicaStatus>> {
                                    seq![Arc::new(ReplicaStatus::CREATING {}), Arc::new(ReplicaStatus::CREATION_FAILED {}), Arc::new(ReplicaStatus::UPDATING {}), Arc::new(ReplicaStatus::DELETING {}), Arc::new(ReplicaStatus::ACTIVE {}), Arc::new(ReplicaStatus::REGION_DISABLED {}), Arc::new(ReplicaStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS {})].iter()
                                }
                            }

                            impl Eq
                                for ReplicaStatus {}

                            impl Hash
                                for ReplicaStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaStatus::CREATING{} => {

                                        },
                                        ReplicaStatus::CREATION_FAILED{} => {

                                        },
                                        ReplicaStatus::UPDATING{} => {

                                        },
                                        ReplicaStatus::DELETING{} => {

                                        },
                                        ReplicaStatus::ACTIVE{} => {

                                        },
                                        ReplicaStatus::REGION_DISABLED{} => {

                                        },
                                        ReplicaStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaStatus {
                                fn default() -> ReplicaStatus {
                                    ReplicaStatus::CREATING {}
                                }
                            }

                            impl AsRef<ReplicaStatus>
                                for ReplicaStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2340,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicationGroupUpdate {
                                ReplicationGroupUpdate {
                                    Create: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateReplicationGroupMemberAction>>>,
                                    Update: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateReplicationGroupMemberAction>>>,
                                    Delete: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteReplicationGroupMemberAction>>>
                                }
                            }

                            impl ReplicationGroupUpdate {
                                /// Returns a borrow of the field Create
                                pub fn Create(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateReplicationGroupMemberAction>>> {
                                    match self {
                                        ReplicationGroupUpdate::ReplicationGroupUpdate{Create, Update, Delete, } => Create,
                                    }
                                }
                                /// Returns a borrow of the field Update
                                pub fn Update(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateReplicationGroupMemberAction>>> {
                                    match self {
                                        ReplicationGroupUpdate::ReplicationGroupUpdate{Create, Update, Delete, } => Update,
                                    }
                                }
                                /// Returns a borrow of the field Delete
                                pub fn Delete(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteReplicationGroupMemberAction>>> {
                                    match self {
                                        ReplicationGroupUpdate::ReplicationGroupUpdate{Create, Update, Delete, } => Delete,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicationGroupUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicationGroupUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicationGroupUpdate::ReplicationGroupUpdate{Create, Update, Delete, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicationGroupUpdate.ReplicationGroupUpdate(")?;
                                            DafnyPrint::fmt_print(Create, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Update, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Delete, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicationGroupUpdate {}

                            impl Hash
                                for ReplicationGroupUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicationGroupUpdate::ReplicationGroupUpdate{Create, Update, Delete, } => {
                                            Hash::hash(Create, _state);
                                            Hash::hash(Update, _state);
                                            Hash::hash(Delete, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicationGroupUpdate {
                                fn default() -> ReplicationGroupUpdate {
                                    ReplicationGroupUpdate::ReplicationGroupUpdate {
                                        Create: Default::default(),
                                        Update: Default::default(),
                                        Delete: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicationGroupUpdate>
                                for ReplicationGroupUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2345,3)
                            pub type ReplicationGroupUpdateList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicationGroupUpdate>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2349,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicaUpdate {
                                ReplicaUpdate {
                                    Create: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateReplicaAction>>>,
                                    Delete: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteReplicaAction>>>
                                }
                            }

                            impl ReplicaUpdate {
                                /// Returns a borrow of the field Create
                                pub fn Create(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateReplicaAction>>> {
                                    match self {
                                        ReplicaUpdate::ReplicaUpdate{Create, Delete, } => Create,
                                    }
                                }
                                /// Returns a borrow of the field Delete
                                pub fn Delete(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteReplicaAction>>> {
                                    match self {
                                        ReplicaUpdate::ReplicaUpdate{Create, Delete, } => Delete,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicaUpdate {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicaUpdate {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicaUpdate::ReplicaUpdate{Create, Delete, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaUpdate.ReplicaUpdate(")?;
                                            DafnyPrint::fmt_print(Create, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Delete, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicaUpdate {}

                            impl Hash
                                for ReplicaUpdate {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicaUpdate::ReplicaUpdate{Create, Delete, } => {
                                            Hash::hash(Create, _state);
                                            Hash::hash(Delete, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicaUpdate {
                                fn default() -> ReplicaUpdate {
                                    ReplicaUpdate::ReplicaUpdate {
                                        Create: Default::default(),
                                        Delete: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicaUpdate>
                                for ReplicaUpdate {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2354,3)
                            pub type ResourceArnString = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2360,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RestoreSummary {
                                RestoreSummary {
                                    SourceBackupArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    SourceTableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    RestoreDateTime: Sequence<DafnyCharUTF16>,
                                    RestoreInProgress: bool
                                }
                            }

                            impl RestoreSummary {
                                /// Returns a borrow of the field SourceBackupArn
                                pub fn SourceBackupArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RestoreSummary::RestoreSummary{SourceBackupArn, SourceTableArn, RestoreDateTime, RestoreInProgress, } => SourceBackupArn,
                                    }
                                }
                                /// Returns a borrow of the field SourceTableArn
                                pub fn SourceTableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RestoreSummary::RestoreSummary{SourceBackupArn, SourceTableArn, RestoreDateTime, RestoreInProgress, } => SourceTableArn,
                                    }
                                }
                                /// Returns a borrow of the field RestoreDateTime
                                pub fn RestoreDateTime(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        RestoreSummary::RestoreSummary{SourceBackupArn, SourceTableArn, RestoreDateTime, RestoreInProgress, } => RestoreDateTime,
                                    }
                                }
                                /// Returns a borrow of the field RestoreInProgress
                                pub fn RestoreInProgress(&self) -> &bool {
                                    match self {
                                        RestoreSummary::RestoreSummary{SourceBackupArn, SourceTableArn, RestoreDateTime, RestoreInProgress, } => RestoreInProgress,
                                    }
                                }
                            }

                            impl Debug
                                for RestoreSummary {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RestoreSummary {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RestoreSummary::RestoreSummary{SourceBackupArn, SourceTableArn, RestoreDateTime, RestoreInProgress, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreSummary.RestoreSummary(")?;
                                            DafnyPrint::fmt_print(SourceBackupArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SourceTableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RestoreDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RestoreInProgress, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RestoreSummary {}

                            impl Hash
                                for RestoreSummary {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RestoreSummary::RestoreSummary{SourceBackupArn, SourceTableArn, RestoreDateTime, RestoreInProgress, } => {
                                            Hash::hash(SourceBackupArn, _state);
                                            Hash::hash(SourceTableArn, _state);
                                            Hash::hash(RestoreDateTime, _state);
                                            Hash::hash(RestoreInProgress, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RestoreSummary {
                                fn default() -> RestoreSummary {
                                    RestoreSummary::RestoreSummary {
                                        SourceBackupArn: Default::default(),
                                        SourceTableArn: Default::default(),
                                        RestoreDateTime: Default::default(),
                                        RestoreInProgress: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RestoreSummary>
                                for RestoreSummary {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2366,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RestoreTableFromBackupInput {
                                RestoreTableFromBackupInput {
                                    TargetTableName: Sequence<DafnyCharUTF16>,
                                    BackupArn: Sequence<DafnyCharUTF16>,
                                    BillingModeOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>>,
                                    GlobalSecondaryIndexOverride: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex>>>>,
                                    LocalSecondaryIndexOverride: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndex>>>>,
                                    ProvisionedThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>>,
                                    OnDemandThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>,
                                    SSESpecificationOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification>>>
                                }
                            }

                            impl RestoreTableFromBackupInput {
                                /// Returns a borrow of the field TargetTableName
                                pub fn TargetTableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        RestoreTableFromBackupInput::RestoreTableFromBackupInput{TargetTableName, BackupArn, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => TargetTableName,
                                    }
                                }
                                /// Returns a borrow of the field BackupArn
                                pub fn BackupArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        RestoreTableFromBackupInput::RestoreTableFromBackupInput{TargetTableName, BackupArn, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => BackupArn,
                                    }
                                }
                                /// Returns a borrow of the field BillingModeOverride
                                pub fn BillingModeOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>> {
                                    match self {
                                        RestoreTableFromBackupInput::RestoreTableFromBackupInput{TargetTableName, BackupArn, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => BillingModeOverride,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexOverride
                                pub fn GlobalSecondaryIndexOverride(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex>>>> {
                                    match self {
                                        RestoreTableFromBackupInput::RestoreTableFromBackupInput{TargetTableName, BackupArn, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => GlobalSecondaryIndexOverride,
                                    }
                                }
                                /// Returns a borrow of the field LocalSecondaryIndexOverride
                                pub fn LocalSecondaryIndexOverride(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndex>>>> {
                                    match self {
                                        RestoreTableFromBackupInput::RestoreTableFromBackupInput{TargetTableName, BackupArn, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => LocalSecondaryIndexOverride,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughputOverride
                                pub fn ProvisionedThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>> {
                                    match self {
                                        RestoreTableFromBackupInput::RestoreTableFromBackupInput{TargetTableName, BackupArn, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => ProvisionedThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughputOverride
                                pub fn OnDemandThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        RestoreTableFromBackupInput::RestoreTableFromBackupInput{TargetTableName, BackupArn, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => OnDemandThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field SSESpecificationOverride
                                pub fn SSESpecificationOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification>>> {
                                    match self {
                                        RestoreTableFromBackupInput::RestoreTableFromBackupInput{TargetTableName, BackupArn, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => SSESpecificationOverride,
                                    }
                                }
                            }

                            impl Debug
                                for RestoreTableFromBackupInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RestoreTableFromBackupInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RestoreTableFromBackupInput::RestoreTableFromBackupInput{TargetTableName, BackupArn, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableFromBackupInput.RestoreTableFromBackupInput(")?;
                                            DafnyPrint::fmt_print(TargetTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BackupArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BillingModeOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LocalSecondaryIndexOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SSESpecificationOverride, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RestoreTableFromBackupInput {}

                            impl Hash
                                for RestoreTableFromBackupInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RestoreTableFromBackupInput::RestoreTableFromBackupInput{TargetTableName, BackupArn, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => {
                                            Hash::hash(TargetTableName, _state);
                                            Hash::hash(BackupArn, _state);
                                            Hash::hash(BillingModeOverride, _state);
                                            Hash::hash(GlobalSecondaryIndexOverride, _state);
                                            Hash::hash(LocalSecondaryIndexOverride, _state);
                                            Hash::hash(ProvisionedThroughputOverride, _state);
                                            Hash::hash(OnDemandThroughputOverride, _state);
                                            Hash::hash(SSESpecificationOverride, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RestoreTableFromBackupInput {
                                fn default() -> RestoreTableFromBackupInput {
                                    RestoreTableFromBackupInput::RestoreTableFromBackupInput {
                                        TargetTableName: Default::default(),
                                        BackupArn: Default::default(),
                                        BillingModeOverride: Default::default(),
                                        GlobalSecondaryIndexOverride: Default::default(),
                                        LocalSecondaryIndexOverride: Default::default(),
                                        ProvisionedThroughputOverride: Default::default(),
                                        OnDemandThroughputOverride: Default::default(),
                                        SSESpecificationOverride: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RestoreTableFromBackupInput>
                                for RestoreTableFromBackupInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2376,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RestoreTableFromBackupOutput {
                                RestoreTableFromBackupOutput {
                                    TableDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>>
                                }
                            }

                            impl RestoreTableFromBackupOutput {
                                /// Returns a borrow of the field TableDescription
                                pub fn TableDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>> {
                                    match self {
                                        RestoreTableFromBackupOutput::RestoreTableFromBackupOutput{TableDescription, } => TableDescription,
                                    }
                                }
                            }

                            impl Debug
                                for RestoreTableFromBackupOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RestoreTableFromBackupOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RestoreTableFromBackupOutput::RestoreTableFromBackupOutput{TableDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableFromBackupOutput.RestoreTableFromBackupOutput(")?;
                                            DafnyPrint::fmt_print(TableDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RestoreTableFromBackupOutput {}

                            impl Hash
                                for RestoreTableFromBackupOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RestoreTableFromBackupOutput::RestoreTableFromBackupOutput{TableDescription, } => {
                                            Hash::hash(TableDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RestoreTableFromBackupOutput {
                                fn default() -> RestoreTableFromBackupOutput {
                                    RestoreTableFromBackupOutput::RestoreTableFromBackupOutput {
                                        TableDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RestoreTableFromBackupOutput>
                                for RestoreTableFromBackupOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2379,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RestoreTableToPointInTimeInput {
                                RestoreTableToPointInTimeInput {
                                    SourceTableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    SourceTableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TargetTableName: Sequence<DafnyCharUTF16>,
                                    UseLatestRestorableTime: Arc<Option<bool>>,
                                    RestoreDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    BillingModeOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>>,
                                    GlobalSecondaryIndexOverride: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex>>>>,
                                    LocalSecondaryIndexOverride: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndex>>>>,
                                    ProvisionedThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>>,
                                    OnDemandThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>,
                                    SSESpecificationOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification>>>
                                }
                            }

                            impl RestoreTableToPointInTimeInput {
                                /// Returns a borrow of the field SourceTableArn
                                pub fn SourceTableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => SourceTableArn,
                                    }
                                }
                                /// Returns a borrow of the field SourceTableName
                                pub fn SourceTableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => SourceTableName,
                                    }
                                }
                                /// Returns a borrow of the field TargetTableName
                                pub fn TargetTableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => TargetTableName,
                                    }
                                }
                                /// Returns a borrow of the field UseLatestRestorableTime
                                pub fn UseLatestRestorableTime(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => UseLatestRestorableTime,
                                    }
                                }
                                /// Returns a borrow of the field RestoreDateTime
                                pub fn RestoreDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => RestoreDateTime,
                                    }
                                }
                                /// Returns a borrow of the field BillingModeOverride
                                pub fn BillingModeOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => BillingModeOverride,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexOverride
                                pub fn GlobalSecondaryIndexOverride(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex>>>> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => GlobalSecondaryIndexOverride,
                                    }
                                }
                                /// Returns a borrow of the field LocalSecondaryIndexOverride
                                pub fn LocalSecondaryIndexOverride(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndex>>>> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => LocalSecondaryIndexOverride,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughputOverride
                                pub fn ProvisionedThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => ProvisionedThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughputOverride
                                pub fn OnDemandThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => OnDemandThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field SSESpecificationOverride
                                pub fn SSESpecificationOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification>>> {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => SSESpecificationOverride,
                                    }
                                }
                            }

                            impl Debug
                                for RestoreTableToPointInTimeInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RestoreTableToPointInTimeInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableToPointInTimeInput.RestoreTableToPointInTimeInput(")?;
                                            DafnyPrint::fmt_print(SourceTableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SourceTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TargetTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(UseLatestRestorableTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RestoreDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BillingModeOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LocalSecondaryIndexOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SSESpecificationOverride, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RestoreTableToPointInTimeInput {}

                            impl Hash
                                for RestoreTableToPointInTimeInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput{SourceTableArn, SourceTableName, TargetTableName, UseLatestRestorableTime, RestoreDateTime, BillingModeOverride, GlobalSecondaryIndexOverride, LocalSecondaryIndexOverride, ProvisionedThroughputOverride, OnDemandThroughputOverride, SSESpecificationOverride, } => {
                                            Hash::hash(SourceTableArn, _state);
                                            Hash::hash(SourceTableName, _state);
                                            Hash::hash(TargetTableName, _state);
                                            Hash::hash(UseLatestRestorableTime, _state);
                                            Hash::hash(RestoreDateTime, _state);
                                            Hash::hash(BillingModeOverride, _state);
                                            Hash::hash(GlobalSecondaryIndexOverride, _state);
                                            Hash::hash(LocalSecondaryIndexOverride, _state);
                                            Hash::hash(ProvisionedThroughputOverride, _state);
                                            Hash::hash(OnDemandThroughputOverride, _state);
                                            Hash::hash(SSESpecificationOverride, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RestoreTableToPointInTimeInput {
                                fn default() -> RestoreTableToPointInTimeInput {
                                    RestoreTableToPointInTimeInput::RestoreTableToPointInTimeInput {
                                        SourceTableArn: Default::default(),
                                        SourceTableName: Default::default(),
                                        TargetTableName: Default::default(),
                                        UseLatestRestorableTime: Default::default(),
                                        RestoreDateTime: Default::default(),
                                        BillingModeOverride: Default::default(),
                                        GlobalSecondaryIndexOverride: Default::default(),
                                        LocalSecondaryIndexOverride: Default::default(),
                                        ProvisionedThroughputOverride: Default::default(),
                                        OnDemandThroughputOverride: Default::default(),
                                        SSESpecificationOverride: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RestoreTableToPointInTimeInput>
                                for RestoreTableToPointInTimeInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2392,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RestoreTableToPointInTimeOutput {
                                RestoreTableToPointInTimeOutput {
                                    TableDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>>
                                }
                            }

                            impl RestoreTableToPointInTimeOutput {
                                /// Returns a borrow of the field TableDescription
                                pub fn TableDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>> {
                                    match self {
                                        RestoreTableToPointInTimeOutput::RestoreTableToPointInTimeOutput{TableDescription, } => TableDescription,
                                    }
                                }
                            }

                            impl Debug
                                for RestoreTableToPointInTimeOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RestoreTableToPointInTimeOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RestoreTableToPointInTimeOutput::RestoreTableToPointInTimeOutput{TableDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableToPointInTimeOutput.RestoreTableToPointInTimeOutput(")?;
                                            DafnyPrint::fmt_print(TableDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RestoreTableToPointInTimeOutput {}

                            impl Hash
                                for RestoreTableToPointInTimeOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RestoreTableToPointInTimeOutput::RestoreTableToPointInTimeOutput{TableDescription, } => {
                                            Hash::hash(TableDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RestoreTableToPointInTimeOutput {
                                fn default() -> RestoreTableToPointInTimeOutput {
                                    RestoreTableToPointInTimeOutput::RestoreTableToPointInTimeOutput {
                                        TableDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RestoreTableToPointInTimeOutput>
                                for RestoreTableToPointInTimeOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2395,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReturnConsumedCapacity {
                                INDEXES {},
                                TOTAL {},
                                NONE {}
                            }

                            impl ReturnConsumedCapacity {}

                            impl Debug
                                for ReturnConsumedCapacity {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReturnConsumedCapacity {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReturnConsumedCapacity::INDEXES{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnConsumedCapacity.INDEXES")?;
                                            Ok(())
                                        },
                                        ReturnConsumedCapacity::TOTAL{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnConsumedCapacity.TOTAL")?;
                                            Ok(())
                                        },
                                        ReturnConsumedCapacity::NONE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnConsumedCapacity.NONE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ReturnConsumedCapacity {
                                /// Enumerates all possible values of ReturnConsumedCapacity
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ReturnConsumedCapacity>> {
                                    seq![Arc::new(ReturnConsumedCapacity::INDEXES {}), Arc::new(ReturnConsumedCapacity::TOTAL {}), Arc::new(ReturnConsumedCapacity::NONE {})].iter()
                                }
                            }

                            impl Eq
                                for ReturnConsumedCapacity {}

                            impl Hash
                                for ReturnConsumedCapacity {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReturnConsumedCapacity::INDEXES{} => {

                                        },
                                        ReturnConsumedCapacity::TOTAL{} => {

                                        },
                                        ReturnConsumedCapacity::NONE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReturnConsumedCapacity {
                                fn default() -> ReturnConsumedCapacity {
                                    ReturnConsumedCapacity::INDEXES {}
                                }
                            }

                            impl AsRef<ReturnConsumedCapacity>
                                for ReturnConsumedCapacity {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2399,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReturnItemCollectionMetrics {
                                SIZE {},
                                NONE {}
                            }

                            impl ReturnItemCollectionMetrics {}

                            impl Debug
                                for ReturnItemCollectionMetrics {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReturnItemCollectionMetrics {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReturnItemCollectionMetrics::SIZE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnItemCollectionMetrics.SIZE")?;
                                            Ok(())
                                        },
                                        ReturnItemCollectionMetrics::NONE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnItemCollectionMetrics.NONE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ReturnItemCollectionMetrics {
                                /// Enumerates all possible values of ReturnItemCollectionMetrics
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ReturnItemCollectionMetrics>> {
                                    seq![Arc::new(ReturnItemCollectionMetrics::SIZE {}), Arc::new(ReturnItemCollectionMetrics::NONE {})].iter()
                                }
                            }

                            impl Eq
                                for ReturnItemCollectionMetrics {}

                            impl Hash
                                for ReturnItemCollectionMetrics {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReturnItemCollectionMetrics::SIZE{} => {

                                        },
                                        ReturnItemCollectionMetrics::NONE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReturnItemCollectionMetrics {
                                fn default() -> ReturnItemCollectionMetrics {
                                    ReturnItemCollectionMetrics::SIZE {}
                                }
                            }

                            impl AsRef<ReturnItemCollectionMetrics>
                                for ReturnItemCollectionMetrics {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2402,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReturnValue {
                                NONE {},
                                ALL_OLD {},
                                UPDATED_OLD {},
                                ALL_NEW {},
                                UPDATED_NEW {}
                            }

                            impl ReturnValue {}

                            impl Debug
                                for ReturnValue {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReturnValue {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReturnValue::NONE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.NONE")?;
                                            Ok(())
                                        },
                                        ReturnValue::ALL_OLD{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.ALL__OLD")?;
                                            Ok(())
                                        },
                                        ReturnValue::UPDATED_OLD{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.UPDATED__OLD")?;
                                            Ok(())
                                        },
                                        ReturnValue::ALL_NEW{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.ALL__NEW")?;
                                            Ok(())
                                        },
                                        ReturnValue::UPDATED_NEW{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.UPDATED__NEW")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ReturnValue {
                                /// Enumerates all possible values of ReturnValue
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ReturnValue>> {
                                    seq![Arc::new(ReturnValue::NONE {}), Arc::new(ReturnValue::ALL_OLD {}), Arc::new(ReturnValue::UPDATED_OLD {}), Arc::new(ReturnValue::ALL_NEW {}), Arc::new(ReturnValue::UPDATED_NEW {})].iter()
                                }
                            }

                            impl Eq
                                for ReturnValue {}

                            impl Hash
                                for ReturnValue {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReturnValue::NONE{} => {

                                        },
                                        ReturnValue::ALL_OLD{} => {

                                        },
                                        ReturnValue::UPDATED_OLD{} => {

                                        },
                                        ReturnValue::ALL_NEW{} => {

                                        },
                                        ReturnValue::UPDATED_NEW{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReturnValue {
                                fn default() -> ReturnValue {
                                    ReturnValue::NONE {}
                                }
                            }

                            impl AsRef<ReturnValue>
                                for ReturnValue {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2408,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReturnValuesOnConditionCheckFailure {
                                ALL_OLD {},
                                NONE {}
                            }

                            impl ReturnValuesOnConditionCheckFailure {}

                            impl Debug
                                for ReturnValuesOnConditionCheckFailure {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReturnValuesOnConditionCheckFailure {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReturnValuesOnConditionCheckFailure::ALL_OLD{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValuesOnConditionCheckFailure.ALL__OLD")?;
                                            Ok(())
                                        },
                                        ReturnValuesOnConditionCheckFailure::NONE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValuesOnConditionCheckFailure.NONE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ReturnValuesOnConditionCheckFailure {
                                /// Enumerates all possible values of ReturnValuesOnConditionCheckFailure
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ReturnValuesOnConditionCheckFailure>> {
                                    seq![Arc::new(ReturnValuesOnConditionCheckFailure::ALL_OLD {}), Arc::new(ReturnValuesOnConditionCheckFailure::NONE {})].iter()
                                }
                            }

                            impl Eq
                                for ReturnValuesOnConditionCheckFailure {}

                            impl Hash
                                for ReturnValuesOnConditionCheckFailure {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReturnValuesOnConditionCheckFailure::ALL_OLD{} => {

                                        },
                                        ReturnValuesOnConditionCheckFailure::NONE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReturnValuesOnConditionCheckFailure {
                                fn default() -> ReturnValuesOnConditionCheckFailure {
                                    ReturnValuesOnConditionCheckFailure::ALL_OLD {}
                                }
                            }

                            impl AsRef<ReturnValuesOnConditionCheckFailure>
                                for ReturnValuesOnConditionCheckFailure {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2411,3)
                            pub type S3Bucket = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2416,3)
                            #[derive(PartialEq, Clone)]
                            pub enum S3BucketSource {
                                S3BucketSource {
                                    S3BucketOwner: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    S3Bucket: Sequence<DafnyCharUTF16>,
                                    S3KeyPrefix: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl S3BucketSource {
                                /// Returns a borrow of the field S3BucketOwner
                                pub fn S3BucketOwner(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        S3BucketSource::S3BucketSource{S3BucketOwner, S3Bucket, S3KeyPrefix, } => S3BucketOwner,
                                    }
                                }
                                /// Returns a borrow of the field S3Bucket
                                pub fn S3Bucket(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        S3BucketSource::S3BucketSource{S3BucketOwner, S3Bucket, S3KeyPrefix, } => S3Bucket,
                                    }
                                }
                                /// Returns a borrow of the field S3KeyPrefix
                                pub fn S3KeyPrefix(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        S3BucketSource::S3BucketSource{S3BucketOwner, S3Bucket, S3KeyPrefix, } => S3KeyPrefix,
                                    }
                                }
                            }

                            impl Debug
                                for S3BucketSource {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for S3BucketSource {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        S3BucketSource::S3BucketSource{S3BucketOwner, S3Bucket, S3KeyPrefix, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.S3BucketSource.S3BucketSource(")?;
                                            DafnyPrint::fmt_print(S3BucketOwner, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3Bucket, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(S3KeyPrefix, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for S3BucketSource {}

                            impl Hash
                                for S3BucketSource {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        S3BucketSource::S3BucketSource{S3BucketOwner, S3Bucket, S3KeyPrefix, } => {
                                            Hash::hash(S3BucketOwner, _state);
                                            Hash::hash(S3Bucket, _state);
                                            Hash::hash(S3KeyPrefix, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for S3BucketSource {
                                fn default() -> S3BucketSource {
                                    S3BucketSource::S3BucketSource {
                                        S3BucketOwner: Default::default(),
                                        S3Bucket: Default::default(),
                                        S3KeyPrefix: Default::default()
                                    }
                                }
                            }

                            impl AsRef<S3BucketSource>
                                for S3BucketSource {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2421,3)
                            pub type S3Prefix = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2425,3)
                            #[derive(PartialEq, Clone)]
                            pub enum S3SseAlgorithm {
                                AES256 {},
                                KMS {}
                            }

                            impl S3SseAlgorithm {}

                            impl Debug
                                for S3SseAlgorithm {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for S3SseAlgorithm {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        S3SseAlgorithm::AES256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.S3SseAlgorithm.AES256")?;
                                            Ok(())
                                        },
                                        S3SseAlgorithm::KMS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.S3SseAlgorithm.KMS")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl S3SseAlgorithm {
                                /// Enumerates all possible values of S3SseAlgorithm
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<S3SseAlgorithm>> {
                                    seq![Arc::new(S3SseAlgorithm::AES256 {}), Arc::new(S3SseAlgorithm::KMS {})].iter()
                                }
                            }

                            impl Eq
                                for S3SseAlgorithm {}

                            impl Hash
                                for S3SseAlgorithm {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        S3SseAlgorithm::AES256{} => {

                                        },
                                        S3SseAlgorithm::KMS{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for S3SseAlgorithm {
                                fn default() -> S3SseAlgorithm {
                                    S3SseAlgorithm::AES256 {}
                                }
                            }

                            impl AsRef<S3SseAlgorithm>
                                for S3SseAlgorithm {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2428,3)
                            pub type S3SseKmsKeyId = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2432,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ScalarAttributeType {
                                S {},
                                N {},
                                B {}
                            }

                            impl ScalarAttributeType {}

                            impl Debug
                                for ScalarAttributeType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ScalarAttributeType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ScalarAttributeType::S{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ScalarAttributeType.S")?;
                                            Ok(())
                                        },
                                        ScalarAttributeType::N{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ScalarAttributeType.N")?;
                                            Ok(())
                                        },
                                        ScalarAttributeType::B{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ScalarAttributeType.B")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ScalarAttributeType {
                                /// Enumerates all possible values of ScalarAttributeType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ScalarAttributeType>> {
                                    seq![Arc::new(ScalarAttributeType::S {}), Arc::new(ScalarAttributeType::N {}), Arc::new(ScalarAttributeType::B {})].iter()
                                }
                            }

                            impl Eq
                                for ScalarAttributeType {}

                            impl Hash
                                for ScalarAttributeType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ScalarAttributeType::S{} => {

                                        },
                                        ScalarAttributeType::N{} => {

                                        },
                                        ScalarAttributeType::B{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ScalarAttributeType {
                                fn default() -> ScalarAttributeType {
                                    ScalarAttributeType::S {}
                                }
                            }

                            impl AsRef<ScalarAttributeType>
                                for ScalarAttributeType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2436,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ScanInput {
                                ScanInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    AttributesToGet: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeNameList>>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveIntegerObject>>,
                                    Select: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Select>>>,
                                    ScanFilter: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Condition>>>>,
                                    ConditionalOperator: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator>>>,
                                    ExclusiveStartKey: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>,
                                    TotalSegments: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanTotalSegments>>,
                                    Segment: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanSegment>>,
                                    ProjectionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    FilterExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    ExpressionAttributeValues: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ConsistentRead: Arc<Option<bool>>
                                }
                            }

                            impl ScanInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field AttributesToGet
                                pub fn AttributesToGet(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeNameList>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => AttributesToGet,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveIntegerObject>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field Select
                                pub fn Select(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Select>>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => Select,
                                    }
                                }
                                /// Returns a borrow of the field ScanFilter
                                pub fn ScanFilter(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Condition>>>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => ScanFilter,
                                    }
                                }
                                /// Returns a borrow of the field ConditionalOperator
                                pub fn ConditionalOperator(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator>>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => ConditionalOperator,
                                    }
                                }
                                /// Returns a borrow of the field ExclusiveStartKey
                                pub fn ExclusiveStartKey(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => ExclusiveStartKey,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => ReturnConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field TotalSegments
                                pub fn TotalSegments(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanTotalSegments>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => TotalSegments,
                                    }
                                }
                                /// Returns a borrow of the field Segment
                                pub fn Segment(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ScanSegment>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => Segment,
                                    }
                                }
                                /// Returns a borrow of the field ProjectionExpression
                                pub fn ProjectionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => ProjectionExpression,
                                    }
                                }
                                /// Returns a borrow of the field FilterExpression
                                pub fn FilterExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => FilterExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => ExpressionAttributeNames,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeValues
                                pub fn ExpressionAttributeValues(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => ExpressionAttributeValues,
                                    }
                                }
                                /// Returns a borrow of the field ConsistentRead
                                pub fn ConsistentRead(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => ConsistentRead,
                                    }
                                }
                            }

                            impl Debug
                                for ScanInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ScanInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ScanInput.ScanInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttributesToGet, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Select, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ScanFilter, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionalOperator, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExclusiveStartKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TotalSegments, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Segment, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProjectionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(FilterExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsistentRead, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ScanInput {}

                            impl Hash
                                for ScanInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ScanInput::ScanInput{TableName, IndexName, AttributesToGet, Limit, Select, ScanFilter, ConditionalOperator, ExclusiveStartKey, ReturnConsumedCapacity, TotalSegments, Segment, ProjectionExpression, FilterExpression, ExpressionAttributeNames, ExpressionAttributeValues, ConsistentRead, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(AttributesToGet, _state);
                                            Hash::hash(Limit, _state);
                                            Hash::hash(Select, _state);
                                            Hash::hash(ScanFilter, _state);
                                            Hash::hash(ConditionalOperator, _state);
                                            Hash::hash(ExclusiveStartKey, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state);
                                            Hash::hash(TotalSegments, _state);
                                            Hash::hash(Segment, _state);
                                            Hash::hash(ProjectionExpression, _state);
                                            Hash::hash(FilterExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state);
                                            Hash::hash(ExpressionAttributeValues, _state);
                                            Hash::hash(ConsistentRead, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ScanInput {
                                fn default() -> ScanInput {
                                    ScanInput::ScanInput {
                                        TableName: Default::default(),
                                        IndexName: Default::default(),
                                        AttributesToGet: Default::default(),
                                        Limit: Default::default(),
                                        Select: Default::default(),
                                        ScanFilter: Default::default(),
                                        ConditionalOperator: Default::default(),
                                        ExclusiveStartKey: Default::default(),
                                        ReturnConsumedCapacity: Default::default(),
                                        TotalSegments: Default::default(),
                                        Segment: Default::default(),
                                        ProjectionExpression: Default::default(),
                                        FilterExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default(),
                                        ExpressionAttributeValues: Default::default(),
                                        ConsistentRead: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ScanInput>
                                for ScanInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2454,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ScanOutput {
                                ScanOutput {
                                    Items: Arc<Option<Sequence<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>>,
                                    Count: Arc<Option<i32>>,
                                    ScannedCount: Arc<Option<i32>>,
                                    LastEvaluatedKey: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>
                                }
                            }

                            impl ScanOutput {
                                /// Returns a borrow of the field Items
                                pub fn Items(&self) -> &Arc<Option<Sequence<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>> {
                                    match self {
                                        ScanOutput::ScanOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => Items,
                                    }
                                }
                                /// Returns a borrow of the field Count
                                pub fn Count(&self) -> &Arc<Option<i32>> {
                                    match self {
                                        ScanOutput::ScanOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => Count,
                                    }
                                }
                                /// Returns a borrow of the field ScannedCount
                                pub fn ScannedCount(&self) -> &Arc<Option<i32>> {
                                    match self {
                                        ScanOutput::ScanOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => ScannedCount,
                                    }
                                }
                                /// Returns a borrow of the field LastEvaluatedKey
                                pub fn LastEvaluatedKey(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        ScanOutput::ScanOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => LastEvaluatedKey,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>> {
                                    match self {
                                        ScanOutput::ScanOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => ConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for ScanOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ScanOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ScanOutput::ScanOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.ScanOutput.ScanOutput(")?;
                                            DafnyPrint::fmt_print(Items, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Count, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ScannedCount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastEvaluatedKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ScanOutput {}

                            impl Hash
                                for ScanOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ScanOutput::ScanOutput{Items, Count, ScannedCount, LastEvaluatedKey, ConsumedCapacity, } => {
                                            Hash::hash(Items, _state);
                                            Hash::hash(Count, _state);
                                            Hash::hash(ScannedCount, _state);
                                            Hash::hash(LastEvaluatedKey, _state);
                                            Hash::hash(ConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ScanOutput {
                                fn default() -> ScanOutput {
                                    ScanOutput::ScanOutput {
                                        Items: Default::default(),
                                        Count: Default::default(),
                                        ScannedCount: Default::default(),
                                        LastEvaluatedKey: Default::default(),
                                        ConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ScanOutput>
                                for ScanOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2461,3)
                            pub type ScanSegment = i32;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2465,3)
                            pub type ScanTotalSegments = i32;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2470,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Select {
                                ALL_ATTRIBUTES {},
                                ALL_PROJECTED_ATTRIBUTES {},
                                SPECIFIC_ATTRIBUTES {},
                                COUNT {}
                            }

                            impl Select {}

                            impl Debug
                                for Select {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Select {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Select::ALL_ATTRIBUTES{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Select.ALL__ATTRIBUTES")?;
                                            Ok(())
                                        },
                                        Select::ALL_PROJECTED_ATTRIBUTES{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Select.ALL__PROJECTED__ATTRIBUTES")?;
                                            Ok(())
                                        },
                                        Select::SPECIFIC_ATTRIBUTES{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Select.SPECIFIC__ATTRIBUTES")?;
                                            Ok(())
                                        },
                                        Select::COUNT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Select.COUNT")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Select {
                                /// Enumerates all possible values of Select
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<Select>> {
                                    seq![Arc::new(Select::ALL_ATTRIBUTES {}), Arc::new(Select::ALL_PROJECTED_ATTRIBUTES {}), Arc::new(Select::SPECIFIC_ATTRIBUTES {}), Arc::new(Select::COUNT {})].iter()
                                }
                            }

                            impl Eq
                                for Select {}

                            impl Hash
                                for Select {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Select::ALL_ATTRIBUTES{} => {

                                        },
                                        Select::ALL_PROJECTED_ATTRIBUTES{} => {

                                        },
                                        Select::SPECIFIC_ATTRIBUTES{} => {

                                        },
                                        Select::COUNT{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for Select {
                                fn default() -> Select {
                                    Select::ALL_ATTRIBUTES {}
                                }
                            }

                            impl AsRef<Select>
                                for Select {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2475,3)
                            #[derive(PartialEq, Clone)]
                            pub enum SourceTableDetails {
                                SourceTableDetails {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    TableId: Sequence<DafnyCharUTF16>,
                                    TableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TableSizeBytes: Arc<Option<i64>>,
                                    KeySchema: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema,
                                    TableCreationDateTime: Sequence<DafnyCharUTF16>,
                                    ProvisionedThroughput: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>,
                                    OnDemandThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>,
                                    ItemCount: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCount>>,
                                    BillingMode: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>>
                                }
                            }

                            impl SourceTableDetails {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field TableId
                                pub fn TableId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => TableId,
                                    }
                                }
                                /// Returns a borrow of the field TableArn
                                pub fn TableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => TableArn,
                                    }
                                }
                                /// Returns a borrow of the field TableSizeBytes
                                pub fn TableSizeBytes(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => TableSizeBytes,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field TableCreationDateTime
                                pub fn TableCreationDateTime(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => TableCreationDateTime,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughput
                                pub fn ProvisionedThroughput(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput> {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => ProvisionedThroughput,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughput
                                pub fn OnDemandThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => OnDemandThroughput,
                                    }
                                }
                                /// Returns a borrow of the field ItemCount
                                pub fn ItemCount(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCount>> {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => ItemCount,
                                    }
                                }
                                /// Returns a borrow of the field BillingMode
                                pub fn BillingMode(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>> {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => BillingMode,
                                    }
                                }
                            }

                            impl Debug
                                for SourceTableDetails {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for SourceTableDetails {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SourceTableDetails.SourceTableDetails(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableSizeBytes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableCreationDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ItemCount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BillingMode, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for SourceTableDetails {}

                            impl Hash
                                for SourceTableDetails {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        SourceTableDetails::SourceTableDetails{TableName, TableId, TableArn, TableSizeBytes, KeySchema, TableCreationDateTime, ProvisionedThroughput, OnDemandThroughput, ItemCount, BillingMode, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(TableId, _state);
                                            Hash::hash(TableArn, _state);
                                            Hash::hash(TableSizeBytes, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(TableCreationDateTime, _state);
                                            Hash::hash(ProvisionedThroughput, _state);
                                            Hash::hash(OnDemandThroughput, _state);
                                            Hash::hash(ItemCount, _state);
                                            Hash::hash(BillingMode, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for SourceTableDetails {
                                fn default() -> SourceTableDetails {
                                    SourceTableDetails::SourceTableDetails {
                                        TableName: Default::default(),
                                        TableId: Default::default(),
                                        TableArn: Default::default(),
                                        TableSizeBytes: Default::default(),
                                        KeySchema: Default::default(),
                                        TableCreationDateTime: Default::default(),
                                        ProvisionedThroughput: Default::default(),
                                        OnDemandThroughput: Default::default(),
                                        ItemCount: Default::default(),
                                        BillingMode: Default::default()
                                    }
                                }
                            }

                            impl AsRef<SourceTableDetails>
                                for SourceTableDetails {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2487,3)
                            #[derive(PartialEq, Clone)]
                            pub enum SourceTableFeatureDetails {
                                SourceTableFeatureDetails {
                                    LocalSecondaryIndexes: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndexInfo>>>>,
                                    GlobalSecondaryIndexes: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexInfo>>>>,
                                    StreamDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification>>>,
                                    TimeToLiveDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TimeToLiveDescription>>>,
                                    SSEDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEDescription>>>
                                }
                            }

                            impl SourceTableFeatureDetails {
                                /// Returns a borrow of the field LocalSecondaryIndexes
                                pub fn LocalSecondaryIndexes(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndexInfo>>>> {
                                    match self {
                                        SourceTableFeatureDetails::SourceTableFeatureDetails{LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamDescription, TimeToLiveDescription, SSEDescription, } => LocalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexes
                                pub fn GlobalSecondaryIndexes(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexInfo>>>> {
                                    match self {
                                        SourceTableFeatureDetails::SourceTableFeatureDetails{LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamDescription, TimeToLiveDescription, SSEDescription, } => GlobalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field StreamDescription
                                pub fn StreamDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification>>> {
                                    match self {
                                        SourceTableFeatureDetails::SourceTableFeatureDetails{LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamDescription, TimeToLiveDescription, SSEDescription, } => StreamDescription,
                                    }
                                }
                                /// Returns a borrow of the field TimeToLiveDescription
                                pub fn TimeToLiveDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TimeToLiveDescription>>> {
                                    match self {
                                        SourceTableFeatureDetails::SourceTableFeatureDetails{LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamDescription, TimeToLiveDescription, SSEDescription, } => TimeToLiveDescription,
                                    }
                                }
                                /// Returns a borrow of the field SSEDescription
                                pub fn SSEDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEDescription>>> {
                                    match self {
                                        SourceTableFeatureDetails::SourceTableFeatureDetails{LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamDescription, TimeToLiveDescription, SSEDescription, } => SSEDescription,
                                    }
                                }
                            }

                            impl Debug
                                for SourceTableFeatureDetails {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for SourceTableFeatureDetails {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        SourceTableFeatureDetails::SourceTableFeatureDetails{LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamDescription, TimeToLiveDescription, SSEDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SourceTableFeatureDetails.SourceTableFeatureDetails(")?;
                                            DafnyPrint::fmt_print(LocalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamDescription, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TimeToLiveDescription, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SSEDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for SourceTableFeatureDetails {}

                            impl Hash
                                for SourceTableFeatureDetails {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        SourceTableFeatureDetails::SourceTableFeatureDetails{LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamDescription, TimeToLiveDescription, SSEDescription, } => {
                                            Hash::hash(LocalSecondaryIndexes, _state);
                                            Hash::hash(GlobalSecondaryIndexes, _state);
                                            Hash::hash(StreamDescription, _state);
                                            Hash::hash(TimeToLiveDescription, _state);
                                            Hash::hash(SSEDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for SourceTableFeatureDetails {
                                fn default() -> SourceTableFeatureDetails {
                                    SourceTableFeatureDetails::SourceTableFeatureDetails {
                                        LocalSecondaryIndexes: Default::default(),
                                        GlobalSecondaryIndexes: Default::default(),
                                        StreamDescription: Default::default(),
                                        TimeToLiveDescription: Default::default(),
                                        SSEDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<SourceTableFeatureDetails>
                                for SourceTableFeatureDetails {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2494,3)
                            #[derive(PartialEq, Clone)]
                            pub enum SSEDescription {
                                SSEDescription {
                                    Status: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus>>>,
                                    SSEType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEType>>>,
                                    KMSMasterKeyArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    InaccessibleEncryptionDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl SSEDescription {
                                /// Returns a borrow of the field Status
                                pub fn Status(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEStatus>>> {
                                    match self {
                                        SSEDescription::SSEDescription{Status, SSEType, KMSMasterKeyArn, InaccessibleEncryptionDateTime, } => Status,
                                    }
                                }
                                /// Returns a borrow of the field SSEType
                                pub fn SSEType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEType>>> {
                                    match self {
                                        SSEDescription::SSEDescription{Status, SSEType, KMSMasterKeyArn, InaccessibleEncryptionDateTime, } => SSEType,
                                    }
                                }
                                /// Returns a borrow of the field KMSMasterKeyArn
                                pub fn KMSMasterKeyArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        SSEDescription::SSEDescription{Status, SSEType, KMSMasterKeyArn, InaccessibleEncryptionDateTime, } => KMSMasterKeyArn,
                                    }
                                }
                                /// Returns a borrow of the field InaccessibleEncryptionDateTime
                                pub fn InaccessibleEncryptionDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        SSEDescription::SSEDescription{Status, SSEType, KMSMasterKeyArn, InaccessibleEncryptionDateTime, } => InaccessibleEncryptionDateTime,
                                    }
                                }
                            }

                            impl Debug
                                for SSEDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for SSEDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        SSEDescription::SSEDescription{Status, SSEType, KMSMasterKeyArn, InaccessibleEncryptionDateTime, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEDescription.SSEDescription(")?;
                                            DafnyPrint::fmt_print(Status, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SSEType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KMSMasterKeyArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(InaccessibleEncryptionDateTime, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for SSEDescription {}

                            impl Hash
                                for SSEDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        SSEDescription::SSEDescription{Status, SSEType, KMSMasterKeyArn, InaccessibleEncryptionDateTime, } => {
                                            Hash::hash(Status, _state);
                                            Hash::hash(SSEType, _state);
                                            Hash::hash(KMSMasterKeyArn, _state);
                                            Hash::hash(InaccessibleEncryptionDateTime, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for SSEDescription {
                                fn default() -> SSEDescription {
                                    SSEDescription::SSEDescription {
                                        Status: Default::default(),
                                        SSEType: Default::default(),
                                        KMSMasterKeyArn: Default::default(),
                                        InaccessibleEncryptionDateTime: Default::default()
                                    }
                                }
                            }

                            impl AsRef<SSEDescription>
                                for SSEDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2501,3)
                            #[derive(PartialEq, Clone)]
                            pub enum SSESpecification {
                                SSESpecification {
                                    Enabled: Arc<Option<bool>>,
                                    SSEType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEType>>>,
                                    KMSMasterKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl SSESpecification {
                                /// Returns a borrow of the field Enabled
                                pub fn Enabled(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        SSESpecification::SSESpecification{Enabled, SSEType, KMSMasterKeyId, } => Enabled,
                                    }
                                }
                                /// Returns a borrow of the field SSEType
                                pub fn SSEType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEType>>> {
                                    match self {
                                        SSESpecification::SSESpecification{Enabled, SSEType, KMSMasterKeyId, } => SSEType,
                                    }
                                }
                                /// Returns a borrow of the field KMSMasterKeyId
                                pub fn KMSMasterKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        SSESpecification::SSESpecification{Enabled, SSEType, KMSMasterKeyId, } => KMSMasterKeyId,
                                    }
                                }
                            }

                            impl Debug
                                for SSESpecification {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for SSESpecification {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        SSESpecification::SSESpecification{Enabled, SSEType, KMSMasterKeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SSESpecification.SSESpecification(")?;
                                            DafnyPrint::fmt_print(Enabled, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SSEType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KMSMasterKeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for SSESpecification {}

                            impl Hash
                                for SSESpecification {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        SSESpecification::SSESpecification{Enabled, SSEType, KMSMasterKeyId, } => {
                                            Hash::hash(Enabled, _state);
                                            Hash::hash(SSEType, _state);
                                            Hash::hash(KMSMasterKeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for SSESpecification {
                                fn default() -> SSESpecification {
                                    SSESpecification::SSESpecification {
                                        Enabled: Default::default(),
                                        SSEType: Default::default(),
                                        KMSMasterKeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<SSESpecification>
                                for SSESpecification {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2506,3)
                            #[derive(PartialEq, Clone)]
                            pub enum SSEStatus {
                                ENABLING {},
                                ENABLED {},
                                DISABLING {},
                                DISABLED {},
                                UPDATING {}
                            }

                            impl SSEStatus {}

                            impl Debug
                                for SSEStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for SSEStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        SSEStatus::ENABLING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEStatus.ENABLING")?;
                                            Ok(())
                                        },
                                        SSEStatus::ENABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEStatus.ENABLED")?;
                                            Ok(())
                                        },
                                        SSEStatus::DISABLING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEStatus.DISABLING")?;
                                            Ok(())
                                        },
                                        SSEStatus::DISABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEStatus.DISABLED")?;
                                            Ok(())
                                        },
                                        SSEStatus::UPDATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEStatus.UPDATING")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl SSEStatus {
                                /// Enumerates all possible values of SSEStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<SSEStatus>> {
                                    seq![Arc::new(SSEStatus::ENABLING {}), Arc::new(SSEStatus::ENABLED {}), Arc::new(SSEStatus::DISABLING {}), Arc::new(SSEStatus::DISABLED {}), Arc::new(SSEStatus::UPDATING {})].iter()
                                }
                            }

                            impl Eq
                                for SSEStatus {}

                            impl Hash
                                for SSEStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        SSEStatus::ENABLING{} => {

                                        },
                                        SSEStatus::ENABLED{} => {

                                        },
                                        SSEStatus::DISABLING{} => {

                                        },
                                        SSEStatus::DISABLED{} => {

                                        },
                                        SSEStatus::UPDATING{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for SSEStatus {
                                fn default() -> SSEStatus {
                                    SSEStatus::ENABLING {}
                                }
                            }

                            impl AsRef<SSEStatus>
                                for SSEStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2512,3)
                            #[derive(PartialEq, Clone)]
                            pub enum SSEType {
                                AES256 {},
                                KMS {}
                            }

                            impl SSEType {}

                            impl Debug
                                for SSEType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for SSEType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        SSEType::AES256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEType.AES256")?;
                                            Ok(())
                                        },
                                        SSEType::KMS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEType.KMS")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl SSEType {
                                /// Enumerates all possible values of SSEType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<SSEType>> {
                                    seq![Arc::new(SSEType::AES256 {}), Arc::new(SSEType::KMS {})].iter()
                                }
                            }

                            impl Eq
                                for SSEType {}

                            impl Hash
                                for SSEType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        SSEType::AES256{} => {

                                        },
                                        SSEType::KMS{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for SSEType {
                                fn default() -> SSEType {
                                    SSEType::AES256 {}
                                }
                            }

                            impl AsRef<SSEType>
                                for SSEType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2515,3)
                            pub type StreamArn = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2520,3)
                            #[derive(PartialEq, Clone)]
                            pub enum StreamSpecification {
                                StreamSpecification {
                                    StreamEnabled: bool,
                                    StreamViewType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType>>>
                                }
                            }

                            impl StreamSpecification {
                                /// Returns a borrow of the field StreamEnabled
                                pub fn StreamEnabled(&self) -> &bool {
                                    match self {
                                        StreamSpecification::StreamSpecification{StreamEnabled, StreamViewType, } => StreamEnabled,
                                    }
                                }
                                /// Returns a borrow of the field StreamViewType
                                pub fn StreamViewType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamViewType>>> {
                                    match self {
                                        StreamSpecification::StreamSpecification{StreamEnabled, StreamViewType, } => StreamViewType,
                                    }
                                }
                            }

                            impl Debug
                                for StreamSpecification {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for StreamSpecification {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        StreamSpecification::StreamSpecification{StreamEnabled, StreamViewType, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.StreamSpecification.StreamSpecification(")?;
                                            DafnyPrint::fmt_print(StreamEnabled, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamViewType, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for StreamSpecification {}

                            impl Hash
                                for StreamSpecification {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        StreamSpecification::StreamSpecification{StreamEnabled, StreamViewType, } => {
                                            Hash::hash(StreamEnabled, _state);
                                            Hash::hash(StreamViewType, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for StreamSpecification {
                                fn default() -> StreamSpecification {
                                    StreamSpecification::StreamSpecification {
                                        StreamEnabled: Default::default(),
                                        StreamViewType: Default::default()
                                    }
                                }
                            }

                            impl AsRef<StreamSpecification>
                                for StreamSpecification {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2524,3)
                            #[derive(PartialEq, Clone)]
                            pub enum StreamViewType {
                                NEW_IMAGE {},
                                OLD_IMAGE {},
                                NEW_AND_OLD_IMAGES {},
                                KEYS_ONLY {}
                            }

                            impl StreamViewType {}

                            impl Debug
                                for StreamViewType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for StreamViewType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        StreamViewType::NEW_IMAGE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.StreamViewType.NEW__IMAGE")?;
                                            Ok(())
                                        },
                                        StreamViewType::OLD_IMAGE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.StreamViewType.OLD__IMAGE")?;
                                            Ok(())
                                        },
                                        StreamViewType::NEW_AND_OLD_IMAGES{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.StreamViewType.NEW__AND__OLD__IMAGES")?;
                                            Ok(())
                                        },
                                        StreamViewType::KEYS_ONLY{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.StreamViewType.KEYS__ONLY")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl StreamViewType {
                                /// Enumerates all possible values of StreamViewType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<StreamViewType>> {
                                    seq![Arc::new(StreamViewType::NEW_IMAGE {}), Arc::new(StreamViewType::OLD_IMAGE {}), Arc::new(StreamViewType::NEW_AND_OLD_IMAGES {}), Arc::new(StreamViewType::KEYS_ONLY {})].iter()
                                }
                            }

                            impl Eq
                                for StreamViewType {}

                            impl Hash
                                for StreamViewType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        StreamViewType::NEW_IMAGE{} => {

                                        },
                                        StreamViewType::OLD_IMAGE{} => {

                                        },
                                        StreamViewType::NEW_AND_OLD_IMAGES{} => {

                                        },
                                        StreamViewType::KEYS_ONLY{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for StreamViewType {
                                fn default() -> StreamViewType {
                                    StreamViewType::NEW_IMAGE {}
                                }
                            }

                            impl AsRef<StreamViewType>
                                for StreamViewType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2532,3)
                            pub type TableArn = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2536,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TableAutoScalingDescription {
                                TableAutoScalingDescription {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TableStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus>>>,
                                    Replicas: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaAutoScalingDescription>>>>
                                }
                            }

                            impl TableAutoScalingDescription {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TableAutoScalingDescription::TableAutoScalingDescription{TableName, TableStatus, Replicas, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field TableStatus
                                pub fn TableStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus>>> {
                                    match self {
                                        TableAutoScalingDescription::TableAutoScalingDescription{TableName, TableStatus, Replicas, } => TableStatus,
                                    }
                                }
                                /// Returns a borrow of the field Replicas
                                pub fn Replicas(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaAutoScalingDescription>>>> {
                                    match self {
                                        TableAutoScalingDescription::TableAutoScalingDescription{TableName, TableStatus, Replicas, } => Replicas,
                                    }
                                }
                            }

                            impl Debug
                                for TableAutoScalingDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TableAutoScalingDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TableAutoScalingDescription::TableAutoScalingDescription{TableName, TableStatus, Replicas, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableAutoScalingDescription.TableAutoScalingDescription(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Replicas, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TableAutoScalingDescription {}

                            impl Hash
                                for TableAutoScalingDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TableAutoScalingDescription::TableAutoScalingDescription{TableName, TableStatus, Replicas, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(TableStatus, _state);
                                            Hash::hash(Replicas, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TableAutoScalingDescription {
                                fn default() -> TableAutoScalingDescription {
                                    TableAutoScalingDescription::TableAutoScalingDescription {
                                        TableName: Default::default(),
                                        TableStatus: Default::default(),
                                        Replicas: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TableAutoScalingDescription>
                                for TableAutoScalingDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2541,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TableClass {
                                STANDARD {},
                                STANDARD_INFREQUENT_ACCESS {}
                            }

                            impl TableClass {}

                            impl Debug
                                for TableClass {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TableClass {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TableClass::STANDARD{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableClass.STANDARD")?;
                                            Ok(())
                                        },
                                        TableClass::STANDARD_INFREQUENT_ACCESS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableClass.STANDARD__INFREQUENT__ACCESS")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl TableClass {
                                /// Enumerates all possible values of TableClass
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<TableClass>> {
                                    seq![Arc::new(TableClass::STANDARD {}), Arc::new(TableClass::STANDARD_INFREQUENT_ACCESS {})].iter()
                                }
                            }

                            impl Eq
                                for TableClass {}

                            impl Hash
                                for TableClass {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TableClass::STANDARD{} => {

                                        },
                                        TableClass::STANDARD_INFREQUENT_ACCESS{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for TableClass {
                                fn default() -> TableClass {
                                    TableClass::STANDARD {}
                                }
                            }

                            impl AsRef<TableClass>
                                for TableClass {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2544,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TableClassSummary {
                                TableClassSummary {
                                    TableClass: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>>,
                                    LastUpdateDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl TableClassSummary {
                                /// Returns a borrow of the field TableClass
                                pub fn TableClass(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>> {
                                    match self {
                                        TableClassSummary::TableClassSummary{TableClass, LastUpdateDateTime, } => TableClass,
                                    }
                                }
                                /// Returns a borrow of the field LastUpdateDateTime
                                pub fn LastUpdateDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TableClassSummary::TableClassSummary{TableClass, LastUpdateDateTime, } => LastUpdateDateTime,
                                    }
                                }
                            }

                            impl Debug
                                for TableClassSummary {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TableClassSummary {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TableClassSummary::TableClassSummary{TableClass, LastUpdateDateTime, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableClassSummary.TableClassSummary(")?;
                                            DafnyPrint::fmt_print(TableClass, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastUpdateDateTime, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TableClassSummary {}

                            impl Hash
                                for TableClassSummary {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TableClassSummary::TableClassSummary{TableClass, LastUpdateDateTime, } => {
                                            Hash::hash(TableClass, _state);
                                            Hash::hash(LastUpdateDateTime, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TableClassSummary {
                                fn default() -> TableClassSummary {
                                    TableClassSummary::TableClassSummary {
                                        TableClass: Default::default(),
                                        LastUpdateDateTime: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TableClassSummary>
                                for TableClassSummary {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2548,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TableCreationParameters {
                                TableCreationParameters {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    AttributeDefinitions: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition>>,
                                    KeySchema: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema,
                                    BillingMode: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>>,
                                    ProvisionedThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>>,
                                    OnDemandThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>,
                                    SSESpecification: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification>>>,
                                    GlobalSecondaryIndexes: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex>>>>
                                }
                            }

                            impl TableCreationParameters {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        TableCreationParameters::TableCreationParameters{TableName, AttributeDefinitions, KeySchema, BillingMode, ProvisionedThroughput, OnDemandThroughput, SSESpecification, GlobalSecondaryIndexes, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field AttributeDefinitions
                                pub fn AttributeDefinitions(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition>> {
                                    match self {
                                        TableCreationParameters::TableCreationParameters{TableName, AttributeDefinitions, KeySchema, BillingMode, ProvisionedThroughput, OnDemandThroughput, SSESpecification, GlobalSecondaryIndexes, } => AttributeDefinitions,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema {
                                    match self {
                                        TableCreationParameters::TableCreationParameters{TableName, AttributeDefinitions, KeySchema, BillingMode, ProvisionedThroughput, OnDemandThroughput, SSESpecification, GlobalSecondaryIndexes, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field BillingMode
                                pub fn BillingMode(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>> {
                                    match self {
                                        TableCreationParameters::TableCreationParameters{TableName, AttributeDefinitions, KeySchema, BillingMode, ProvisionedThroughput, OnDemandThroughput, SSESpecification, GlobalSecondaryIndexes, } => BillingMode,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughput
                                pub fn ProvisionedThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>> {
                                    match self {
                                        TableCreationParameters::TableCreationParameters{TableName, AttributeDefinitions, KeySchema, BillingMode, ProvisionedThroughput, OnDemandThroughput, SSESpecification, GlobalSecondaryIndexes, } => ProvisionedThroughput,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughput
                                pub fn OnDemandThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        TableCreationParameters::TableCreationParameters{TableName, AttributeDefinitions, KeySchema, BillingMode, ProvisionedThroughput, OnDemandThroughput, SSESpecification, GlobalSecondaryIndexes, } => OnDemandThroughput,
                                    }
                                }
                                /// Returns a borrow of the field SSESpecification
                                pub fn SSESpecification(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification>>> {
                                    match self {
                                        TableCreationParameters::TableCreationParameters{TableName, AttributeDefinitions, KeySchema, BillingMode, ProvisionedThroughput, OnDemandThroughput, SSESpecification, GlobalSecondaryIndexes, } => SSESpecification,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexes
                                pub fn GlobalSecondaryIndexes(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex>>>> {
                                    match self {
                                        TableCreationParameters::TableCreationParameters{TableName, AttributeDefinitions, KeySchema, BillingMode, ProvisionedThroughput, OnDemandThroughput, SSESpecification, GlobalSecondaryIndexes, } => GlobalSecondaryIndexes,
                                    }
                                }
                            }

                            impl Debug
                                for TableCreationParameters {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TableCreationParameters {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TableCreationParameters::TableCreationParameters{TableName, AttributeDefinitions, KeySchema, BillingMode, ProvisionedThroughput, OnDemandThroughput, SSESpecification, GlobalSecondaryIndexes, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableCreationParameters.TableCreationParameters(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttributeDefinitions, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BillingMode, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SSESpecification, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TableCreationParameters {}

                            impl Hash
                                for TableCreationParameters {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TableCreationParameters::TableCreationParameters{TableName, AttributeDefinitions, KeySchema, BillingMode, ProvisionedThroughput, OnDemandThroughput, SSESpecification, GlobalSecondaryIndexes, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(AttributeDefinitions, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(BillingMode, _state);
                                            Hash::hash(ProvisionedThroughput, _state);
                                            Hash::hash(OnDemandThroughput, _state);
                                            Hash::hash(SSESpecification, _state);
                                            Hash::hash(GlobalSecondaryIndexes, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TableCreationParameters {
                                fn default() -> TableCreationParameters {
                                    TableCreationParameters::TableCreationParameters {
                                        TableName: Default::default(),
                                        AttributeDefinitions: Default::default(),
                                        KeySchema: Default::default(),
                                        BillingMode: Default::default(),
                                        ProvisionedThroughput: Default::default(),
                                        OnDemandThroughput: Default::default(),
                                        SSESpecification: Default::default(),
                                        GlobalSecondaryIndexes: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TableCreationParameters>
                                for TableCreationParameters {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2558,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TableDescription {
                                TableDescription {
                                    AttributeDefinitions: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition>>>>,
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeySchema: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema>>,
                                    TableStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus>>>,
                                    CreationDateTime: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ProvisionedThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputDescription>>>,
                                    TableSizeBytes: Arc<Option<i64>>,
                                    ItemCount: Arc<Option<i64>>,
                                    TableArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TableId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    BillingModeSummary: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingModeSummary>>>,
                                    LocalSecondaryIndexes: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndexDescription>>>>,
                                    GlobalSecondaryIndexes: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexDescription>>>>,
                                    StreamSpecification: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification>>>,
                                    LatestStreamLabel: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    LatestStreamArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    GlobalTableVersion: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Replicas: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaDescription>>>>,
                                    RestoreSummary: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::RestoreSummary>>>,
                                    SSEDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEDescription>>>,
                                    ArchivalSummary: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ArchivalSummary>>>,
                                    TableClassSummary: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClassSummary>>>,
                                    DeletionProtectionEnabled: Arc<Option<bool>>,
                                    OnDemandThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>
                                }
                            }

                            impl TableDescription {
                                /// Returns a borrow of the field AttributeDefinitions
                                pub fn AttributeDefinitions(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition>>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => AttributeDefinitions,
                                    }
                                }
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field KeySchema
                                pub fn KeySchema(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => KeySchema,
                                    }
                                }
                                /// Returns a borrow of the field TableStatus
                                pub fn TableStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableStatus>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => TableStatus,
                                    }
                                }
                                /// Returns a borrow of the field CreationDateTime
                                pub fn CreationDateTime(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => CreationDateTime,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughput
                                pub fn ProvisionedThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputDescription>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => ProvisionedThroughput,
                                    }
                                }
                                /// Returns a borrow of the field TableSizeBytes
                                pub fn TableSizeBytes(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => TableSizeBytes,
                                    }
                                }
                                /// Returns a borrow of the field ItemCount
                                pub fn ItemCount(&self) -> &Arc<Option<i64>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => ItemCount,
                                    }
                                }
                                /// Returns a borrow of the field TableArn
                                pub fn TableArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => TableArn,
                                    }
                                }
                                /// Returns a borrow of the field TableId
                                pub fn TableId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => TableId,
                                    }
                                }
                                /// Returns a borrow of the field BillingModeSummary
                                pub fn BillingModeSummary(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingModeSummary>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => BillingModeSummary,
                                    }
                                }
                                /// Returns a borrow of the field LocalSecondaryIndexes
                                pub fn LocalSecondaryIndexes(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndexDescription>>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => LocalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexes
                                pub fn GlobalSecondaryIndexes(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexDescription>>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => GlobalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field StreamSpecification
                                pub fn StreamSpecification(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => StreamSpecification,
                                    }
                                }
                                /// Returns a borrow of the field LatestStreamLabel
                                pub fn LatestStreamLabel(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => LatestStreamLabel,
                                    }
                                }
                                /// Returns a borrow of the field LatestStreamArn
                                pub fn LatestStreamArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => LatestStreamArn,
                                    }
                                }
                                /// Returns a borrow of the field GlobalTableVersion
                                pub fn GlobalTableVersion(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => GlobalTableVersion,
                                    }
                                }
                                /// Returns a borrow of the field Replicas
                                pub fn Replicas(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaDescription>>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => Replicas,
                                    }
                                }
                                /// Returns a borrow of the field RestoreSummary
                                pub fn RestoreSummary(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::RestoreSummary>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => RestoreSummary,
                                    }
                                }
                                /// Returns a borrow of the field SSEDescription
                                pub fn SSEDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSEDescription>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => SSEDescription,
                                    }
                                }
                                /// Returns a borrow of the field ArchivalSummary
                                pub fn ArchivalSummary(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ArchivalSummary>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => ArchivalSummary,
                                    }
                                }
                                /// Returns a borrow of the field TableClassSummary
                                pub fn TableClassSummary(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClassSummary>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => TableClassSummary,
                                    }
                                }
                                /// Returns a borrow of the field DeletionProtectionEnabled
                                pub fn DeletionProtectionEnabled(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => DeletionProtectionEnabled,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughput
                                pub fn OnDemandThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => OnDemandThroughput,
                                    }
                                }
                            }

                            impl Debug
                                for TableDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TableDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableDescription.TableDescription(")?;
                                            DafnyPrint::fmt_print(AttributeDefinitions, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySchema, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CreationDateTime, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableSizeBytes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ItemCount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BillingModeSummary, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LocalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamSpecification, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LatestStreamLabel, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LatestStreamArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalTableVersion, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Replicas, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RestoreSummary, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SSEDescription, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ArchivalSummary, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableClassSummary, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DeletionProtectionEnabled, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughput, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TableDescription {}

                            impl Hash
                                for TableDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TableDescription::TableDescription{AttributeDefinitions, TableName, KeySchema, TableStatus, CreationDateTime, ProvisionedThroughput, TableSizeBytes, ItemCount, TableArn, TableId, BillingModeSummary, LocalSecondaryIndexes, GlobalSecondaryIndexes, StreamSpecification, LatestStreamLabel, LatestStreamArn, GlobalTableVersion, Replicas, RestoreSummary, SSEDescription, ArchivalSummary, TableClassSummary, DeletionProtectionEnabled, OnDemandThroughput, } => {
                                            Hash::hash(AttributeDefinitions, _state);
                                            Hash::hash(TableName, _state);
                                            Hash::hash(KeySchema, _state);
                                            Hash::hash(TableStatus, _state);
                                            Hash::hash(CreationDateTime, _state);
                                            Hash::hash(ProvisionedThroughput, _state);
                                            Hash::hash(TableSizeBytes, _state);
                                            Hash::hash(ItemCount, _state);
                                            Hash::hash(TableArn, _state);
                                            Hash::hash(TableId, _state);
                                            Hash::hash(BillingModeSummary, _state);
                                            Hash::hash(LocalSecondaryIndexes, _state);
                                            Hash::hash(GlobalSecondaryIndexes, _state);
                                            Hash::hash(StreamSpecification, _state);
                                            Hash::hash(LatestStreamLabel, _state);
                                            Hash::hash(LatestStreamArn, _state);
                                            Hash::hash(GlobalTableVersion, _state);
                                            Hash::hash(Replicas, _state);
                                            Hash::hash(RestoreSummary, _state);
                                            Hash::hash(SSEDescription, _state);
                                            Hash::hash(ArchivalSummary, _state);
                                            Hash::hash(TableClassSummary, _state);
                                            Hash::hash(DeletionProtectionEnabled, _state);
                                            Hash::hash(OnDemandThroughput, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TableDescription {
                                fn default() -> TableDescription {
                                    TableDescription::TableDescription {
                                        AttributeDefinitions: Default::default(),
                                        TableName: Default::default(),
                                        KeySchema: Default::default(),
                                        TableStatus: Default::default(),
                                        CreationDateTime: Default::default(),
                                        ProvisionedThroughput: Default::default(),
                                        TableSizeBytes: Default::default(),
                                        ItemCount: Default::default(),
                                        TableArn: Default::default(),
                                        TableId: Default::default(),
                                        BillingModeSummary: Default::default(),
                                        LocalSecondaryIndexes: Default::default(),
                                        GlobalSecondaryIndexes: Default::default(),
                                        StreamSpecification: Default::default(),
                                        LatestStreamLabel: Default::default(),
                                        LatestStreamArn: Default::default(),
                                        GlobalTableVersion: Default::default(),
                                        Replicas: Default::default(),
                                        RestoreSummary: Default::default(),
                                        SSEDescription: Default::default(),
                                        ArchivalSummary: Default::default(),
                                        TableClassSummary: Default::default(),
                                        DeletionProtectionEnabled: Default::default(),
                                        OnDemandThroughput: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TableDescription>
                                for TableDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2585,3)
                            pub type TableName = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2590,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TableStatus {
                                CREATING {},
                                UPDATING {},
                                DELETING {},
                                ACTIVE {},
                                INACCESSIBLE_ENCRYPTION_CREDENTIALS {},
                                ARCHIVING {},
                                ARCHIVED {}
                            }

                            impl TableStatus {}

                            impl Debug
                                for TableStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TableStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TableStatus::CREATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableStatus.CREATING")?;
                                            Ok(())
                                        },
                                        TableStatus::UPDATING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableStatus.UPDATING")?;
                                            Ok(())
                                        },
                                        TableStatus::DELETING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableStatus.DELETING")?;
                                            Ok(())
                                        },
                                        TableStatus::ACTIVE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableStatus.ACTIVE")?;
                                            Ok(())
                                        },
                                        TableStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableStatus.INACCESSIBLE__ENCRYPTION__CREDENTIALS")?;
                                            Ok(())
                                        },
                                        TableStatus::ARCHIVING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableStatus.ARCHIVING")?;
                                            Ok(())
                                        },
                                        TableStatus::ARCHIVED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TableStatus.ARCHIVED")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl TableStatus {
                                /// Enumerates all possible values of TableStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<TableStatus>> {
                                    seq![Arc::new(TableStatus::CREATING {}), Arc::new(TableStatus::UPDATING {}), Arc::new(TableStatus::DELETING {}), Arc::new(TableStatus::ACTIVE {}), Arc::new(TableStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS {}), Arc::new(TableStatus::ARCHIVING {}), Arc::new(TableStatus::ARCHIVED {})].iter()
                                }
                            }

                            impl Eq
                                for TableStatus {}

                            impl Hash
                                for TableStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TableStatus::CREATING{} => {

                                        },
                                        TableStatus::UPDATING{} => {

                                        },
                                        TableStatus::DELETING{} => {

                                        },
                                        TableStatus::ACTIVE{} => {

                                        },
                                        TableStatus::INACCESSIBLE_ENCRYPTION_CREDENTIALS{} => {

                                        },
                                        TableStatus::ARCHIVING{} => {

                                        },
                                        TableStatus::ARCHIVED{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for TableStatus {
                                fn default() -> TableStatus {
                                    TableStatus::CREATING {}
                                }
                            }

                            impl AsRef<TableStatus>
                                for TableStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2598,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Tag {
                                Tag {
                                    Key: Sequence<DafnyCharUTF16>,
                                    Value: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl Tag {
                                /// Returns a borrow of the field Key
                                pub fn Key(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Tag::Tag{Key, Value, } => Key,
                                    }
                                }
                                /// Returns a borrow of the field Value
                                pub fn Value(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Tag::Tag{Key, Value, } => Value,
                                    }
                                }
                            }

                            impl Debug
                                for Tag {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Tag {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Tag::Tag{Key, Value, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Tag.Tag(")?;
                                            DafnyPrint::fmt_print(Key, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Value, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Tag {}

                            impl Hash
                                for Tag {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Tag::Tag{Key, Value, } => {
                                            Hash::hash(Key, _state);
                                            Hash::hash(Value, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Tag {
                                fn default() -> Tag {
                                    Tag::Tag {
                                        Key: Default::default(),
                                        Value: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Tag>
                                for Tag {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2603,3)
                            pub type TagKeyString = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2608,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TagResourceInput {
                                TagResourceInput {
                                    ResourceArn: Sequence<DafnyCharUTF16>,
                                    Tags: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Tag>>
                                }
                            }

                            impl TagResourceInput {
                                /// Returns a borrow of the field ResourceArn
                                pub fn ResourceArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        TagResourceInput::TagResourceInput{ResourceArn, Tags, } => ResourceArn,
                                    }
                                }
                                /// Returns a borrow of the field Tags
                                pub fn Tags(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Tag>> {
                                    match self {
                                        TagResourceInput::TagResourceInput{ResourceArn, Tags, } => Tags,
                                    }
                                }
                            }

                            impl Debug
                                for TagResourceInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TagResourceInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TagResourceInput::TagResourceInput{ResourceArn, Tags, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TagResourceInput.TagResourceInput(")?;
                                            DafnyPrint::fmt_print(ResourceArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Tags, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TagResourceInput {}

                            impl Hash
                                for TagResourceInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TagResourceInput::TagResourceInput{ResourceArn, Tags, } => {
                                            Hash::hash(ResourceArn, _state);
                                            Hash::hash(Tags, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TagResourceInput {
                                fn default() -> TagResourceInput {
                                    TagResourceInput::TagResourceInput {
                                        ResourceArn: Default::default(),
                                        Tags: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TagResourceInput>
                                for TagResourceInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2612,3)
                            pub type TagValueString = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2616,3)
                            pub type TimeToLiveAttributeName = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2620,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TimeToLiveDescription {
                                TimeToLiveDescription {
                                    TimeToLiveStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TimeToLiveStatus>>>,
                                    AttributeName: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl TimeToLiveDescription {
                                /// Returns a borrow of the field TimeToLiveStatus
                                pub fn TimeToLiveStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TimeToLiveStatus>>> {
                                    match self {
                                        TimeToLiveDescription::TimeToLiveDescription{TimeToLiveStatus, AttributeName, } => TimeToLiveStatus,
                                    }
                                }
                                /// Returns a borrow of the field AttributeName
                                pub fn AttributeName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TimeToLiveDescription::TimeToLiveDescription{TimeToLiveStatus, AttributeName, } => AttributeName,
                                    }
                                }
                            }

                            impl Debug
                                for TimeToLiveDescription {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TimeToLiveDescription {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TimeToLiveDescription::TimeToLiveDescription{TimeToLiveStatus, AttributeName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveDescription.TimeToLiveDescription(")?;
                                            DafnyPrint::fmt_print(TimeToLiveStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttributeName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TimeToLiveDescription {}

                            impl Hash
                                for TimeToLiveDescription {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TimeToLiveDescription::TimeToLiveDescription{TimeToLiveStatus, AttributeName, } => {
                                            Hash::hash(TimeToLiveStatus, _state);
                                            Hash::hash(AttributeName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TimeToLiveDescription {
                                fn default() -> TimeToLiveDescription {
                                    TimeToLiveDescription::TimeToLiveDescription {
                                        TimeToLiveStatus: Default::default(),
                                        AttributeName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TimeToLiveDescription>
                                for TimeToLiveDescription {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2625,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TimeToLiveSpecification {
                                TimeToLiveSpecification {
                                    Enabled: bool,
                                    AttributeName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl TimeToLiveSpecification {
                                /// Returns a borrow of the field Enabled
                                pub fn Enabled(&self) -> &bool {
                                    match self {
                                        TimeToLiveSpecification::TimeToLiveSpecification{Enabled, AttributeName, } => Enabled,
                                    }
                                }
                                /// Returns a borrow of the field AttributeName
                                pub fn AttributeName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        TimeToLiveSpecification::TimeToLiveSpecification{Enabled, AttributeName, } => AttributeName,
                                    }
                                }
                            }

                            impl Debug
                                for TimeToLiveSpecification {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TimeToLiveSpecification {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TimeToLiveSpecification::TimeToLiveSpecification{Enabled, AttributeName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveSpecification.TimeToLiveSpecification(")?;
                                            DafnyPrint::fmt_print(Enabled, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttributeName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TimeToLiveSpecification {}

                            impl Hash
                                for TimeToLiveSpecification {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TimeToLiveSpecification::TimeToLiveSpecification{Enabled, AttributeName, } => {
                                            Hash::hash(Enabled, _state);
                                            Hash::hash(AttributeName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TimeToLiveSpecification {
                                fn default() -> TimeToLiveSpecification {
                                    TimeToLiveSpecification::TimeToLiveSpecification {
                                        Enabled: Default::default(),
                                        AttributeName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TimeToLiveSpecification>
                                for TimeToLiveSpecification {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2629,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TimeToLiveStatus {
                                ENABLING {},
                                DISABLING {},
                                ENABLED {},
                                DISABLED {}
                            }

                            impl TimeToLiveStatus {}

                            impl Debug
                                for TimeToLiveStatus {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TimeToLiveStatus {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TimeToLiveStatus::ENABLING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveStatus.ENABLING")?;
                                            Ok(())
                                        },
                                        TimeToLiveStatus::DISABLING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveStatus.DISABLING")?;
                                            Ok(())
                                        },
                                        TimeToLiveStatus::ENABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveStatus.ENABLED")?;
                                            Ok(())
                                        },
                                        TimeToLiveStatus::DISABLED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveStatus.DISABLED")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl TimeToLiveStatus {
                                /// Enumerates all possible values of TimeToLiveStatus
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<TimeToLiveStatus>> {
                                    seq![Arc::new(TimeToLiveStatus::ENABLING {}), Arc::new(TimeToLiveStatus::DISABLING {}), Arc::new(TimeToLiveStatus::ENABLED {}), Arc::new(TimeToLiveStatus::DISABLED {})].iter()
                                }
                            }

                            impl Eq
                                for TimeToLiveStatus {}

                            impl Hash
                                for TimeToLiveStatus {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TimeToLiveStatus::ENABLING{} => {

                                        },
                                        TimeToLiveStatus::DISABLING{} => {

                                        },
                                        TimeToLiveStatus::ENABLED{} => {

                                        },
                                        TimeToLiveStatus::DISABLED{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for TimeToLiveStatus {
                                fn default() -> TimeToLiveStatus {
                                    TimeToLiveStatus::ENABLING {}
                                }
                            }

                            impl AsRef<TimeToLiveStatus>
                                for TimeToLiveStatus {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2634,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TransactGetItem {
                                TransactGetItem {
                                    Get: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Get>
                                }
                            }

                            impl TransactGetItem {
                                /// Returns a borrow of the field Get
                                pub fn Get(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Get> {
                                    match self {
                                        TransactGetItem::TransactGetItem{Get, } => Get,
                                    }
                                }
                            }

                            impl Debug
                                for TransactGetItem {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TransactGetItem {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TransactGetItem::TransactGetItem{Get, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItem.TransactGetItem(")?;
                                            DafnyPrint::fmt_print(Get, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TransactGetItem {}

                            impl Hash
                                for TransactGetItem {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TransactGetItem::TransactGetItem{Get, } => {
                                            Hash::hash(Get, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TransactGetItem {
                                fn default() -> TransactGetItem {
                                    TransactGetItem::TransactGetItem {
                                        Get: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TransactGetItem>
                                for TransactGetItem {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2637,3)
                            pub type TransactGetItemList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactGetItem>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2641,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TransactGetItemsInput {
                                TransactGetItemsInput {
                                    TransactItems: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactGetItemList,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>
                                }
                            }

                            impl TransactGetItemsInput {
                                /// Returns a borrow of the field TransactItems
                                pub fn TransactItems(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactGetItemList {
                                    match self {
                                        TransactGetItemsInput::TransactGetItemsInput{TransactItems, ReturnConsumedCapacity, } => TransactItems,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        TransactGetItemsInput::TransactGetItemsInput{TransactItems, ReturnConsumedCapacity, } => ReturnConsumedCapacity,
                                    }
                                }
                            }

                            impl Debug
                                for TransactGetItemsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TransactGetItemsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TransactGetItemsInput::TransactGetItemsInput{TransactItems, ReturnConsumedCapacity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItemsInput.TransactGetItemsInput(")?;
                                            DafnyPrint::fmt_print(TransactItems, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TransactGetItemsInput {}

                            impl Hash
                                for TransactGetItemsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TransactGetItemsInput::TransactGetItemsInput{TransactItems, ReturnConsumedCapacity, } => {
                                            Hash::hash(TransactItems, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TransactGetItemsInput {
                                fn default() -> TransactGetItemsInput {
                                    TransactGetItemsInput::TransactGetItemsInput {
                                        TransactItems: Default::default(),
                                        ReturnConsumedCapacity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TransactGetItemsInput>
                                for TransactGetItemsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2645,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TransactGetItemsOutput {
                                TransactGetItemsOutput {
                                    ConsumedCapacity: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>>,
                                    Responses: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemResponseList>>
                                }
                            }

                            impl TransactGetItemsOutput {
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>> {
                                    match self {
                                        TransactGetItemsOutput::TransactGetItemsOutput{ConsumedCapacity, Responses, } => ConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field Responses
                                pub fn Responses(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemResponseList>> {
                                    match self {
                                        TransactGetItemsOutput::TransactGetItemsOutput{ConsumedCapacity, Responses, } => Responses,
                                    }
                                }
                            }

                            impl Debug
                                for TransactGetItemsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TransactGetItemsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TransactGetItemsOutput::TransactGetItemsOutput{ConsumedCapacity, Responses, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItemsOutput.TransactGetItemsOutput(")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Responses, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TransactGetItemsOutput {}

                            impl Hash
                                for TransactGetItemsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TransactGetItemsOutput::TransactGetItemsOutput{ConsumedCapacity, Responses, } => {
                                            Hash::hash(ConsumedCapacity, _state);
                                            Hash::hash(Responses, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TransactGetItemsOutput {
                                fn default() -> TransactGetItemsOutput {
                                    TransactGetItemsOutput::TransactGetItemsOutput {
                                        ConsumedCapacity: Default::default(),
                                        Responses: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TransactGetItemsOutput>
                                for TransactGetItemsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2649,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TransactWriteItem {
                                TransactWriteItem {
                                    ConditionCheck: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionCheck>>>,
                                    Put: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Put>>>,
                                    Delete: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Delete>>>,
                                    Update: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Update>>>
                                }
                            }

                            impl TransactWriteItem {
                                /// Returns a borrow of the field ConditionCheck
                                pub fn ConditionCheck(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionCheck>>> {
                                    match self {
                                        TransactWriteItem::TransactWriteItem{ConditionCheck, Put, Delete, Update, } => ConditionCheck,
                                    }
                                }
                                /// Returns a borrow of the field Put
                                pub fn Put(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Put>>> {
                                    match self {
                                        TransactWriteItem::TransactWriteItem{ConditionCheck, Put, Delete, Update, } => Put,
                                    }
                                }
                                /// Returns a borrow of the field Delete
                                pub fn Delete(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Delete>>> {
                                    match self {
                                        TransactWriteItem::TransactWriteItem{ConditionCheck, Put, Delete, Update, } => Delete,
                                    }
                                }
                                /// Returns a borrow of the field Update
                                pub fn Update(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Update>>> {
                                    match self {
                                        TransactWriteItem::TransactWriteItem{ConditionCheck, Put, Delete, Update, } => Update,
                                    }
                                }
                            }

                            impl Debug
                                for TransactWriteItem {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TransactWriteItem {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TransactWriteItem::TransactWriteItem{ConditionCheck, Put, Delete, Update, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItem.TransactWriteItem(")?;
                                            DafnyPrint::fmt_print(ConditionCheck, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Put, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Delete, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Update, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TransactWriteItem {}

                            impl Hash
                                for TransactWriteItem {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TransactWriteItem::TransactWriteItem{ConditionCheck, Put, Delete, Update, } => {
                                            Hash::hash(ConditionCheck, _state);
                                            Hash::hash(Put, _state);
                                            Hash::hash(Delete, _state);
                                            Hash::hash(Update, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TransactWriteItem {
                                fn default() -> TransactWriteItem {
                                    TransactWriteItem::TransactWriteItem {
                                        ConditionCheck: Default::default(),
                                        Put: Default::default(),
                                        Delete: Default::default(),
                                        Update: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TransactWriteItem>
                                for TransactWriteItem {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2655,3)
                            pub type TransactWriteItemList = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItem>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2659,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TransactWriteItemsInput {
                                TransactWriteItemsInput {
                                    TransactItems: crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemList,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>,
                                    ReturnItemCollectionMetrics: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics>>>,
                                    ClientRequestToken: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl TransactWriteItemsInput {
                                /// Returns a borrow of the field TransactItems
                                pub fn TransactItems(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemList {
                                    match self {
                                        TransactWriteItemsInput::TransactWriteItemsInput{TransactItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ClientRequestToken, } => TransactItems,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        TransactWriteItemsInput::TransactWriteItemsInput{TransactItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ClientRequestToken, } => ReturnConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ReturnItemCollectionMetrics
                                pub fn ReturnItemCollectionMetrics(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics>>> {
                                    match self {
                                        TransactWriteItemsInput::TransactWriteItemsInput{TransactItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ClientRequestToken, } => ReturnItemCollectionMetrics,
                                    }
                                }
                                /// Returns a borrow of the field ClientRequestToken
                                pub fn ClientRequestToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        TransactWriteItemsInput::TransactWriteItemsInput{TransactItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ClientRequestToken, } => ClientRequestToken,
                                    }
                                }
                            }

                            impl Debug
                                for TransactWriteItemsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TransactWriteItemsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TransactWriteItemsInput::TransactWriteItemsInput{TransactItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ClientRequestToken, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItemsInput.TransactWriteItemsInput(")?;
                                            DafnyPrint::fmt_print(TransactItems, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnItemCollectionMetrics, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ClientRequestToken, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TransactWriteItemsInput {}

                            impl Hash
                                for TransactWriteItemsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TransactWriteItemsInput::TransactWriteItemsInput{TransactItems, ReturnConsumedCapacity, ReturnItemCollectionMetrics, ClientRequestToken, } => {
                                            Hash::hash(TransactItems, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state);
                                            Hash::hash(ReturnItemCollectionMetrics, _state);
                                            Hash::hash(ClientRequestToken, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TransactWriteItemsInput {
                                fn default() -> TransactWriteItemsInput {
                                    TransactWriteItemsInput::TransactWriteItemsInput {
                                        TransactItems: Default::default(),
                                        ReturnConsumedCapacity: Default::default(),
                                        ReturnItemCollectionMetrics: Default::default(),
                                        ClientRequestToken: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TransactWriteItemsInput>
                                for TransactWriteItemsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2665,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TransactWriteItemsOutput {
                                TransactWriteItemsOutput {
                                    ConsumedCapacity: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>>,
                                    ItemCollectionMetrics: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics>>>>>
                                }
                            }

                            impl TransactWriteItemsOutput {
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>> {
                                    match self {
                                        TransactWriteItemsOutput::TransactWriteItemsOutput{ConsumedCapacity, ItemCollectionMetrics, } => ConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ItemCollectionMetrics
                                pub fn ItemCollectionMetrics(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics>>>>> {
                                    match self {
                                        TransactWriteItemsOutput::TransactWriteItemsOutput{ConsumedCapacity, ItemCollectionMetrics, } => ItemCollectionMetrics,
                                    }
                                }
                            }

                            impl Debug
                                for TransactWriteItemsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TransactWriteItemsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TransactWriteItemsOutput::TransactWriteItemsOutput{ConsumedCapacity, ItemCollectionMetrics, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItemsOutput.TransactWriteItemsOutput(")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ItemCollectionMetrics, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TransactWriteItemsOutput {}

                            impl Hash
                                for TransactWriteItemsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TransactWriteItemsOutput::TransactWriteItemsOutput{ConsumedCapacity, ItemCollectionMetrics, } => {
                                            Hash::hash(ConsumedCapacity, _state);
                                            Hash::hash(ItemCollectionMetrics, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TransactWriteItemsOutput {
                                fn default() -> TransactWriteItemsOutput {
                                    TransactWriteItemsOutput::TransactWriteItemsOutput {
                                        ConsumedCapacity: Default::default(),
                                        ItemCollectionMetrics: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TransactWriteItemsOutput>
                                for TransactWriteItemsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2669,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UntagResourceInput {
                                UntagResourceInput {
                                    ResourceArn: Sequence<DafnyCharUTF16>,
                                    TagKeys: Sequence<Sequence<DafnyCharUTF16>>
                                }
                            }

                            impl UntagResourceInput {
                                /// Returns a borrow of the field ResourceArn
                                pub fn ResourceArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UntagResourceInput::UntagResourceInput{ResourceArn, TagKeys, } => ResourceArn,
                                    }
                                }
                                /// Returns a borrow of the field TagKeys
                                pub fn TagKeys(&self) -> &Sequence<Sequence<DafnyCharUTF16>> {
                                    match self {
                                        UntagResourceInput::UntagResourceInput{ResourceArn, TagKeys, } => TagKeys,
                                    }
                                }
                            }

                            impl Debug
                                for UntagResourceInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UntagResourceInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UntagResourceInput::UntagResourceInput{ResourceArn, TagKeys, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UntagResourceInput.UntagResourceInput(")?;
                                            DafnyPrint::fmt_print(ResourceArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TagKeys, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UntagResourceInput {}

                            impl Hash
                                for UntagResourceInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UntagResourceInput::UntagResourceInput{ResourceArn, TagKeys, } => {
                                            Hash::hash(ResourceArn, _state);
                                            Hash::hash(TagKeys, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UntagResourceInput {
                                fn default() -> UntagResourceInput {
                                    UntagResourceInput::UntagResourceInput {
                                        ResourceArn: Default::default(),
                                        TagKeys: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UntagResourceInput>
                                for UntagResourceInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2673,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Update {
                                Update {
                                    Key: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>,
                                    UpdateExpression: Sequence<DafnyCharUTF16>,
                                    TableName: Sequence<DafnyCharUTF16>,
                                    ConditionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    ExpressionAttributeValues: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ReturnValuesOnConditionCheckFailure: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>>
                                }
                            }

                            impl Update {
                                /// Returns a borrow of the field Key
                                pub fn Key(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        Update::Update{Key, UpdateExpression, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Key,
                                    }
                                }
                                /// Returns a borrow of the field UpdateExpression
                                pub fn UpdateExpression(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Update::Update{Key, UpdateExpression, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => UpdateExpression,
                                    }
                                }
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Update::Update{Key, UpdateExpression, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field ConditionExpression
                                pub fn ConditionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        Update::Update{Key, UpdateExpression, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        Update::Update{Key, UpdateExpression, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeNames,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeValues
                                pub fn ExpressionAttributeValues(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        Update::Update{Key, UpdateExpression, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeValues,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure
                                pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>> {
                                    match self {
                                        Update::Update{Key, UpdateExpression, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure,
                                    }
                                }
                            }

                            impl Debug
                                for Update {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Update {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Update::Update{Key, UpdateExpression, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Update.Update(")?;
                                            DafnyPrint::fmt_print(Key, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(UpdateExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Update {}

                            impl Hash
                                for Update {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Update::Update{Key, UpdateExpression, TableName, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            Hash::hash(Key, _state);
                                            Hash::hash(UpdateExpression, _state);
                                            Hash::hash(TableName, _state);
                                            Hash::hash(ConditionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state);
                                            Hash::hash(ExpressionAttributeValues, _state);
                                            Hash::hash(ReturnValuesOnConditionCheckFailure, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Update {
                                fn default() -> Update {
                                    Update::Update {
                                        Key: Default::default(),
                                        UpdateExpression: Default::default(),
                                        TableName: Default::default(),
                                        ConditionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default(),
                                        ExpressionAttributeValues: Default::default(),
                                        ReturnValuesOnConditionCheckFailure: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Update>
                                for Update {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2682,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateContinuousBackupsInput {
                                UpdateContinuousBackupsInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    PointInTimeRecoverySpecification: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PointInTimeRecoverySpecification>
                                }
                            }

                            impl UpdateContinuousBackupsInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateContinuousBackupsInput::UpdateContinuousBackupsInput{TableName, PointInTimeRecoverySpecification, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field PointInTimeRecoverySpecification
                                pub fn PointInTimeRecoverySpecification(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PointInTimeRecoverySpecification> {
                                    match self {
                                        UpdateContinuousBackupsInput::UpdateContinuousBackupsInput{TableName, PointInTimeRecoverySpecification, } => PointInTimeRecoverySpecification,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateContinuousBackupsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateContinuousBackupsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateContinuousBackupsInput::UpdateContinuousBackupsInput{TableName, PointInTimeRecoverySpecification, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContinuousBackupsInput.UpdateContinuousBackupsInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PointInTimeRecoverySpecification, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateContinuousBackupsInput {}

                            impl Hash
                                for UpdateContinuousBackupsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateContinuousBackupsInput::UpdateContinuousBackupsInput{TableName, PointInTimeRecoverySpecification, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(PointInTimeRecoverySpecification, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateContinuousBackupsInput {
                                fn default() -> UpdateContinuousBackupsInput {
                                    UpdateContinuousBackupsInput::UpdateContinuousBackupsInput {
                                        TableName: Default::default(),
                                        PointInTimeRecoverySpecification: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateContinuousBackupsInput>
                                for UpdateContinuousBackupsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2686,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateContinuousBackupsOutput {
                                UpdateContinuousBackupsOutput {
                                    ContinuousBackupsDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContinuousBackupsDescription>>>
                                }
                            }

                            impl UpdateContinuousBackupsOutput {
                                /// Returns a borrow of the field ContinuousBackupsDescription
                                pub fn ContinuousBackupsDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContinuousBackupsDescription>>> {
                                    match self {
                                        UpdateContinuousBackupsOutput::UpdateContinuousBackupsOutput{ContinuousBackupsDescription, } => ContinuousBackupsDescription,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateContinuousBackupsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateContinuousBackupsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateContinuousBackupsOutput::UpdateContinuousBackupsOutput{ContinuousBackupsDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContinuousBackupsOutput.UpdateContinuousBackupsOutput(")?;
                                            DafnyPrint::fmt_print(ContinuousBackupsDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateContinuousBackupsOutput {}

                            impl Hash
                                for UpdateContinuousBackupsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateContinuousBackupsOutput::UpdateContinuousBackupsOutput{ContinuousBackupsDescription, } => {
                                            Hash::hash(ContinuousBackupsDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateContinuousBackupsOutput {
                                fn default() -> UpdateContinuousBackupsOutput {
                                    UpdateContinuousBackupsOutput::UpdateContinuousBackupsOutput {
                                        ContinuousBackupsDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateContinuousBackupsOutput>
                                for UpdateContinuousBackupsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2689,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateContributorInsightsInput {
                                UpdateContributorInsightsInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ContributorInsightsAction: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContributorInsightsAction>
                                }
                            }

                            impl UpdateContributorInsightsInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateContributorInsightsInput::UpdateContributorInsightsInput{TableName, IndexName, ContributorInsightsAction, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateContributorInsightsInput::UpdateContributorInsightsInput{TableName, IndexName, ContributorInsightsAction, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ContributorInsightsAction
                                pub fn ContributorInsightsAction(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContributorInsightsAction> {
                                    match self {
                                        UpdateContributorInsightsInput::UpdateContributorInsightsInput{TableName, IndexName, ContributorInsightsAction, } => ContributorInsightsAction,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateContributorInsightsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateContributorInsightsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateContributorInsightsInput::UpdateContributorInsightsInput{TableName, IndexName, ContributorInsightsAction, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContributorInsightsInput.UpdateContributorInsightsInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ContributorInsightsAction, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateContributorInsightsInput {}

                            impl Hash
                                for UpdateContributorInsightsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateContributorInsightsInput::UpdateContributorInsightsInput{TableName, IndexName, ContributorInsightsAction, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ContributorInsightsAction, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateContributorInsightsInput {
                                fn default() -> UpdateContributorInsightsInput {
                                    UpdateContributorInsightsInput::UpdateContributorInsightsInput {
                                        TableName: Default::default(),
                                        IndexName: Default::default(),
                                        ContributorInsightsAction: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateContributorInsightsInput>
                                for UpdateContributorInsightsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2694,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateContributorInsightsOutput {
                                UpdateContributorInsightsOutput {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    IndexName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ContributorInsightsStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContributorInsightsStatus>>>
                                }
                            }

                            impl UpdateContributorInsightsOutput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateContributorInsightsOutput::UpdateContributorInsightsOutput{TableName, IndexName, ContributorInsightsStatus, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateContributorInsightsOutput::UpdateContributorInsightsOutput{TableName, IndexName, ContributorInsightsStatus, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ContributorInsightsStatus
                                pub fn ContributorInsightsStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ContributorInsightsStatus>>> {
                                    match self {
                                        UpdateContributorInsightsOutput::UpdateContributorInsightsOutput{TableName, IndexName, ContributorInsightsStatus, } => ContributorInsightsStatus,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateContributorInsightsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateContributorInsightsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateContributorInsightsOutput::UpdateContributorInsightsOutput{TableName, IndexName, ContributorInsightsStatus, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContributorInsightsOutput.UpdateContributorInsightsOutput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ContributorInsightsStatus, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateContributorInsightsOutput {}

                            impl Hash
                                for UpdateContributorInsightsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateContributorInsightsOutput::UpdateContributorInsightsOutput{TableName, IndexName, ContributorInsightsStatus, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ContributorInsightsStatus, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateContributorInsightsOutput {
                                fn default() -> UpdateContributorInsightsOutput {
                                    UpdateContributorInsightsOutput::UpdateContributorInsightsOutput {
                                        TableName: Default::default(),
                                        IndexName: Default::default(),
                                        ContributorInsightsStatus: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateContributorInsightsOutput>
                                for UpdateContributorInsightsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2700,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateGlobalSecondaryIndexAction {
                                UpdateGlobalSecondaryIndexAction {
                                    IndexName: Sequence<DafnyCharUTF16>,
                                    ProvisionedThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>>,
                                    OnDemandThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>
                                }
                            }

                            impl UpdateGlobalSecondaryIndexAction {
                                /// Returns a borrow of the field IndexName
                                pub fn IndexName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateGlobalSecondaryIndexAction::UpdateGlobalSecondaryIndexAction{IndexName, ProvisionedThroughput, OnDemandThroughput, } => IndexName,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughput
                                pub fn ProvisionedThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>> {
                                    match self {
                                        UpdateGlobalSecondaryIndexAction::UpdateGlobalSecondaryIndexAction{IndexName, ProvisionedThroughput, OnDemandThroughput, } => ProvisionedThroughput,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughput
                                pub fn OnDemandThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        UpdateGlobalSecondaryIndexAction::UpdateGlobalSecondaryIndexAction{IndexName, ProvisionedThroughput, OnDemandThroughput, } => OnDemandThroughput,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateGlobalSecondaryIndexAction {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateGlobalSecondaryIndexAction {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateGlobalSecondaryIndexAction::UpdateGlobalSecondaryIndexAction{IndexName, ProvisionedThroughput, OnDemandThroughput, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalSecondaryIndexAction.UpdateGlobalSecondaryIndexAction(")?;
                                            DafnyPrint::fmt_print(IndexName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughput, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateGlobalSecondaryIndexAction {}

                            impl Hash
                                for UpdateGlobalSecondaryIndexAction {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateGlobalSecondaryIndexAction::UpdateGlobalSecondaryIndexAction{IndexName, ProvisionedThroughput, OnDemandThroughput, } => {
                                            Hash::hash(IndexName, _state);
                                            Hash::hash(ProvisionedThroughput, _state);
                                            Hash::hash(OnDemandThroughput, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateGlobalSecondaryIndexAction {
                                fn default() -> UpdateGlobalSecondaryIndexAction {
                                    UpdateGlobalSecondaryIndexAction::UpdateGlobalSecondaryIndexAction {
                                        IndexName: Default::default(),
                                        ProvisionedThroughput: Default::default(),
                                        OnDemandThroughput: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateGlobalSecondaryIndexAction>
                                for UpdateGlobalSecondaryIndexAction {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2705,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateGlobalTableInput {
                                UpdateGlobalTableInput {
                                    GlobalTableName: Sequence<DafnyCharUTF16>,
                                    ReplicaUpdates: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaUpdate>>
                                }
                            }

                            impl UpdateGlobalTableInput {
                                /// Returns a borrow of the field GlobalTableName
                                pub fn GlobalTableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateGlobalTableInput::UpdateGlobalTableInput{GlobalTableName, ReplicaUpdates, } => GlobalTableName,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaUpdates
                                pub fn ReplicaUpdates(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaUpdate>> {
                                    match self {
                                        UpdateGlobalTableInput::UpdateGlobalTableInput{GlobalTableName, ReplicaUpdates, } => ReplicaUpdates,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateGlobalTableInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateGlobalTableInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateGlobalTableInput::UpdateGlobalTableInput{GlobalTableName, ReplicaUpdates, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableInput.UpdateGlobalTableInput(")?;
                                            DafnyPrint::fmt_print(GlobalTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaUpdates, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateGlobalTableInput {}

                            impl Hash
                                for UpdateGlobalTableInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateGlobalTableInput::UpdateGlobalTableInput{GlobalTableName, ReplicaUpdates, } => {
                                            Hash::hash(GlobalTableName, _state);
                                            Hash::hash(ReplicaUpdates, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateGlobalTableInput {
                                fn default() -> UpdateGlobalTableInput {
                                    UpdateGlobalTableInput::UpdateGlobalTableInput {
                                        GlobalTableName: Default::default(),
                                        ReplicaUpdates: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateGlobalTableInput>
                                for UpdateGlobalTableInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2709,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateGlobalTableOutput {
                                UpdateGlobalTableOutput {
                                    GlobalTableDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableDescription>>>
                                }
                            }

                            impl UpdateGlobalTableOutput {
                                /// Returns a borrow of the field GlobalTableDescription
                                pub fn GlobalTableDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableDescription>>> {
                                    match self {
                                        UpdateGlobalTableOutput::UpdateGlobalTableOutput{GlobalTableDescription, } => GlobalTableDescription,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateGlobalTableOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateGlobalTableOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateGlobalTableOutput::UpdateGlobalTableOutput{GlobalTableDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableOutput.UpdateGlobalTableOutput(")?;
                                            DafnyPrint::fmt_print(GlobalTableDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateGlobalTableOutput {}

                            impl Hash
                                for UpdateGlobalTableOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateGlobalTableOutput::UpdateGlobalTableOutput{GlobalTableDescription, } => {
                                            Hash::hash(GlobalTableDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateGlobalTableOutput {
                                fn default() -> UpdateGlobalTableOutput {
                                    UpdateGlobalTableOutput::UpdateGlobalTableOutput {
                                        GlobalTableDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateGlobalTableOutput>
                                for UpdateGlobalTableOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2712,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateGlobalTableSettingsInput {
                                UpdateGlobalTableSettingsInput {
                                    GlobalTableName: Sequence<DafnyCharUTF16>,
                                    GlobalTableBillingMode: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>>,
                                    GlobalTableProvisionedWriteCapacityUnits: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>>,
                                    GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>>,
                                    GlobalTableGlobalSecondaryIndexSettingsUpdate: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableGlobalSecondaryIndexSettingsUpdateList>>,
                                    ReplicaSettingsUpdate: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaSettingsUpdateList>>
                                }
                            }

                            impl UpdateGlobalTableSettingsInput {
                                /// Returns a borrow of the field GlobalTableName
                                pub fn GlobalTableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateGlobalTableSettingsInput::UpdateGlobalTableSettingsInput{GlobalTableName, GlobalTableBillingMode, GlobalTableProvisionedWriteCapacityUnits, GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, GlobalTableGlobalSecondaryIndexSettingsUpdate, ReplicaSettingsUpdate, } => GlobalTableName,
                                    }
                                }
                                /// Returns a borrow of the field GlobalTableBillingMode
                                pub fn GlobalTableBillingMode(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>> {
                                    match self {
                                        UpdateGlobalTableSettingsInput::UpdateGlobalTableSettingsInput{GlobalTableName, GlobalTableBillingMode, GlobalTableProvisionedWriteCapacityUnits, GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, GlobalTableGlobalSecondaryIndexSettingsUpdate, ReplicaSettingsUpdate, } => GlobalTableBillingMode,
                                    }
                                }
                                /// Returns a borrow of the field GlobalTableProvisionedWriteCapacityUnits
                                pub fn GlobalTableProvisionedWriteCapacityUnits(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PositiveLongObject>> {
                                    match self {
                                        UpdateGlobalTableSettingsInput::UpdateGlobalTableSettingsInput{GlobalTableName, GlobalTableBillingMode, GlobalTableProvisionedWriteCapacityUnits, GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, GlobalTableGlobalSecondaryIndexSettingsUpdate, ReplicaSettingsUpdate, } => GlobalTableProvisionedWriteCapacityUnits,
                                    }
                                }
                                /// Returns a borrow of the field GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate
                                pub fn GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>> {
                                    match self {
                                        UpdateGlobalTableSettingsInput::UpdateGlobalTableSettingsInput{GlobalTableName, GlobalTableBillingMode, GlobalTableProvisionedWriteCapacityUnits, GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, GlobalTableGlobalSecondaryIndexSettingsUpdate, ReplicaSettingsUpdate, } => GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate,
                                    }
                                }
                                /// Returns a borrow of the field GlobalTableGlobalSecondaryIndexSettingsUpdate
                                pub fn GlobalTableGlobalSecondaryIndexSettingsUpdate(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalTableGlobalSecondaryIndexSettingsUpdateList>> {
                                    match self {
                                        UpdateGlobalTableSettingsInput::UpdateGlobalTableSettingsInput{GlobalTableName, GlobalTableBillingMode, GlobalTableProvisionedWriteCapacityUnits, GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, GlobalTableGlobalSecondaryIndexSettingsUpdate, ReplicaSettingsUpdate, } => GlobalTableGlobalSecondaryIndexSettingsUpdate,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaSettingsUpdate
                                pub fn ReplicaSettingsUpdate(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaSettingsUpdateList>> {
                                    match self {
                                        UpdateGlobalTableSettingsInput::UpdateGlobalTableSettingsInput{GlobalTableName, GlobalTableBillingMode, GlobalTableProvisionedWriteCapacityUnits, GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, GlobalTableGlobalSecondaryIndexSettingsUpdate, ReplicaSettingsUpdate, } => ReplicaSettingsUpdate,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateGlobalTableSettingsInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateGlobalTableSettingsInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateGlobalTableSettingsInput::UpdateGlobalTableSettingsInput{GlobalTableName, GlobalTableBillingMode, GlobalTableProvisionedWriteCapacityUnits, GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, GlobalTableGlobalSecondaryIndexSettingsUpdate, ReplicaSettingsUpdate, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableSettingsInput.UpdateGlobalTableSettingsInput(")?;
                                            DafnyPrint::fmt_print(GlobalTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalTableBillingMode, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalTableProvisionedWriteCapacityUnits, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalTableGlobalSecondaryIndexSettingsUpdate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaSettingsUpdate, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateGlobalTableSettingsInput {}

                            impl Hash
                                for UpdateGlobalTableSettingsInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateGlobalTableSettingsInput::UpdateGlobalTableSettingsInput{GlobalTableName, GlobalTableBillingMode, GlobalTableProvisionedWriteCapacityUnits, GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, GlobalTableGlobalSecondaryIndexSettingsUpdate, ReplicaSettingsUpdate, } => {
                                            Hash::hash(GlobalTableName, _state);
                                            Hash::hash(GlobalTableBillingMode, _state);
                                            Hash::hash(GlobalTableProvisionedWriteCapacityUnits, _state);
                                            Hash::hash(GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, _state);
                                            Hash::hash(GlobalTableGlobalSecondaryIndexSettingsUpdate, _state);
                                            Hash::hash(ReplicaSettingsUpdate, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateGlobalTableSettingsInput {
                                fn default() -> UpdateGlobalTableSettingsInput {
                                    UpdateGlobalTableSettingsInput::UpdateGlobalTableSettingsInput {
                                        GlobalTableName: Default::default(),
                                        GlobalTableBillingMode: Default::default(),
                                        GlobalTableProvisionedWriteCapacityUnits: Default::default(),
                                        GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate: Default::default(),
                                        GlobalTableGlobalSecondaryIndexSettingsUpdate: Default::default(),
                                        ReplicaSettingsUpdate: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateGlobalTableSettingsInput>
                                for UpdateGlobalTableSettingsInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2720,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateGlobalTableSettingsOutput {
                                UpdateGlobalTableSettingsOutput {
                                    GlobalTableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ReplicaSettings: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaSettingsDescription>>>>
                                }
                            }

                            impl UpdateGlobalTableSettingsOutput {
                                /// Returns a borrow of the field GlobalTableName
                                pub fn GlobalTableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateGlobalTableSettingsOutput::UpdateGlobalTableSettingsOutput{GlobalTableName, ReplicaSettings, } => GlobalTableName,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaSettings
                                pub fn ReplicaSettings(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaSettingsDescription>>>> {
                                    match self {
                                        UpdateGlobalTableSettingsOutput::UpdateGlobalTableSettingsOutput{GlobalTableName, ReplicaSettings, } => ReplicaSettings,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateGlobalTableSettingsOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateGlobalTableSettingsOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateGlobalTableSettingsOutput::UpdateGlobalTableSettingsOutput{GlobalTableName, ReplicaSettings, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableSettingsOutput.UpdateGlobalTableSettingsOutput(")?;
                                            DafnyPrint::fmt_print(GlobalTableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaSettings, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateGlobalTableSettingsOutput {}

                            impl Hash
                                for UpdateGlobalTableSettingsOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateGlobalTableSettingsOutput::UpdateGlobalTableSettingsOutput{GlobalTableName, ReplicaSettings, } => {
                                            Hash::hash(GlobalTableName, _state);
                                            Hash::hash(ReplicaSettings, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateGlobalTableSettingsOutput {
                                fn default() -> UpdateGlobalTableSettingsOutput {
                                    UpdateGlobalTableSettingsOutput::UpdateGlobalTableSettingsOutput {
                                        GlobalTableName: Default::default(),
                                        ReplicaSettings: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateGlobalTableSettingsOutput>
                                for UpdateGlobalTableSettingsOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2724,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateItemInput {
                                UpdateItemInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    Key: Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>,
                                    AttributeUpdates: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValueUpdate>>>>,
                                    Expected: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExpectedAttributeValue>>>>,
                                    ConditionalOperator: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator>>>,
                                    ReturnValues: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue>>>,
                                    ReturnConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>>,
                                    ReturnItemCollectionMetrics: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics>>>,
                                    UpdateExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ConditionExpression: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpressionAttributeNames: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    ExpressionAttributeValues: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ReturnValuesOnConditionCheckFailure: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>>
                                }
                            }

                            impl UpdateItemInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field Key
                                pub fn Key(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Key,
                                    }
                                }
                                /// Returns a borrow of the field AttributeUpdates
                                pub fn AttributeUpdates(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValueUpdate>>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => AttributeUpdates,
                                    }
                                }
                                /// Returns a borrow of the field Expected
                                pub fn Expected(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ExpectedAttributeValue>>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => Expected,
                                    }
                                }
                                /// Returns a borrow of the field ConditionalOperator
                                pub fn ConditionalOperator(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionalOperator>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionalOperator,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValues
                                pub fn ReturnValues(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValue>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValues,
                                    }
                                }
                                /// Returns a borrow of the field ReturnConsumedCapacity
                                pub fn ReturnConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ReturnItemCollectionMetrics
                                pub fn ReturnItemCollectionMetrics(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnItemCollectionMetrics,
                                    }
                                }
                                /// Returns a borrow of the field UpdateExpression
                                pub fn UpdateExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => UpdateExpression,
                                    }
                                }
                                /// Returns a borrow of the field ConditionExpression
                                pub fn ConditionExpression(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ConditionExpression,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeNames
                                pub fn ExpressionAttributeNames(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeNames,
                                    }
                                }
                                /// Returns a borrow of the field ExpressionAttributeValues
                                pub fn ExpressionAttributeValues(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ExpressionAttributeValues,
                                    }
                                }
                                /// Returns a borrow of the field ReturnValuesOnConditionCheckFailure
                                pub fn ReturnValuesOnConditionCheckFailure(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure>>> {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => ReturnValuesOnConditionCheckFailure,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateItemInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateItemInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemInput.UpdateItemInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Key, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttributeUpdates, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Expected, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionalOperator, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnItemCollectionMetrics, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(UpdateExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConditionExpression, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpressionAttributeValues, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReturnValuesOnConditionCheckFailure, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateItemInput {}

                            impl Hash
                                for UpdateItemInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateItemInput::UpdateItemInput{TableName, Key, AttributeUpdates, Expected, ConditionalOperator, ReturnValues, ReturnConsumedCapacity, ReturnItemCollectionMetrics, UpdateExpression, ConditionExpression, ExpressionAttributeNames, ExpressionAttributeValues, ReturnValuesOnConditionCheckFailure, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(Key, _state);
                                            Hash::hash(AttributeUpdates, _state);
                                            Hash::hash(Expected, _state);
                                            Hash::hash(ConditionalOperator, _state);
                                            Hash::hash(ReturnValues, _state);
                                            Hash::hash(ReturnConsumedCapacity, _state);
                                            Hash::hash(ReturnItemCollectionMetrics, _state);
                                            Hash::hash(UpdateExpression, _state);
                                            Hash::hash(ConditionExpression, _state);
                                            Hash::hash(ExpressionAttributeNames, _state);
                                            Hash::hash(ExpressionAttributeValues, _state);
                                            Hash::hash(ReturnValuesOnConditionCheckFailure, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateItemInput {
                                fn default() -> UpdateItemInput {
                                    UpdateItemInput::UpdateItemInput {
                                        TableName: Default::default(),
                                        Key: Default::default(),
                                        AttributeUpdates: Default::default(),
                                        Expected: Default::default(),
                                        ConditionalOperator: Default::default(),
                                        ReturnValues: Default::default(),
                                        ReturnConsumedCapacity: Default::default(),
                                        ReturnItemCollectionMetrics: Default::default(),
                                        UpdateExpression: Default::default(),
                                        ConditionExpression: Default::default(),
                                        ExpressionAttributeNames: Default::default(),
                                        ExpressionAttributeValues: Default::default(),
                                        ReturnValuesOnConditionCheckFailure: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateItemInput>
                                for UpdateItemInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2739,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateItemOutput {
                                UpdateItemOutput {
                                    Attributes: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>,
                                    ConsumedCapacity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>>,
                                    ItemCollectionMetrics: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics>>>
                                }
                            }

                            impl UpdateItemOutput {
                                /// Returns a borrow of the field Attributes
                                pub fn Attributes(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        UpdateItemOutput::UpdateItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => Attributes,
                                    }
                                }
                                /// Returns a borrow of the field ConsumedCapacity
                                pub fn ConsumedCapacity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConsumedCapacity>>> {
                                    match self {
                                        UpdateItemOutput::UpdateItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => ConsumedCapacity,
                                    }
                                }
                                /// Returns a borrow of the field ItemCollectionMetrics
                                pub fn ItemCollectionMetrics(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ItemCollectionMetrics>>> {
                                    match self {
                                        UpdateItemOutput::UpdateItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => ItemCollectionMetrics,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateItemOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateItemOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateItemOutput::UpdateItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemOutput.UpdateItemOutput(")?;
                                            DafnyPrint::fmt_print(Attributes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConsumedCapacity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ItemCollectionMetrics, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateItemOutput {}

                            impl Hash
                                for UpdateItemOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateItemOutput::UpdateItemOutput{Attributes, ConsumedCapacity, ItemCollectionMetrics, } => {
                                            Hash::hash(Attributes, _state);
                                            Hash::hash(ConsumedCapacity, _state);
                                            Hash::hash(ItemCollectionMetrics, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateItemOutput {
                                fn default() -> UpdateItemOutput {
                                    UpdateItemOutput::UpdateItemOutput {
                                        Attributes: Default::default(),
                                        ConsumedCapacity: Default::default(),
                                        ItemCollectionMetrics: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateItemOutput>
                                for UpdateItemOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2744,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateKinesisStreamingConfiguration {
                                UpdateKinesisStreamingConfiguration {
                                    ApproximateCreationDateTimePrecision: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ApproximateCreationDateTimePrecision>>>
                                }
                            }

                            impl UpdateKinesisStreamingConfiguration {
                                /// Returns a borrow of the field ApproximateCreationDateTimePrecision
                                pub fn ApproximateCreationDateTimePrecision(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ApproximateCreationDateTimePrecision>>> {
                                    match self {
                                        UpdateKinesisStreamingConfiguration::UpdateKinesisStreamingConfiguration{ApproximateCreationDateTimePrecision, } => ApproximateCreationDateTimePrecision,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateKinesisStreamingConfiguration {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateKinesisStreamingConfiguration {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateKinesisStreamingConfiguration::UpdateKinesisStreamingConfiguration{ApproximateCreationDateTimePrecision, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateKinesisStreamingConfiguration.UpdateKinesisStreamingConfiguration(")?;
                                            DafnyPrint::fmt_print(ApproximateCreationDateTimePrecision, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateKinesisStreamingConfiguration {}

                            impl Hash
                                for UpdateKinesisStreamingConfiguration {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateKinesisStreamingConfiguration::UpdateKinesisStreamingConfiguration{ApproximateCreationDateTimePrecision, } => {
                                            Hash::hash(ApproximateCreationDateTimePrecision, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateKinesisStreamingConfiguration {
                                fn default() -> UpdateKinesisStreamingConfiguration {
                                    UpdateKinesisStreamingConfiguration::UpdateKinesisStreamingConfiguration {
                                        ApproximateCreationDateTimePrecision: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateKinesisStreamingConfiguration>
                                for UpdateKinesisStreamingConfiguration {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2747,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateKinesisStreamingDestinationInput {
                                UpdateKinesisStreamingDestinationInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    StreamArn: Sequence<DafnyCharUTF16>,
                                    UpdateKinesisStreamingConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateKinesisStreamingConfiguration>>>
                                }
                            }

                            impl UpdateKinesisStreamingDestinationInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateKinesisStreamingDestinationInput::UpdateKinesisStreamingDestinationInput{TableName, StreamArn, UpdateKinesisStreamingConfiguration, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field StreamArn
                                pub fn StreamArn(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateKinesisStreamingDestinationInput::UpdateKinesisStreamingDestinationInput{TableName, StreamArn, UpdateKinesisStreamingConfiguration, } => StreamArn,
                                    }
                                }
                                /// Returns a borrow of the field UpdateKinesisStreamingConfiguration
                                pub fn UpdateKinesisStreamingConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateKinesisStreamingConfiguration>>> {
                                    match self {
                                        UpdateKinesisStreamingDestinationInput::UpdateKinesisStreamingDestinationInput{TableName, StreamArn, UpdateKinesisStreamingConfiguration, } => UpdateKinesisStreamingConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateKinesisStreamingDestinationInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateKinesisStreamingDestinationInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateKinesisStreamingDestinationInput::UpdateKinesisStreamingDestinationInput{TableName, StreamArn, UpdateKinesisStreamingConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateKinesisStreamingDestinationInput.UpdateKinesisStreamingDestinationInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(UpdateKinesisStreamingConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateKinesisStreamingDestinationInput {}

                            impl Hash
                                for UpdateKinesisStreamingDestinationInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateKinesisStreamingDestinationInput::UpdateKinesisStreamingDestinationInput{TableName, StreamArn, UpdateKinesisStreamingConfiguration, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(StreamArn, _state);
                                            Hash::hash(UpdateKinesisStreamingConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateKinesisStreamingDestinationInput {
                                fn default() -> UpdateKinesisStreamingDestinationInput {
                                    UpdateKinesisStreamingDestinationInput::UpdateKinesisStreamingDestinationInput {
                                        TableName: Default::default(),
                                        StreamArn: Default::default(),
                                        UpdateKinesisStreamingConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateKinesisStreamingDestinationInput>
                                for UpdateKinesisStreamingDestinationInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2752,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateKinesisStreamingDestinationOutput {
                                UpdateKinesisStreamingDestinationOutput {
                                    TableName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    StreamArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    DestinationStatus: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DestinationStatus>>>,
                                    UpdateKinesisStreamingConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateKinesisStreamingConfiguration>>>
                                }
                            }

                            impl UpdateKinesisStreamingDestinationOutput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateKinesisStreamingDestinationOutput::UpdateKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, UpdateKinesisStreamingConfiguration, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field StreamArn
                                pub fn StreamArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateKinesisStreamingDestinationOutput::UpdateKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, UpdateKinesisStreamingConfiguration, } => StreamArn,
                                    }
                                }
                                /// Returns a borrow of the field DestinationStatus
                                pub fn DestinationStatus(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DestinationStatus>>> {
                                    match self {
                                        UpdateKinesisStreamingDestinationOutput::UpdateKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, UpdateKinesisStreamingConfiguration, } => DestinationStatus,
                                    }
                                }
                                /// Returns a borrow of the field UpdateKinesisStreamingConfiguration
                                pub fn UpdateKinesisStreamingConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::UpdateKinesisStreamingConfiguration>>> {
                                    match self {
                                        UpdateKinesisStreamingDestinationOutput::UpdateKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, UpdateKinesisStreamingConfiguration, } => UpdateKinesisStreamingConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateKinesisStreamingDestinationOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateKinesisStreamingDestinationOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateKinesisStreamingDestinationOutput::UpdateKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, UpdateKinesisStreamingConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateKinesisStreamingDestinationOutput.UpdateKinesisStreamingDestinationOutput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DestinationStatus, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(UpdateKinesisStreamingConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateKinesisStreamingDestinationOutput {}

                            impl Hash
                                for UpdateKinesisStreamingDestinationOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateKinesisStreamingDestinationOutput::UpdateKinesisStreamingDestinationOutput{TableName, StreamArn, DestinationStatus, UpdateKinesisStreamingConfiguration, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(StreamArn, _state);
                                            Hash::hash(DestinationStatus, _state);
                                            Hash::hash(UpdateKinesisStreamingConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateKinesisStreamingDestinationOutput {
                                fn default() -> UpdateKinesisStreamingDestinationOutput {
                                    UpdateKinesisStreamingDestinationOutput::UpdateKinesisStreamingDestinationOutput {
                                        TableName: Default::default(),
                                        StreamArn: Default::default(),
                                        DestinationStatus: Default::default(),
                                        UpdateKinesisStreamingConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateKinesisStreamingDestinationOutput>
                                for UpdateKinesisStreamingDestinationOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2758,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateReplicationGroupMemberAction {
                                UpdateReplicationGroupMemberAction {
                                    RegionName: Sequence<DafnyCharUTF16>,
                                    KMSMasterKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ProvisionedThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride>>>,
                                    OnDemandThroughputOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughputOverride>>>,
                                    GlobalSecondaryIndexes: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexList>>,
                                    TableClassOverride: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>>
                                }
                            }

                            impl UpdateReplicationGroupMemberAction {
                                /// Returns a borrow of the field RegionName
                                pub fn RegionName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateReplicationGroupMemberAction::UpdateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => RegionName,
                                    }
                                }
                                /// Returns a borrow of the field KMSMasterKeyId
                                pub fn KMSMasterKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateReplicationGroupMemberAction::UpdateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => KMSMasterKeyId,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughputOverride
                                pub fn ProvisionedThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughputOverride>>> {
                                    match self {
                                        UpdateReplicationGroupMemberAction::UpdateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => ProvisionedThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughputOverride
                                pub fn OnDemandThroughputOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughputOverride>>> {
                                    match self {
                                        UpdateReplicationGroupMemberAction::UpdateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => OnDemandThroughputOverride,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexes
                                pub fn GlobalSecondaryIndexes(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaGlobalSecondaryIndexList>> {
                                    match self {
                                        UpdateReplicationGroupMemberAction::UpdateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => GlobalSecondaryIndexes,
                                    }
                                }
                                /// Returns a borrow of the field TableClassOverride
                                pub fn TableClassOverride(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>> {
                                    match self {
                                        UpdateReplicationGroupMemberAction::UpdateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => TableClassOverride,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateReplicationGroupMemberAction {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateReplicationGroupMemberAction {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateReplicationGroupMemberAction::UpdateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateReplicationGroupMemberAction.UpdateReplicationGroupMemberAction(")?;
                                            DafnyPrint::fmt_print(RegionName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KMSMasterKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughputOverride, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableClassOverride, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateReplicationGroupMemberAction {}

                            impl Hash
                                for UpdateReplicationGroupMemberAction {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateReplicationGroupMemberAction::UpdateReplicationGroupMemberAction{RegionName, KMSMasterKeyId, ProvisionedThroughputOverride, OnDemandThroughputOverride, GlobalSecondaryIndexes, TableClassOverride, } => {
                                            Hash::hash(RegionName, _state);
                                            Hash::hash(KMSMasterKeyId, _state);
                                            Hash::hash(ProvisionedThroughputOverride, _state);
                                            Hash::hash(OnDemandThroughputOverride, _state);
                                            Hash::hash(GlobalSecondaryIndexes, _state);
                                            Hash::hash(TableClassOverride, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateReplicationGroupMemberAction {
                                fn default() -> UpdateReplicationGroupMemberAction {
                                    UpdateReplicationGroupMemberAction::UpdateReplicationGroupMemberAction {
                                        RegionName: Default::default(),
                                        KMSMasterKeyId: Default::default(),
                                        ProvisionedThroughputOverride: Default::default(),
                                        OnDemandThroughputOverride: Default::default(),
                                        GlobalSecondaryIndexes: Default::default(),
                                        TableClassOverride: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateReplicationGroupMemberAction>
                                for UpdateReplicationGroupMemberAction {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2766,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateTableInput {
                                UpdateTableInput {
                                    AttributeDefinitions: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition>>>>,
                                    TableName: Sequence<DafnyCharUTF16>,
                                    BillingMode: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>>,
                                    ProvisionedThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>>,
                                    GlobalSecondaryIndexUpdates: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexUpdate>>>>,
                                    StreamSpecification: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification>>>,
                                    SSESpecification: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification>>>,
                                    ReplicaUpdates: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicationGroupUpdateList>>,
                                    TableClass: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>>,
                                    DeletionProtectionEnabled: Arc<Option<bool>>,
                                    OnDemandThroughput: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>>
                                }
                            }

                            impl UpdateTableInput {
                                /// Returns a borrow of the field AttributeDefinitions
                                pub fn AttributeDefinitions(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition>>>> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => AttributeDefinitions,
                                    }
                                }
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field BillingMode
                                pub fn BillingMode(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode>>> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => BillingMode,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedThroughput
                                pub fn ProvisionedThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput>>> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => ProvisionedThroughput,
                                    }
                                }
                                /// Returns a borrow of the field GlobalSecondaryIndexUpdates
                                pub fn GlobalSecondaryIndexUpdates(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexUpdate>>>> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => GlobalSecondaryIndexUpdates,
                                    }
                                }
                                /// Returns a borrow of the field StreamSpecification
                                pub fn StreamSpecification(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification>>> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => StreamSpecification,
                                    }
                                }
                                /// Returns a borrow of the field SSESpecification
                                pub fn SSESpecification(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification>>> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => SSESpecification,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaUpdates
                                pub fn ReplicaUpdates(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicationGroupUpdateList>> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => ReplicaUpdates,
                                    }
                                }
                                /// Returns a borrow of the field TableClass
                                pub fn TableClass(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass>>> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => TableClass,
                                    }
                                }
                                /// Returns a borrow of the field DeletionProtectionEnabled
                                pub fn DeletionProtectionEnabled(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => DeletionProtectionEnabled,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandThroughput
                                pub fn OnDemandThroughput(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput>>> {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => OnDemandThroughput,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateTableInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateTableInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableInput.UpdateTableInput(")?;
                                            DafnyPrint::fmt_print(AttributeDefinitions, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BillingMode, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedThroughput, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexUpdates, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(StreamSpecification, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SSESpecification, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaUpdates, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableClass, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DeletionProtectionEnabled, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandThroughput, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateTableInput {}

                            impl Hash
                                for UpdateTableInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateTableInput::UpdateTableInput{AttributeDefinitions, TableName, BillingMode, ProvisionedThroughput, GlobalSecondaryIndexUpdates, StreamSpecification, SSESpecification, ReplicaUpdates, TableClass, DeletionProtectionEnabled, OnDemandThroughput, } => {
                                            Hash::hash(AttributeDefinitions, _state);
                                            Hash::hash(TableName, _state);
                                            Hash::hash(BillingMode, _state);
                                            Hash::hash(ProvisionedThroughput, _state);
                                            Hash::hash(GlobalSecondaryIndexUpdates, _state);
                                            Hash::hash(StreamSpecification, _state);
                                            Hash::hash(SSESpecification, _state);
                                            Hash::hash(ReplicaUpdates, _state);
                                            Hash::hash(TableClass, _state);
                                            Hash::hash(DeletionProtectionEnabled, _state);
                                            Hash::hash(OnDemandThroughput, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateTableInput {
                                fn default() -> UpdateTableInput {
                                    UpdateTableInput::UpdateTableInput {
                                        AttributeDefinitions: Default::default(),
                                        TableName: Default::default(),
                                        BillingMode: Default::default(),
                                        ProvisionedThroughput: Default::default(),
                                        GlobalSecondaryIndexUpdates: Default::default(),
                                        StreamSpecification: Default::default(),
                                        SSESpecification: Default::default(),
                                        ReplicaUpdates: Default::default(),
                                        TableClass: Default::default(),
                                        DeletionProtectionEnabled: Default::default(),
                                        OnDemandThroughput: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateTableInput>
                                for UpdateTableInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2779,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateTableOutput {
                                UpdateTableOutput {
                                    TableDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>>
                                }
                            }

                            impl UpdateTableOutput {
                                /// Returns a borrow of the field TableDescription
                                pub fn TableDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription>>> {
                                    match self {
                                        UpdateTableOutput::UpdateTableOutput{TableDescription, } => TableDescription,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateTableOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateTableOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateTableOutput::UpdateTableOutput{TableDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableOutput.UpdateTableOutput(")?;
                                            DafnyPrint::fmt_print(TableDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateTableOutput {}

                            impl Hash
                                for UpdateTableOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateTableOutput::UpdateTableOutput{TableDescription, } => {
                                            Hash::hash(TableDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateTableOutput {
                                fn default() -> UpdateTableOutput {
                                    UpdateTableOutput::UpdateTableOutput {
                                        TableDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateTableOutput>
                                for UpdateTableOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2782,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateTableReplicaAutoScalingInput {
                                UpdateTableReplicaAutoScalingInput {
                                    GlobalSecondaryIndexUpdates: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexAutoScalingUpdateList>>,
                                    TableName: Sequence<DafnyCharUTF16>,
                                    ProvisionedWriteCapacityAutoScalingUpdate: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>>,
                                    ReplicaUpdates: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaAutoScalingUpdateList>>
                                }
                            }

                            impl UpdateTableReplicaAutoScalingInput {
                                /// Returns a borrow of the field GlobalSecondaryIndexUpdates
                                pub fn GlobalSecondaryIndexUpdates(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndexAutoScalingUpdateList>> {
                                    match self {
                                        UpdateTableReplicaAutoScalingInput::UpdateTableReplicaAutoScalingInput{GlobalSecondaryIndexUpdates, TableName, ProvisionedWriteCapacityAutoScalingUpdate, ReplicaUpdates, } => GlobalSecondaryIndexUpdates,
                                    }
                                }
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateTableReplicaAutoScalingInput::UpdateTableReplicaAutoScalingInput{GlobalSecondaryIndexUpdates, TableName, ProvisionedWriteCapacityAutoScalingUpdate, ReplicaUpdates, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field ProvisionedWriteCapacityAutoScalingUpdate
                                pub fn ProvisionedWriteCapacityAutoScalingUpdate(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AutoScalingSettingsUpdate>>> {
                                    match self {
                                        UpdateTableReplicaAutoScalingInput::UpdateTableReplicaAutoScalingInput{GlobalSecondaryIndexUpdates, TableName, ProvisionedWriteCapacityAutoScalingUpdate, ReplicaUpdates, } => ProvisionedWriteCapacityAutoScalingUpdate,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaUpdates
                                pub fn ReplicaUpdates(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReplicaAutoScalingUpdateList>> {
                                    match self {
                                        UpdateTableReplicaAutoScalingInput::UpdateTableReplicaAutoScalingInput{GlobalSecondaryIndexUpdates, TableName, ProvisionedWriteCapacityAutoScalingUpdate, ReplicaUpdates, } => ReplicaUpdates,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateTableReplicaAutoScalingInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateTableReplicaAutoScalingInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateTableReplicaAutoScalingInput::UpdateTableReplicaAutoScalingInput{GlobalSecondaryIndexUpdates, TableName, ProvisionedWriteCapacityAutoScalingUpdate, ReplicaUpdates, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableReplicaAutoScalingInput.UpdateTableReplicaAutoScalingInput(")?;
                                            DafnyPrint::fmt_print(GlobalSecondaryIndexUpdates, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ProvisionedWriteCapacityAutoScalingUpdate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaUpdates, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateTableReplicaAutoScalingInput {}

                            impl Hash
                                for UpdateTableReplicaAutoScalingInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateTableReplicaAutoScalingInput::UpdateTableReplicaAutoScalingInput{GlobalSecondaryIndexUpdates, TableName, ProvisionedWriteCapacityAutoScalingUpdate, ReplicaUpdates, } => {
                                            Hash::hash(GlobalSecondaryIndexUpdates, _state);
                                            Hash::hash(TableName, _state);
                                            Hash::hash(ProvisionedWriteCapacityAutoScalingUpdate, _state);
                                            Hash::hash(ReplicaUpdates, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateTableReplicaAutoScalingInput {
                                fn default() -> UpdateTableReplicaAutoScalingInput {
                                    UpdateTableReplicaAutoScalingInput::UpdateTableReplicaAutoScalingInput {
                                        GlobalSecondaryIndexUpdates: Default::default(),
                                        TableName: Default::default(),
                                        ProvisionedWriteCapacityAutoScalingUpdate: Default::default(),
                                        ReplicaUpdates: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateTableReplicaAutoScalingInput>
                                for UpdateTableReplicaAutoScalingInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2788,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateTableReplicaAutoScalingOutput {
                                UpdateTableReplicaAutoScalingOutput {
                                    TableAutoScalingDescription: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableAutoScalingDescription>>>
                                }
                            }

                            impl UpdateTableReplicaAutoScalingOutput {
                                /// Returns a borrow of the field TableAutoScalingDescription
                                pub fn TableAutoScalingDescription(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableAutoScalingDescription>>> {
                                    match self {
                                        UpdateTableReplicaAutoScalingOutput::UpdateTableReplicaAutoScalingOutput{TableAutoScalingDescription, } => TableAutoScalingDescription,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateTableReplicaAutoScalingOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateTableReplicaAutoScalingOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateTableReplicaAutoScalingOutput::UpdateTableReplicaAutoScalingOutput{TableAutoScalingDescription, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableReplicaAutoScalingOutput.UpdateTableReplicaAutoScalingOutput(")?;
                                            DafnyPrint::fmt_print(TableAutoScalingDescription, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateTableReplicaAutoScalingOutput {}

                            impl Hash
                                for UpdateTableReplicaAutoScalingOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateTableReplicaAutoScalingOutput::UpdateTableReplicaAutoScalingOutput{TableAutoScalingDescription, } => {
                                            Hash::hash(TableAutoScalingDescription, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateTableReplicaAutoScalingOutput {
                                fn default() -> UpdateTableReplicaAutoScalingOutput {
                                    UpdateTableReplicaAutoScalingOutput::UpdateTableReplicaAutoScalingOutput {
                                        TableAutoScalingDescription: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateTableReplicaAutoScalingOutput>
                                for UpdateTableReplicaAutoScalingOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2791,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateTimeToLiveInput {
                                UpdateTimeToLiveInput {
                                    TableName: Sequence<DafnyCharUTF16>,
                                    TimeToLiveSpecification: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TimeToLiveSpecification>
                                }
                            }

                            impl UpdateTimeToLiveInput {
                                /// Returns a borrow of the field TableName
                                pub fn TableName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateTimeToLiveInput::UpdateTimeToLiveInput{TableName, TimeToLiveSpecification, } => TableName,
                                    }
                                }
                                /// Returns a borrow of the field TimeToLiveSpecification
                                pub fn TimeToLiveSpecification(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TimeToLiveSpecification> {
                                    match self {
                                        UpdateTimeToLiveInput::UpdateTimeToLiveInput{TableName, TimeToLiveSpecification, } => TimeToLiveSpecification,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateTimeToLiveInput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateTimeToLiveInput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateTimeToLiveInput::UpdateTimeToLiveInput{TableName, TimeToLiveSpecification, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTimeToLiveInput.UpdateTimeToLiveInput(")?;
                                            DafnyPrint::fmt_print(TableName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TimeToLiveSpecification, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateTimeToLiveInput {}

                            impl Hash
                                for UpdateTimeToLiveInput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateTimeToLiveInput::UpdateTimeToLiveInput{TableName, TimeToLiveSpecification, } => {
                                            Hash::hash(TableName, _state);
                                            Hash::hash(TimeToLiveSpecification, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateTimeToLiveInput {
                                fn default() -> UpdateTimeToLiveInput {
                                    UpdateTimeToLiveInput::UpdateTimeToLiveInput {
                                        TableName: Default::default(),
                                        TimeToLiveSpecification: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateTimeToLiveInput>
                                for UpdateTimeToLiveInput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2795,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateTimeToLiveOutput {
                                UpdateTimeToLiveOutput {
                                    TimeToLiveSpecification: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TimeToLiveSpecification>>>
                                }
                            }

                            impl UpdateTimeToLiveOutput {
                                /// Returns a borrow of the field TimeToLiveSpecification
                                pub fn TimeToLiveSpecification(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TimeToLiveSpecification>>> {
                                    match self {
                                        UpdateTimeToLiveOutput::UpdateTimeToLiveOutput{TimeToLiveSpecification, } => TimeToLiveSpecification,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateTimeToLiveOutput {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateTimeToLiveOutput {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateTimeToLiveOutput::UpdateTimeToLiveOutput{TimeToLiveSpecification, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTimeToLiveOutput.UpdateTimeToLiveOutput(")?;
                                            DafnyPrint::fmt_print(TimeToLiveSpecification, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateTimeToLiveOutput {}

                            impl Hash
                                for UpdateTimeToLiveOutput {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateTimeToLiveOutput::UpdateTimeToLiveOutput{TimeToLiveSpecification, } => {
                                            Hash::hash(TimeToLiveSpecification, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateTimeToLiveOutput {
                                fn default() -> UpdateTimeToLiveOutput {
                                    UpdateTimeToLiveOutput::UpdateTimeToLiveOutput {
                                        TimeToLiveSpecification: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateTimeToLiveOutput>
                                for UpdateTimeToLiveOutput {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2798,3)
                            #[derive(PartialEq, Clone)]
                            pub enum WriteRequest {
                                WriteRequest {
                                    PutRequest: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PutRequest>>>,
                                    DeleteRequest: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteRequest>>>
                                }
                            }

                            impl WriteRequest {
                                /// Returns a borrow of the field PutRequest
                                pub fn PutRequest(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::PutRequest>>> {
                                    match self {
                                        WriteRequest::WriteRequest{PutRequest, DeleteRequest, } => PutRequest,
                                    }
                                }
                                /// Returns a borrow of the field DeleteRequest
                                pub fn DeleteRequest(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DeleteRequest>>> {
                                    match self {
                                        WriteRequest::WriteRequest{PutRequest, DeleteRequest, } => DeleteRequest,
                                    }
                                }
                            }

                            impl Debug
                                for WriteRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for WriteRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        WriteRequest::WriteRequest{PutRequest, DeleteRequest, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.WriteRequest.WriteRequest(")?;
                                            DafnyPrint::fmt_print(PutRequest, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DeleteRequest, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for WriteRequest {}

                            impl Hash
                                for WriteRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        WriteRequest::WriteRequest{PutRequest, DeleteRequest, } => {
                                            Hash::hash(PutRequest, _state);
                                            Hash::hash(DeleteRequest, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for WriteRequest {
                                fn default() -> WriteRequest {
                                    WriteRequest::WriteRequest {
                                        PutRequest: Default::default(),
                                        DeleteRequest: Default::default()
                                    }
                                }
                            }

                            impl AsRef<WriteRequest>
                                for WriteRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2802,3)
                            pub type WriteRequests = Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::WriteRequest>>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2806,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Error {
                                BackupInUseException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                BackupNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ConditionalCheckFailedException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Item: Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>>
                                },
                                ContinuousBackupsUnavailableException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                DuplicateItemException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ExportConflictException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ExportNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                GlobalTableAlreadyExistsException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                GlobalTableNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                IdempotentParameterMismatchException {
                                    Message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ImportConflictException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ImportNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                IndexNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InternalServerError {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidEndpointException {
                                    Message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidExportTimeException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidRestoreTimeException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ItemCollectionSizeLimitExceededException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                LimitExceededException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                PointInTimeRecoveryUnavailableException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                PolicyNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ProvisionedThroughputExceededException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ReplicaAlreadyExistsException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ReplicaNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                RequestLimitExceeded {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ResourceInUseException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ResourceNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                TableAlreadyExistsException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                TableInUseException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                TableNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                TransactionCanceledException {
                                    Message: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CancellationReasons: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CancellationReasonList>>
                                },
                                TransactionConflictException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                TransactionInProgressException {
                                    Message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                Opaque {
                                    obj: Object<dyn Any + Sync + Send>
                                },
                                OpaqueWithText {
                                    obj: Object<dyn Any + Sync + Send>,
                                    objMessage: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl Error {
                                /// Gets the field message for all enum members which have it
                                pub fn message(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        Error::BackupInUseException{message, } => message,
                                        Error::BackupNotFoundException{message, } => message,
                                        Error::ConditionalCheckFailedException{message, Item, } => message,
                                        Error::ContinuousBackupsUnavailableException{message, } => message,
                                        Error::DuplicateItemException{message, } => message,
                                        Error::ExportConflictException{message, } => message,
                                        Error::ExportNotFoundException{message, } => message,
                                        Error::GlobalTableAlreadyExistsException{message, } => message,
                                        Error::GlobalTableNotFoundException{message, } => message,
                                        Error::IdempotentParameterMismatchException{Message, } => panic!("field does not exist on this variant"),
                                        Error::ImportConflictException{message, } => message,
                                        Error::ImportNotFoundException{message, } => message,
                                        Error::IndexNotFoundException{message, } => message,
                                        Error::InternalServerError{message, } => message,
                                        Error::InvalidEndpointException{Message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidExportTimeException{message, } => message,
                                        Error::InvalidRestoreTimeException{message, } => message,
                                        Error::ItemCollectionSizeLimitExceededException{message, } => message,
                                        Error::LimitExceededException{message, } => message,
                                        Error::PointInTimeRecoveryUnavailableException{message, } => message,
                                        Error::PolicyNotFoundException{message, } => message,
                                        Error::ProvisionedThroughputExceededException{message, } => message,
                                        Error::ReplicaAlreadyExistsException{message, } => message,
                                        Error::ReplicaNotFoundException{message, } => message,
                                        Error::RequestLimitExceeded{message, } => message,
                                        Error::ResourceInUseException{message, } => message,
                                        Error::ResourceNotFoundException{message, } => message,
                                        Error::TableAlreadyExistsException{message, } => message,
                                        Error::TableInUseException{message, } => message,
                                        Error::TableNotFoundException{message, } => message,
                                        Error::TransactionCanceledException{Message, CancellationReasons, } => panic!("field does not exist on this variant"),
                                        Error::TransactionConflictException{message, } => message,
                                        Error::TransactionInProgressException{Message, } => panic!("field does not exist on this variant"),
                                        Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                        Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field Item for all enum members which have it
                                pub fn Item(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue>>>> {
                                    match self {
                                        Error::BackupInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::BackupNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::ConditionalCheckFailedException{message, Item, } => Item,
                                        Error::ContinuousBackupsUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::DuplicateItemException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExportConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExportNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::GlobalTableAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::GlobalTableNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::IdempotentParameterMismatchException{Message, } => panic!("field does not exist on this variant"),
                                        Error::ImportConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::ImportNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::IndexNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::InternalServerError{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidEndpointException{Message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidExportTimeException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidRestoreTimeException{message, } => panic!("field does not exist on this variant"),
                                        Error::ItemCollectionSizeLimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::LimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::PointInTimeRecoveryUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::PolicyNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::ProvisionedThroughputExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::ReplicaAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::ReplicaNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::RequestLimitExceeded{message, } => panic!("field does not exist on this variant"),
                                        Error::ResourceInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::ResourceNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TransactionCanceledException{Message, CancellationReasons, } => panic!("field does not exist on this variant"),
                                        Error::TransactionConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::TransactionInProgressException{Message, } => panic!("field does not exist on this variant"),
                                        Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                        Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field Message for all enum members which have it
                                pub fn Message(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        Error::BackupInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::BackupNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::ConditionalCheckFailedException{message, Item, } => panic!("field does not exist on this variant"),
                                        Error::ContinuousBackupsUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::DuplicateItemException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExportConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExportNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::GlobalTableAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::GlobalTableNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::IdempotentParameterMismatchException{Message, } => Message,
                                        Error::ImportConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::ImportNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::IndexNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::InternalServerError{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidEndpointException{Message, } => Message,
                                        Error::InvalidExportTimeException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidRestoreTimeException{message, } => panic!("field does not exist on this variant"),
                                        Error::ItemCollectionSizeLimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::LimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::PointInTimeRecoveryUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::PolicyNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::ProvisionedThroughputExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::ReplicaAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::ReplicaNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::RequestLimitExceeded{message, } => panic!("field does not exist on this variant"),
                                        Error::ResourceInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::ResourceNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TransactionCanceledException{Message, CancellationReasons, } => Message,
                                        Error::TransactionConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::TransactionInProgressException{Message, } => Message,
                                        Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                        Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field CancellationReasons for all enum members which have it
                                pub fn CancellationReasons(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CancellationReasonList>> {
                                    match self {
                                        Error::BackupInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::BackupNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::ConditionalCheckFailedException{message, Item, } => panic!("field does not exist on this variant"),
                                        Error::ContinuousBackupsUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::DuplicateItemException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExportConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExportNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::GlobalTableAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::GlobalTableNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::IdempotentParameterMismatchException{Message, } => panic!("field does not exist on this variant"),
                                        Error::ImportConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::ImportNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::IndexNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::InternalServerError{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidEndpointException{Message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidExportTimeException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidRestoreTimeException{message, } => panic!("field does not exist on this variant"),
                                        Error::ItemCollectionSizeLimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::LimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::PointInTimeRecoveryUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::PolicyNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::ProvisionedThroughputExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::ReplicaAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::ReplicaNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::RequestLimitExceeded{message, } => panic!("field does not exist on this variant"),
                                        Error::ResourceInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::ResourceNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TransactionCanceledException{Message, CancellationReasons, } => CancellationReasons,
                                        Error::TransactionConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::TransactionInProgressException{Message, } => panic!("field does not exist on this variant"),
                                        Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                        Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field obj for all enum members which have it
                                pub fn obj(&self) -> &Object<dyn Any + Sync + Send> {
                                    match self {
                                        Error::BackupInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::BackupNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::ConditionalCheckFailedException{message, Item, } => panic!("field does not exist on this variant"),
                                        Error::ContinuousBackupsUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::DuplicateItemException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExportConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExportNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::GlobalTableAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::GlobalTableNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::IdempotentParameterMismatchException{Message, } => panic!("field does not exist on this variant"),
                                        Error::ImportConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::ImportNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::IndexNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::InternalServerError{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidEndpointException{Message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidExportTimeException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidRestoreTimeException{message, } => panic!("field does not exist on this variant"),
                                        Error::ItemCollectionSizeLimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::LimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::PointInTimeRecoveryUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::PolicyNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::ProvisionedThroughputExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::ReplicaAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::ReplicaNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::RequestLimitExceeded{message, } => panic!("field does not exist on this variant"),
                                        Error::ResourceInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::ResourceNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TransactionCanceledException{Message, CancellationReasons, } => panic!("field does not exist on this variant"),
                                        Error::TransactionConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::TransactionInProgressException{Message, } => panic!("field does not exist on this variant"),
                                        Error::Opaque{obj, } => obj,
                                        Error::OpaqueWithText{obj, objMessage, } => obj,
                                    }
                                }
                                /// Gets the field objMessage for all enum members which have it
                                pub fn objMessage(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Error::BackupInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::BackupNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::ConditionalCheckFailedException{message, Item, } => panic!("field does not exist on this variant"),
                                        Error::ContinuousBackupsUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::DuplicateItemException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExportConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExportNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::GlobalTableAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::GlobalTableNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::IdempotentParameterMismatchException{Message, } => panic!("field does not exist on this variant"),
                                        Error::ImportConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::ImportNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::IndexNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::InternalServerError{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidEndpointException{Message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidExportTimeException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidRestoreTimeException{message, } => panic!("field does not exist on this variant"),
                                        Error::ItemCollectionSizeLimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::LimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::PointInTimeRecoveryUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::PolicyNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::ProvisionedThroughputExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::ReplicaAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::ReplicaNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::RequestLimitExceeded{message, } => panic!("field does not exist on this variant"),
                                        Error::ResourceInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::ResourceNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableAlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::TableNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TransactionCanceledException{Message, CancellationReasons, } => panic!("field does not exist on this variant"),
                                        Error::TransactionConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::TransactionInProgressException{Message, } => panic!("field does not exist on this variant"),
                                        Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                        Error::OpaqueWithText{obj, objMessage, } => objMessage,
                                    }
                                }
                            }

                            impl Debug
                                for Error {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Error {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Error::BackupInUseException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.BackupInUseException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::BackupNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.BackupNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ConditionalCheckFailedException{message, Item, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ConditionalCheckFailedException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Item, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ContinuousBackupsUnavailableException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ContinuousBackupsUnavailableException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::DuplicateItemException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.DuplicateItemException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ExportConflictException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ExportConflictException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ExportNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ExportNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::GlobalTableAlreadyExistsException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.GlobalTableAlreadyExistsException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::GlobalTableNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.GlobalTableNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::IdempotentParameterMismatchException{Message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.IdempotentParameterMismatchException(")?;
                                            DafnyPrint::fmt_print(Message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ImportConflictException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ImportConflictException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ImportNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ImportNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::IndexNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.IndexNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InternalServerError{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.InternalServerError(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidEndpointException{Message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.InvalidEndpointException(")?;
                                            DafnyPrint::fmt_print(Message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidExportTimeException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.InvalidExportTimeException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidRestoreTimeException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.InvalidRestoreTimeException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ItemCollectionSizeLimitExceededException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ItemCollectionSizeLimitExceededException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::LimitExceededException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.LimitExceededException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::PointInTimeRecoveryUnavailableException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.PointInTimeRecoveryUnavailableException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::PolicyNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.PolicyNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ProvisionedThroughputExceededException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ProvisionedThroughputExceededException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ReplicaAlreadyExistsException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ReplicaAlreadyExistsException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ReplicaNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ReplicaNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::RequestLimitExceeded{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.RequestLimitExceeded(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ResourceInUseException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ResourceInUseException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ResourceNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.ResourceNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::TableAlreadyExistsException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.TableAlreadyExistsException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::TableInUseException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.TableInUseException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::TableNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.TableNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::TransactionCanceledException{Message, CancellationReasons, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.TransactionCanceledException(")?;
                                            DafnyPrint::fmt_print(Message, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CancellationReasons, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::TransactionConflictException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.TransactionConflictException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::TransactionInProgressException{Message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.TransactionInProgressException(")?;
                                            DafnyPrint::fmt_print(Message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::Opaque{obj, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.Opaque(")?;
                                            DafnyPrint::fmt_print(obj, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::OpaqueWithText{obj, objMessage, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.dynamodb.internaldafny.types.Error.OpaqueWithText(")?;
                                            DafnyPrint::fmt_print(obj, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(objMessage, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Error {}

                            impl Hash
                                for Error {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Error::BackupInUseException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::BackupNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ConditionalCheckFailedException{message, Item, } => {
                                            Hash::hash(message, _state);
                                            Hash::hash(Item, _state)
                                        },
                                        Error::ContinuousBackupsUnavailableException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::DuplicateItemException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ExportConflictException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ExportNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::GlobalTableAlreadyExistsException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::GlobalTableNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::IdempotentParameterMismatchException{Message, } => {
                                            Hash::hash(Message, _state)
                                        },
                                        Error::ImportConflictException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ImportNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::IndexNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InternalServerError{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InvalidEndpointException{Message, } => {
                                            Hash::hash(Message, _state)
                                        },
                                        Error::InvalidExportTimeException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InvalidRestoreTimeException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ItemCollectionSizeLimitExceededException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::LimitExceededException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::PointInTimeRecoveryUnavailableException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::PolicyNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ProvisionedThroughputExceededException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ReplicaAlreadyExistsException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ReplicaNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::RequestLimitExceeded{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ResourceInUseException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ResourceNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::TableAlreadyExistsException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::TableInUseException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::TableNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::TransactionCanceledException{Message, CancellationReasons, } => {
                                            Hash::hash(Message, _state);
                                            Hash::hash(CancellationReasons, _state)
                                        },
                                        Error::TransactionConflictException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::TransactionInProgressException{Message, } => {
                                            Hash::hash(Message, _state)
                                        },
                                        Error::Opaque{obj, } => {
                                            Hash::hash(obj, _state)
                                        },
                                        Error::OpaqueWithText{obj, objMessage, } => {
                                            Hash::hash(obj, _state);
                                            Hash::hash(objMessage, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Error {
                                fn default() -> Error {
                                    Error::BackupInUseException {
                                        message: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Error>
                                for Error {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2916,3)
                            pub type OpaqueError = Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>;

                            /// ../mpl/ComAmazonawsDynamodb/Model/ComAmazonawsDynamodbTypes.dfy(2919,3)
                            pub type DummySubsetType = DafnyInt;

                            /// An element of DummySubsetType
                            pub fn __init_DummySubsetType() -> DafnyInt {
                                int!(1)
                            }
                        }
                    }
                }

                pub mod kms {
                    /// ../mpl/ComAmazonawsKms/src/Index.dfy(6,1)
                    pub mod internaldafny {
                        pub use ::std::sync::Arc;
                        pub use ::dafny_runtime::Sequence;
                        pub use ::dafny_runtime::DafnyCharUTF16;
                        pub use ::dafny_runtime::string_utf16_of;
                        pub use ::dafny_runtime::Object;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
                        pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error;
                        pub use ::std::fmt::Debug;
                        pub use ::std::fmt::Formatter;
                        pub use ::dafny_runtime::DafnyPrint;
                        pub use ::dafny_runtime::SequenceIter;
                        pub use ::dafny_runtime::seq;
                        pub use ::std::cmp::Eq;
                        pub use ::std::hash::Hash;
                        pub use ::std::hash::Hasher;
                        pub use ::std::default::Default;
                        pub use ::std::convert::AsRef;

                        pub struct _default {}

                        impl _default {
                            /// ../mpl/ComAmazonawsKms/src/Index.dfy(8,3)
                            pub fn DefaultKMSClientConfigType() -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::KMSClientConfigType> {
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::KMSClientConfigType::KMSClientConfigType {})
                            }
                            /// ../mpl/ComAmazonawsKms/src/Index.dfy(31,3)
                            pub fn DafnyUserAgentSuffix(runtime: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
                                let mut version: Sequence<DafnyCharUTF16> = string_utf16_of("1.11.0");
                                string_utf16_of("AwsCryptographicMPL/").concat(runtime).concat(&string_utf16_of("/")).concat(&version)
                            }
                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(2006,3)
                            pub fn CreateSuccessOfClient(client: &Object<dyn IKMSClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKMSClient>, Arc<Error>>> {
                                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<dyn IKMSClient>, Arc<Error>>::Success {
                                        value: client.clone()
                                    })
                            }
                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(2009,3)
                            pub fn CreateFailureOfError(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKMSClient>, Arc<Error>>> {
                                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<dyn IKMSClient>, Arc<Error>>::Failure {
                                        error: error.clone()
                                    })
                            }
                        }

                        /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1996,3)
                        #[derive(PartialEq, Clone)]
                        pub enum KMSClientConfigType {
                            KMSClientConfigType {}
                        }

                        impl KMSClientConfigType {}

                        impl Debug
                            for KMSClientConfigType {
                            fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                DafnyPrint::fmt_print(self, f, true)
                            }
                        }

                        impl DafnyPrint
                            for KMSClientConfigType {
                            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                match self {
                                    KMSClientConfigType::KMSClientConfigType{} => {
                                        write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.KMSClientConfigType.KMSClientConfigType")?;
                                        Ok(())
                                    },
                                }
                            }
                        }

                        impl KMSClientConfigType {
                            /// Enumerates all possible values of KMSClientConfigType
                            pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KMSClientConfigType>> {
                                seq![Arc::new(KMSClientConfigType::KMSClientConfigType {})].iter()
                            }
                        }

                        impl Eq
                            for KMSClientConfigType {}

                        impl Hash
                            for KMSClientConfigType {
                            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                match self {
                                    KMSClientConfigType::KMSClientConfigType{} => {

                                    },
                                }
                            }
                        }

                        impl Default
                            for KMSClientConfigType {
                            fn default() -> KMSClientConfigType {
                                KMSClientConfigType::KMSClientConfigType {}
                            }
                        }

                        impl AsRef<KMSClientConfigType>
                            for KMSClientConfigType {
                            fn as_ref(&self) -> &Self {
                                self
                            }
                        }

                        /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(5,1)
                        pub mod types {
                            pub use ::dafny_runtime::Sequence;
                            pub use ::dafny_runtime::DafnyCharUTF16;
                            pub use ::dafny_runtime::int;
                            pub use ::dafny_runtime::truncate;
                            pub use ::dafny_runtime::DafnyInt;
                            pub use ::dafny_runtime::DafnyType;
                            pub use ::std::fmt::Debug;
                            pub use ::std::fmt::Formatter;
                            pub use ::dafny_runtime::DafnyPrint;
                            pub use ::std::cmp::Eq;
                            pub use ::std::hash::Hash;
                            pub use ::std::hash::Hasher;
                            pub use ::std::default::Default;
                            pub use ::std::convert::AsRef;
                            pub use ::dafny_runtime::SequenceIter;
                            pub use ::std::sync::Arc;
                            pub use ::dafny_runtime::seq;
                            pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
                            pub use ::dafny_runtime::Map;
                            pub use ::dafny_runtime::Object;
                            pub use ::dafny_runtime::allocate_object;
                            pub use ::dafny_runtime::UpcastObject;
                            pub use ::dafny_runtime::DynAny;
                            pub use ::dafny_runtime::UpcastObjectFn;
                            pub use ::dafny_runtime::Any;
                            pub use ::std::marker::Sync;
                            pub use ::std::marker::Send;

                            pub struct _default {}

                            impl _default {
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(31,3)
                                pub fn IsValid_AliasNameType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(256) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(35,3)
                                pub fn IsValid_ArnType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(20)) && !(int!(2048) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(39,3)
                                pub fn IsValid_AttestationDocumentType(x: &Sequence<u8>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(b"262144") < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(51,3)
                                pub fn IsValid_CiphertextType(x: &Sequence<u8>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(6144) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(55,3)
                                pub fn IsValid_CloudHsmClusterIdType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(19)) && !(int!(24) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(153,3)
                                pub fn IsValid_CustomKeyStoreIdType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(64) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(157,3)
                                pub fn IsValid_CustomKeyStoreNameType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(256) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(248,3)
                                pub fn IsValid_DescriptionType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(0)) && !(int!(8192) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(420,3)
                                pub fn IsValid_GrantIdType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(128) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(436,3)
                                pub fn IsValid_GrantNameType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(256) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(459,3)
                                pub fn IsValid_GrantTokenList(x: &Sequence<Sequence<DafnyCharUTF16>>) -> bool {
                                    !(x.cardinality() < int!(0)) && !(int!(10) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(463,3)
                                pub fn IsValid_GrantTokenType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(8192) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(482,3)
                                pub fn IsValid_KeyIdType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(2048) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(544,3)
                                pub fn IsValid_KeyStorePasswordType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(7)) && !(int!(32) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(553,3)
                                pub fn IsValid_LimitType(x: i32) -> bool {
                                    !(x < truncate!(int!(1), i32)) && !(truncate!(int!(1000), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(624,3)
                                pub fn IsValid_MarkerType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(1024) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(645,3)
                                pub fn IsValid_NumberOfBytesType(x: i32) -> bool {
                                    !(x < truncate!(int!(1), i32)) && !(truncate!(int!(1024), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(654,3)
                                pub fn IsValid_PendingWindowInDaysType(x: i32) -> bool {
                                    !(x < truncate!(int!(1), i32)) && !(truncate!(int!(365), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(658,3)
                                pub fn IsValid_PlaintextType(x: &Sequence<u8>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(4096) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(663,3)
                                pub fn IsValid_PolicyNameType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(128) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(667,3)
                                pub fn IsValid_PolicyType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(b"131072") < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(671,3)
                                pub fn IsValid_PrincipalIdType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(256) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(675,3)
                                pub fn IsValid_PublicKeyType(x: &Sequence<u8>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(8192) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(707,3)
                                pub fn IsValid_RegionType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(32) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(741,3)
                                pub fn IsValid_RotationPeriodInDaysType(x: i32) -> bool {
                                    !(x < truncate!(int!(90), i32)) && !(truncate!(int!(2560), i32) < x)
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(794,3)
                                pub fn IsValid_TagKeyType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(128) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(803,3)
                                pub fn IsValid_TagValueType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(0)) && !(int!(256) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1723,3)
                                pub fn IsValid_TrustAnchorCertificateType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(5000) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1792,3)
                                pub fn IsValid_XksKeyIdType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(1)) && !(int!(128) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1796,3)
                                pub fn IsValid_XksProxyAuthenticationAccessKeyIdType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(20)) && !(int!(30) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1804,3)
                                pub fn IsValid_XksProxyAuthenticationRawSecretAccessKeyType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(43)) && !(int!(64) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1818,3)
                                pub fn IsValid_XksProxyUriEndpointType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(10)) && !(int!(128) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1822,3)
                                pub fn IsValid_XksProxyUriPathType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(10)) && !(int!(128) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1826,3)
                                pub fn IsValid_XksProxyVpcEndpointServiceNameType(x: &Sequence<DafnyCharUTF16>) -> bool {
                                    !(x.cardinality() < int!(20)) && !(int!(64) < x.cardinality())
                                }
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1986,3)
                                pub fn IsDummySubsetType(x: &DafnyInt) -> bool {
                                    int!(0) < x.clone()
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(11,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DafnyCallEvent<I: DafnyType, O: DafnyType> {
                                DafnyCallEvent {
                                    input: I,
                                    output: O
                                }
                            }

                            impl<I: DafnyType, O: DafnyType> DafnyCallEvent<I, O> {
                                /// Returns a borrow of the field input
                                pub fn input(&self) -> &I {
                                    match self {
                                        DafnyCallEvent::DafnyCallEvent{input, output, } => input,
                                    }
                                }
                                /// Returns a borrow of the field output
                                pub fn output(&self) -> &O {
                                    match self {
                                        DafnyCallEvent::DafnyCallEvent{input, output, } => output,
                                    }
                                }
                            }

                            impl<I: DafnyType, O: DafnyType> Debug
                                for DafnyCallEvent<I, O> {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl<I: DafnyType, O: DafnyType> DafnyPrint
                                for DafnyCallEvent<I, O> {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DafnyCallEvent.DafnyCallEvent(")?;
                                            DafnyPrint::fmt_print(input, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(output, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl<I: DafnyType + Eq, O: DafnyType + Eq> Eq
                                for DafnyCallEvent<I, O> {}

                            impl<I: DafnyType + Hash, O: DafnyType + Hash> Hash
                                for DafnyCallEvent<I, O> {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DafnyCallEvent::DafnyCallEvent{input, output, } => {
                                            Hash::hash(input, _state);
                                            Hash::hash(output, _state)
                                        },
                                    }
                                }
                            }

                            impl<I: DafnyType + Default, O: DafnyType + Default> Default
                                for DafnyCallEvent<I, O> {
                                fn default() -> DafnyCallEvent<I, O> {
                                    DafnyCallEvent::DafnyCallEvent {
                                        input: Default::default(),
                                        output: Default::default()
                                    }
                                }
                            }

                            impl<I: DafnyType, O: DafnyType> AsRef<DafnyCallEvent<I, O>>
                                for DafnyCallEvent<I, O> {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(15,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AlgorithmSpec {
                                RSAES_PKCS1_V1_5 {},
                                RSAES_OAEP_SHA_1 {},
                                RSAES_OAEP_SHA_256 {},
                                RSA_AES_KEY_WRAP_SHA_1 {},
                                RSA_AES_KEY_WRAP_SHA_256 {},
                                SM2PKE {}
                            }

                            impl AlgorithmSpec {}

                            impl Debug
                                for AlgorithmSpec {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AlgorithmSpec {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AlgorithmSpec::RSAES_PKCS1_V1_5{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.AlgorithmSpec.RSAES__PKCS1__V1__5")?;
                                            Ok(())
                                        },
                                        AlgorithmSpec::RSAES_OAEP_SHA_1{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.AlgorithmSpec.RSAES__OAEP__SHA__1")?;
                                            Ok(())
                                        },
                                        AlgorithmSpec::RSAES_OAEP_SHA_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.AlgorithmSpec.RSAES__OAEP__SHA__256")?;
                                            Ok(())
                                        },
                                        AlgorithmSpec::RSA_AES_KEY_WRAP_SHA_1{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.AlgorithmSpec.RSA__AES__KEY__WRAP__SHA__1")?;
                                            Ok(())
                                        },
                                        AlgorithmSpec::RSA_AES_KEY_WRAP_SHA_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.AlgorithmSpec.RSA__AES__KEY__WRAP__SHA__256")?;
                                            Ok(())
                                        },
                                        AlgorithmSpec::SM2PKE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.AlgorithmSpec.SM2PKE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl AlgorithmSpec {
                                /// Enumerates all possible values of AlgorithmSpec
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<AlgorithmSpec>> {
                                    seq![Arc::new(AlgorithmSpec::RSAES_PKCS1_V1_5 {}), Arc::new(AlgorithmSpec::RSAES_OAEP_SHA_1 {}), Arc::new(AlgorithmSpec::RSAES_OAEP_SHA_256 {}), Arc::new(AlgorithmSpec::RSA_AES_KEY_WRAP_SHA_1 {}), Arc::new(AlgorithmSpec::RSA_AES_KEY_WRAP_SHA_256 {}), Arc::new(AlgorithmSpec::SM2PKE {})].iter()
                                }
                            }

                            impl Eq
                                for AlgorithmSpec {}

                            impl Hash
                                for AlgorithmSpec {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AlgorithmSpec::RSAES_PKCS1_V1_5{} => {

                                        },
                                        AlgorithmSpec::RSAES_OAEP_SHA_1{} => {

                                        },
                                        AlgorithmSpec::RSAES_OAEP_SHA_256{} => {

                                        },
                                        AlgorithmSpec::RSA_AES_KEY_WRAP_SHA_1{} => {

                                        },
                                        AlgorithmSpec::RSA_AES_KEY_WRAP_SHA_256{} => {

                                        },
                                        AlgorithmSpec::SM2PKE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for AlgorithmSpec {
                                fn default() -> AlgorithmSpec {
                                    AlgorithmSpec::RSAES_PKCS1_V1_5 {}
                                }
                            }

                            impl AsRef<AlgorithmSpec>
                                for AlgorithmSpec {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(23,3)
                            #[derive(PartialEq, Clone)]
                            pub enum AliasListEntry {
                                AliasListEntry {
                                    AliasName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    AliasArn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TargetKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CreationDate: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    LastUpdatedDate: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl AliasListEntry {
                                /// Returns a borrow of the field AliasName
                                pub fn AliasName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        AliasListEntry::AliasListEntry{AliasName, AliasArn, TargetKeyId, CreationDate, LastUpdatedDate, } => AliasName,
                                    }
                                }
                                /// Returns a borrow of the field AliasArn
                                pub fn AliasArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        AliasListEntry::AliasListEntry{AliasName, AliasArn, TargetKeyId, CreationDate, LastUpdatedDate, } => AliasArn,
                                    }
                                }
                                /// Returns a borrow of the field TargetKeyId
                                pub fn TargetKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        AliasListEntry::AliasListEntry{AliasName, AliasArn, TargetKeyId, CreationDate, LastUpdatedDate, } => TargetKeyId,
                                    }
                                }
                                /// Returns a borrow of the field CreationDate
                                pub fn CreationDate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        AliasListEntry::AliasListEntry{AliasName, AliasArn, TargetKeyId, CreationDate, LastUpdatedDate, } => CreationDate,
                                    }
                                }
                                /// Returns a borrow of the field LastUpdatedDate
                                pub fn LastUpdatedDate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        AliasListEntry::AliasListEntry{AliasName, AliasArn, TargetKeyId, CreationDate, LastUpdatedDate, } => LastUpdatedDate,
                                    }
                                }
                            }

                            impl Debug
                                for AliasListEntry {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for AliasListEntry {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        AliasListEntry::AliasListEntry{AliasName, AliasArn, TargetKeyId, CreationDate, LastUpdatedDate, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.AliasListEntry.AliasListEntry(")?;
                                            DafnyPrint::fmt_print(AliasName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AliasArn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TargetKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CreationDate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(LastUpdatedDate, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for AliasListEntry {}

                            impl Hash
                                for AliasListEntry {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        AliasListEntry::AliasListEntry{AliasName, AliasArn, TargetKeyId, CreationDate, LastUpdatedDate, } => {
                                            Hash::hash(AliasName, _state);
                                            Hash::hash(AliasArn, _state);
                                            Hash::hash(TargetKeyId, _state);
                                            Hash::hash(CreationDate, _state);
                                            Hash::hash(LastUpdatedDate, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for AliasListEntry {
                                fn default() -> AliasListEntry {
                                    AliasListEntry::AliasListEntry {
                                        AliasName: Default::default(),
                                        AliasArn: Default::default(),
                                        TargetKeyId: Default::default(),
                                        CreationDate: Default::default(),
                                        LastUpdatedDate: Default::default()
                                    }
                                }
                            }

                            impl AsRef<AliasListEntry>
                                for AliasListEntry {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(30,3)
                            pub type AliasNameType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(34,3)
                            pub type ArnType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(38,3)
                            pub type AttestationDocumentType = Sequence<u8>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(44,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CancelKeyDeletionRequest {
                                CancelKeyDeletionRequest {
                                    KeyId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl CancelKeyDeletionRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CancelKeyDeletionRequest::CancelKeyDeletionRequest{KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for CancelKeyDeletionRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CancelKeyDeletionRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CancelKeyDeletionRequest::CancelKeyDeletionRequest{KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CancelKeyDeletionRequest.CancelKeyDeletionRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CancelKeyDeletionRequest {}

                            impl Hash
                                for CancelKeyDeletionRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CancelKeyDeletionRequest::CancelKeyDeletionRequest{KeyId, } => {
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CancelKeyDeletionRequest {
                                fn default() -> CancelKeyDeletionRequest {
                                    CancelKeyDeletionRequest::CancelKeyDeletionRequest {
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CancelKeyDeletionRequest>
                                for CancelKeyDeletionRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(47,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CancelKeyDeletionResponse {
                                CancelKeyDeletionResponse {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl CancelKeyDeletionResponse {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CancelKeyDeletionResponse::CancelKeyDeletionResponse{KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for CancelKeyDeletionResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CancelKeyDeletionResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CancelKeyDeletionResponse::CancelKeyDeletionResponse{KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CancelKeyDeletionResponse.CancelKeyDeletionResponse(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CancelKeyDeletionResponse {}

                            impl Hash
                                for CancelKeyDeletionResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CancelKeyDeletionResponse::CancelKeyDeletionResponse{KeyId, } => {
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CancelKeyDeletionResponse {
                                fn default() -> CancelKeyDeletionResponse {
                                    CancelKeyDeletionResponse::CancelKeyDeletionResponse {
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CancelKeyDeletionResponse>
                                for CancelKeyDeletionResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(50,3)
                            pub type CiphertextType = Sequence<u8>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(54,3)
                            pub type CloudHsmClusterIdType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(58,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ConnectCustomKeyStoreRequest {
                                ConnectCustomKeyStoreRequest {
                                    CustomKeyStoreId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl ConnectCustomKeyStoreRequest {
                                /// Returns a borrow of the field CustomKeyStoreId
                                pub fn CustomKeyStoreId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ConnectCustomKeyStoreRequest::ConnectCustomKeyStoreRequest{CustomKeyStoreId, } => CustomKeyStoreId,
                                    }
                                }
                            }

                            impl Debug
                                for ConnectCustomKeyStoreRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ConnectCustomKeyStoreRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ConnectCustomKeyStoreRequest::ConnectCustomKeyStoreRequest{CustomKeyStoreId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectCustomKeyStoreRequest.ConnectCustomKeyStoreRequest(")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ConnectCustomKeyStoreRequest {}

                            impl Hash
                                for ConnectCustomKeyStoreRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ConnectCustomKeyStoreRequest::ConnectCustomKeyStoreRequest{CustomKeyStoreId, } => {
                                            Hash::hash(CustomKeyStoreId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ConnectCustomKeyStoreRequest {
                                fn default() -> ConnectCustomKeyStoreRequest {
                                    ConnectCustomKeyStoreRequest::ConnectCustomKeyStoreRequest {
                                        CustomKeyStoreId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ConnectCustomKeyStoreRequest>
                                for ConnectCustomKeyStoreRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(61,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ConnectCustomKeyStoreResponse {
                                ConnectCustomKeyStoreResponse {}
                            }

                            impl ConnectCustomKeyStoreResponse {}

                            impl Debug
                                for ConnectCustomKeyStoreResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ConnectCustomKeyStoreResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ConnectCustomKeyStoreResponse::ConnectCustomKeyStoreResponse{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectCustomKeyStoreResponse.ConnectCustomKeyStoreResponse")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ConnectCustomKeyStoreResponse {
                                /// Enumerates all possible values of ConnectCustomKeyStoreResponse
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ConnectCustomKeyStoreResponse>> {
                                    seq![Arc::new(ConnectCustomKeyStoreResponse::ConnectCustomKeyStoreResponse {})].iter()
                                }
                            }

                            impl Eq
                                for ConnectCustomKeyStoreResponse {}

                            impl Hash
                                for ConnectCustomKeyStoreResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ConnectCustomKeyStoreResponse::ConnectCustomKeyStoreResponse{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ConnectCustomKeyStoreResponse {
                                fn default() -> ConnectCustomKeyStoreResponse {
                                    ConnectCustomKeyStoreResponse::ConnectCustomKeyStoreResponse {}
                                }
                            }

                            impl AsRef<ConnectCustomKeyStoreResponse>
                                for ConnectCustomKeyStoreResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(64,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ConnectionErrorCodeType {
                                INVALID_CREDENTIALS {},
                                CLUSTER_NOT_FOUND {},
                                NETWORK_ERRORS {},
                                INTERNAL_ERROR {},
                                INSUFFICIENT_CLOUDHSM_HSMS {},
                                USER_LOCKED_OUT {},
                                USER_NOT_FOUND {},
                                USER_LOGGED_IN {},
                                SUBNET_NOT_FOUND {},
                                INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET {},
                                XKS_PROXY_ACCESS_DENIED {},
                                XKS_PROXY_NOT_REACHABLE {},
                                XKS_VPC_ENDPOINT_SERVICE_NOT_FOUND {},
                                XKS_PROXY_INVALID_RESPONSE {},
                                XKS_PROXY_INVALID_CONFIGURATION {},
                                XKS_VPC_ENDPOINT_SERVICE_INVALID_CONFIGURATION {},
                                XKS_PROXY_TIMED_OUT {},
                                XKS_PROXY_INVALID_TLS_CONFIGURATION {}
                            }

                            impl ConnectionErrorCodeType {}

                            impl Debug
                                for ConnectionErrorCodeType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ConnectionErrorCodeType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ConnectionErrorCodeType::INVALID_CREDENTIALS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.INVALID__CREDENTIALS")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::CLUSTER_NOT_FOUND{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.CLUSTER__NOT__FOUND")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::NETWORK_ERRORS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.NETWORK__ERRORS")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::INTERNAL_ERROR{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.INTERNAL__ERROR")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::INSUFFICIENT_CLOUDHSM_HSMS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.INSUFFICIENT__CLOUDHSM__HSMS")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::USER_LOCKED_OUT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.USER__LOCKED__OUT")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::USER_NOT_FOUND{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.USER__NOT__FOUND")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::USER_LOGGED_IN{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.USER__LOGGED__IN")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::SUBNET_NOT_FOUND{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.SUBNET__NOT__FOUND")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.INSUFFICIENT__FREE__ADDRESSES__IN__SUBNET")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_ACCESS_DENIED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.XKS__PROXY__ACCESS__DENIED")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_NOT_REACHABLE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.XKS__PROXY__NOT__REACHABLE")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::XKS_VPC_ENDPOINT_SERVICE_NOT_FOUND{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.XKS__VPC__ENDPOINT__SERVICE__NOT__FOUND")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_INVALID_RESPONSE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.XKS__PROXY__INVALID__RESPONSE")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_INVALID_CONFIGURATION{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.XKS__PROXY__INVALID__CONFIGURATION")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::XKS_VPC_ENDPOINT_SERVICE_INVALID_CONFIGURATION{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.XKS__VPC__ENDPOINT__SERVICE__INVALID__CONFIGURATION")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_TIMED_OUT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.XKS__PROXY__TIMED__OUT")?;
                                            Ok(())
                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_INVALID_TLS_CONFIGURATION{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.XKS__PROXY__INVALID__TLS__CONFIGURATION")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ConnectionErrorCodeType {
                                /// Enumerates all possible values of ConnectionErrorCodeType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ConnectionErrorCodeType>> {
                                    seq![Arc::new(ConnectionErrorCodeType::INVALID_CREDENTIALS {}), Arc::new(ConnectionErrorCodeType::CLUSTER_NOT_FOUND {}), Arc::new(ConnectionErrorCodeType::NETWORK_ERRORS {}), Arc::new(ConnectionErrorCodeType::INTERNAL_ERROR {}), Arc::new(ConnectionErrorCodeType::INSUFFICIENT_CLOUDHSM_HSMS {}), Arc::new(ConnectionErrorCodeType::USER_LOCKED_OUT {}), Arc::new(ConnectionErrorCodeType::USER_NOT_FOUND {}), Arc::new(ConnectionErrorCodeType::USER_LOGGED_IN {}), Arc::new(ConnectionErrorCodeType::SUBNET_NOT_FOUND {}), Arc::new(ConnectionErrorCodeType::INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET {}), Arc::new(ConnectionErrorCodeType::XKS_PROXY_ACCESS_DENIED {}), Arc::new(ConnectionErrorCodeType::XKS_PROXY_NOT_REACHABLE {}), Arc::new(ConnectionErrorCodeType::XKS_VPC_ENDPOINT_SERVICE_NOT_FOUND {}), Arc::new(ConnectionErrorCodeType::XKS_PROXY_INVALID_RESPONSE {}), Arc::new(ConnectionErrorCodeType::XKS_PROXY_INVALID_CONFIGURATION {}), Arc::new(ConnectionErrorCodeType::XKS_VPC_ENDPOINT_SERVICE_INVALID_CONFIGURATION {}), Arc::new(ConnectionErrorCodeType::XKS_PROXY_TIMED_OUT {}), Arc::new(ConnectionErrorCodeType::XKS_PROXY_INVALID_TLS_CONFIGURATION {})].iter()
                                }
                            }

                            impl Eq
                                for ConnectionErrorCodeType {}

                            impl Hash
                                for ConnectionErrorCodeType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ConnectionErrorCodeType::INVALID_CREDENTIALS{} => {

                                        },
                                        ConnectionErrorCodeType::CLUSTER_NOT_FOUND{} => {

                                        },
                                        ConnectionErrorCodeType::NETWORK_ERRORS{} => {

                                        },
                                        ConnectionErrorCodeType::INTERNAL_ERROR{} => {

                                        },
                                        ConnectionErrorCodeType::INSUFFICIENT_CLOUDHSM_HSMS{} => {

                                        },
                                        ConnectionErrorCodeType::USER_LOCKED_OUT{} => {

                                        },
                                        ConnectionErrorCodeType::USER_NOT_FOUND{} => {

                                        },
                                        ConnectionErrorCodeType::USER_LOGGED_IN{} => {

                                        },
                                        ConnectionErrorCodeType::SUBNET_NOT_FOUND{} => {

                                        },
                                        ConnectionErrorCodeType::INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET{} => {

                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_ACCESS_DENIED{} => {

                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_NOT_REACHABLE{} => {

                                        },
                                        ConnectionErrorCodeType::XKS_VPC_ENDPOINT_SERVICE_NOT_FOUND{} => {

                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_INVALID_RESPONSE{} => {

                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_INVALID_CONFIGURATION{} => {

                                        },
                                        ConnectionErrorCodeType::XKS_VPC_ENDPOINT_SERVICE_INVALID_CONFIGURATION{} => {

                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_TIMED_OUT{} => {

                                        },
                                        ConnectionErrorCodeType::XKS_PROXY_INVALID_TLS_CONFIGURATION{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ConnectionErrorCodeType {
                                fn default() -> ConnectionErrorCodeType {
                                    ConnectionErrorCodeType::INVALID_CREDENTIALS {}
                                }
                            }

                            impl AsRef<ConnectionErrorCodeType>
                                for ConnectionErrorCodeType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(83,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ConnectionStateType {
                                CONNECTED {},
                                CONNECTING {},
                                FAILED {},
                                DISCONNECTED {},
                                DISCONNECTING {}
                            }

                            impl ConnectionStateType {}

                            impl Debug
                                for ConnectionStateType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ConnectionStateType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ConnectionStateType::CONNECTED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionStateType.CONNECTED")?;
                                            Ok(())
                                        },
                                        ConnectionStateType::CONNECTING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionStateType.CONNECTING")?;
                                            Ok(())
                                        },
                                        ConnectionStateType::FAILED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionStateType.FAILED")?;
                                            Ok(())
                                        },
                                        ConnectionStateType::DISCONNECTED{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionStateType.DISCONNECTED")?;
                                            Ok(())
                                        },
                                        ConnectionStateType::DISCONNECTING{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ConnectionStateType.DISCONNECTING")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ConnectionStateType {
                                /// Enumerates all possible values of ConnectionStateType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ConnectionStateType>> {
                                    seq![Arc::new(ConnectionStateType::CONNECTED {}), Arc::new(ConnectionStateType::CONNECTING {}), Arc::new(ConnectionStateType::FAILED {}), Arc::new(ConnectionStateType::DISCONNECTED {}), Arc::new(ConnectionStateType::DISCONNECTING {})].iter()
                                }
                            }

                            impl Eq
                                for ConnectionStateType {}

                            impl Hash
                                for ConnectionStateType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ConnectionStateType::CONNECTED{} => {

                                        },
                                        ConnectionStateType::CONNECTING{} => {

                                        },
                                        ConnectionStateType::FAILED{} => {

                                        },
                                        ConnectionStateType::DISCONNECTED{} => {

                                        },
                                        ConnectionStateType::DISCONNECTING{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ConnectionStateType {
                                fn default() -> ConnectionStateType {
                                    ConnectionStateType::CONNECTED {}
                                }
                            }

                            impl AsRef<ConnectionStateType>
                                for ConnectionStateType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(89,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateAliasRequest {
                                CreateAliasRequest {
                                    AliasName: Sequence<DafnyCharUTF16>,
                                    TargetKeyId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl CreateAliasRequest {
                                /// Returns a borrow of the field AliasName
                                pub fn AliasName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateAliasRequest::CreateAliasRequest{AliasName, TargetKeyId, } => AliasName,
                                    }
                                }
                                /// Returns a borrow of the field TargetKeyId
                                pub fn TargetKeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateAliasRequest::CreateAliasRequest{AliasName, TargetKeyId, } => TargetKeyId,
                                    }
                                }
                            }

                            impl Debug
                                for CreateAliasRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateAliasRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateAliasRequest::CreateAliasRequest{AliasName, TargetKeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CreateAliasRequest.CreateAliasRequest(")?;
                                            DafnyPrint::fmt_print(AliasName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TargetKeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateAliasRequest {}

                            impl Hash
                                for CreateAliasRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateAliasRequest::CreateAliasRequest{AliasName, TargetKeyId, } => {
                                            Hash::hash(AliasName, _state);
                                            Hash::hash(TargetKeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateAliasRequest {
                                fn default() -> CreateAliasRequest {
                                    CreateAliasRequest::CreateAliasRequest {
                                        AliasName: Default::default(),
                                        TargetKeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateAliasRequest>
                                for CreateAliasRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(93,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateCustomKeyStoreRequest {
                                CreateCustomKeyStoreRequest {
                                    CustomKeyStoreName: Sequence<DafnyCharUTF16>,
                                    CloudHsmClusterId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TrustAnchorCertificate: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyStorePassword: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CustomKeyStoreType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomKeyStoreType>>>,
                                    XksProxyUriEndpoint: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    XksProxyUriPath: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    XksProxyVpcEndpointServiceName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    XksProxyAuthenticationCredential: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyAuthenticationCredentialType>>>,
                                    XksProxyConnectivity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyConnectivityType>>>
                                }
                            }

                            impl CreateCustomKeyStoreRequest {
                                /// Returns a borrow of the field CustomKeyStoreName
                                pub fn CustomKeyStoreName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => CustomKeyStoreName,
                                    }
                                }
                                /// Returns a borrow of the field CloudHsmClusterId
                                pub fn CloudHsmClusterId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => CloudHsmClusterId,
                                    }
                                }
                                /// Returns a borrow of the field TrustAnchorCertificate
                                pub fn TrustAnchorCertificate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => TrustAnchorCertificate,
                                    }
                                }
                                /// Returns a borrow of the field KeyStorePassword
                                pub fn KeyStorePassword(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => KeyStorePassword,
                                    }
                                }
                                /// Returns a borrow of the field CustomKeyStoreType
                                pub fn CustomKeyStoreType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomKeyStoreType>>> {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => CustomKeyStoreType,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyUriEndpoint
                                pub fn XksProxyUriEndpoint(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => XksProxyUriEndpoint,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyUriPath
                                pub fn XksProxyUriPath(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => XksProxyUriPath,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyVpcEndpointServiceName
                                pub fn XksProxyVpcEndpointServiceName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => XksProxyVpcEndpointServiceName,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyAuthenticationCredential
                                pub fn XksProxyAuthenticationCredential(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyAuthenticationCredentialType>>> {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => XksProxyAuthenticationCredential,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyConnectivity
                                pub fn XksProxyConnectivity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyConnectivityType>>> {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => XksProxyConnectivity,
                                    }
                                }
                            }

                            impl Debug
                                for CreateCustomKeyStoreRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateCustomKeyStoreRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CreateCustomKeyStoreRequest.CreateCustomKeyStoreRequest(")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CloudHsmClusterId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TrustAnchorCertificate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyStorePassword, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyUriEndpoint, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyUriPath, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyVpcEndpointServiceName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyAuthenticationCredential, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyConnectivity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateCustomKeyStoreRequest {}

                            impl Hash
                                for CreateCustomKeyStoreRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest{CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, KeyStorePassword, CustomKeyStoreType, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => {
                                            Hash::hash(CustomKeyStoreName, _state);
                                            Hash::hash(CloudHsmClusterId, _state);
                                            Hash::hash(TrustAnchorCertificate, _state);
                                            Hash::hash(KeyStorePassword, _state);
                                            Hash::hash(CustomKeyStoreType, _state);
                                            Hash::hash(XksProxyUriEndpoint, _state);
                                            Hash::hash(XksProxyUriPath, _state);
                                            Hash::hash(XksProxyVpcEndpointServiceName, _state);
                                            Hash::hash(XksProxyAuthenticationCredential, _state);
                                            Hash::hash(XksProxyConnectivity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateCustomKeyStoreRequest {
                                fn default() -> CreateCustomKeyStoreRequest {
                                    CreateCustomKeyStoreRequest::CreateCustomKeyStoreRequest {
                                        CustomKeyStoreName: Default::default(),
                                        CloudHsmClusterId: Default::default(),
                                        TrustAnchorCertificate: Default::default(),
                                        KeyStorePassword: Default::default(),
                                        CustomKeyStoreType: Default::default(),
                                        XksProxyUriEndpoint: Default::default(),
                                        XksProxyUriPath: Default::default(),
                                        XksProxyVpcEndpointServiceName: Default::default(),
                                        XksProxyAuthenticationCredential: Default::default(),
                                        XksProxyConnectivity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateCustomKeyStoreRequest>
                                for CreateCustomKeyStoreRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(105,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateCustomKeyStoreResponse {
                                CreateCustomKeyStoreResponse {
                                    CustomKeyStoreId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl CreateCustomKeyStoreResponse {
                                /// Returns a borrow of the field CustomKeyStoreId
                                pub fn CustomKeyStoreId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateCustomKeyStoreResponse::CreateCustomKeyStoreResponse{CustomKeyStoreId, } => CustomKeyStoreId,
                                    }
                                }
                            }

                            impl Debug
                                for CreateCustomKeyStoreResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateCustomKeyStoreResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateCustomKeyStoreResponse::CreateCustomKeyStoreResponse{CustomKeyStoreId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CreateCustomKeyStoreResponse.CreateCustomKeyStoreResponse(")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateCustomKeyStoreResponse {}

                            impl Hash
                                for CreateCustomKeyStoreResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateCustomKeyStoreResponse::CreateCustomKeyStoreResponse{CustomKeyStoreId, } => {
                                            Hash::hash(CustomKeyStoreId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateCustomKeyStoreResponse {
                                fn default() -> CreateCustomKeyStoreResponse {
                                    CreateCustomKeyStoreResponse::CreateCustomKeyStoreResponse {
                                        CustomKeyStoreId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateCustomKeyStoreResponse>
                                for CreateCustomKeyStoreResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(108,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateGrantRequest {
                                CreateGrantRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    GranteePrincipal: Sequence<DafnyCharUTF16>,
                                    RetiringPrincipal: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Operations: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantOperation>>,
                                    Constraints: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantConstraints>>>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    Name: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl CreateGrantRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateGrantRequest::CreateGrantRequest{KeyId, GranteePrincipal, RetiringPrincipal, Operations, Constraints, GrantTokens, Name, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field GranteePrincipal
                                pub fn GranteePrincipal(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        CreateGrantRequest::CreateGrantRequest{KeyId, GranteePrincipal, RetiringPrincipal, Operations, Constraints, GrantTokens, Name, DryRun, } => GranteePrincipal,
                                    }
                                }
                                /// Returns a borrow of the field RetiringPrincipal
                                pub fn RetiringPrincipal(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateGrantRequest::CreateGrantRequest{KeyId, GranteePrincipal, RetiringPrincipal, Operations, Constraints, GrantTokens, Name, DryRun, } => RetiringPrincipal,
                                    }
                                }
                                /// Returns a borrow of the field Operations
                                pub fn Operations(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantOperation>> {
                                    match self {
                                        CreateGrantRequest::CreateGrantRequest{KeyId, GranteePrincipal, RetiringPrincipal, Operations, Constraints, GrantTokens, Name, DryRun, } => Operations,
                                    }
                                }
                                /// Returns a borrow of the field Constraints
                                pub fn Constraints(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantConstraints>>> {
                                    match self {
                                        CreateGrantRequest::CreateGrantRequest{KeyId, GranteePrincipal, RetiringPrincipal, Operations, Constraints, GrantTokens, Name, DryRun, } => Constraints,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        CreateGrantRequest::CreateGrantRequest{KeyId, GranteePrincipal, RetiringPrincipal, Operations, Constraints, GrantTokens, Name, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field Name
                                pub fn Name(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateGrantRequest::CreateGrantRequest{KeyId, GranteePrincipal, RetiringPrincipal, Operations, Constraints, GrantTokens, Name, DryRun, } => Name,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        CreateGrantRequest::CreateGrantRequest{KeyId, GranteePrincipal, RetiringPrincipal, Operations, Constraints, GrantTokens, Name, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for CreateGrantRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateGrantRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateGrantRequest::CreateGrantRequest{KeyId, GranteePrincipal, RetiringPrincipal, Operations, Constraints, GrantTokens, Name, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CreateGrantRequest.CreateGrantRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GranteePrincipal, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RetiringPrincipal, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Operations, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Constraints, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Name, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateGrantRequest {}

                            impl Hash
                                for CreateGrantRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateGrantRequest::CreateGrantRequest{KeyId, GranteePrincipal, RetiringPrincipal, Operations, Constraints, GrantTokens, Name, DryRun, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(GranteePrincipal, _state);
                                            Hash::hash(RetiringPrincipal, _state);
                                            Hash::hash(Operations, _state);
                                            Hash::hash(Constraints, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(Name, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateGrantRequest {
                                fn default() -> CreateGrantRequest {
                                    CreateGrantRequest::CreateGrantRequest {
                                        KeyId: Default::default(),
                                        GranteePrincipal: Default::default(),
                                        RetiringPrincipal: Default::default(),
                                        Operations: Default::default(),
                                        Constraints: Default::default(),
                                        GrantTokens: Default::default(),
                                        Name: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateGrantRequest>
                                for CreateGrantRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(118,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateGrantResponse {
                                CreateGrantResponse {
                                    GrantToken: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    GrantId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl CreateGrantResponse {
                                /// Returns a borrow of the field GrantToken
                                pub fn GrantToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateGrantResponse::CreateGrantResponse{GrantToken, GrantId, } => GrantToken,
                                    }
                                }
                                /// Returns a borrow of the field GrantId
                                pub fn GrantId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateGrantResponse::CreateGrantResponse{GrantToken, GrantId, } => GrantId,
                                    }
                                }
                            }

                            impl Debug
                                for CreateGrantResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateGrantResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateGrantResponse::CreateGrantResponse{GrantToken, GrantId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CreateGrantResponse.CreateGrantResponse(")?;
                                            DafnyPrint::fmt_print(GrantToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateGrantResponse {}

                            impl Hash
                                for CreateGrantResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateGrantResponse::CreateGrantResponse{GrantToken, GrantId, } => {
                                            Hash::hash(GrantToken, _state);
                                            Hash::hash(GrantId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateGrantResponse {
                                fn default() -> CreateGrantResponse {
                                    CreateGrantResponse::CreateGrantResponse {
                                        GrantToken: Default::default(),
                                        GrantId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateGrantResponse>
                                for CreateGrantResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(122,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateKeyRequest {
                                CreateKeyRequest {
                                    Policy: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Description: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyUsage: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyUsageType>>>,
                                    CustomerMasterKeySpec: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomerMasterKeySpec>>>,
                                    KeySpec: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeySpec>>>,
                                    Origin: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::OriginType>>>,
                                    CustomKeyStoreId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    BypassPolicyLockoutSafetyCheck: Arc<Option<bool>>,
                                    Tags: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Tag>>>>,
                                    MultiRegion: Arc<Option<bool>>,
                                    XksKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl CreateKeyRequest {
                                /// Returns a borrow of the field Policy
                                pub fn Policy(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => Policy,
                                    }
                                }
                                /// Returns a borrow of the field Description
                                pub fn Description(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => Description,
                                    }
                                }
                                /// Returns a borrow of the field KeyUsage
                                pub fn KeyUsage(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyUsageType>>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => KeyUsage,
                                    }
                                }
                                /// Returns a borrow of the field CustomerMasterKeySpec
                                pub fn CustomerMasterKeySpec(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomerMasterKeySpec>>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => CustomerMasterKeySpec,
                                    }
                                }
                                /// Returns a borrow of the field KeySpec
                                pub fn KeySpec(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeySpec>>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => KeySpec,
                                    }
                                }
                                /// Returns a borrow of the field Origin
                                pub fn Origin(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::OriginType>>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => Origin,
                                    }
                                }
                                /// Returns a borrow of the field CustomKeyStoreId
                                pub fn CustomKeyStoreId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => CustomKeyStoreId,
                                    }
                                }
                                /// Returns a borrow of the field BypassPolicyLockoutSafetyCheck
                                pub fn BypassPolicyLockoutSafetyCheck(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => BypassPolicyLockoutSafetyCheck,
                                    }
                                }
                                /// Returns a borrow of the field Tags
                                pub fn Tags(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Tag>>>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => Tags,
                                    }
                                }
                                /// Returns a borrow of the field MultiRegion
                                pub fn MultiRegion(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => MultiRegion,
                                    }
                                }
                                /// Returns a borrow of the field XksKeyId
                                pub fn XksKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => XksKeyId,
                                    }
                                }
                            }

                            impl Debug
                                for CreateKeyRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateKeyRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CreateKeyRequest.CreateKeyRequest(")?;
                                            DafnyPrint::fmt_print(Policy, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Description, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyUsage, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CustomerMasterKeySpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Origin, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BypassPolicyLockoutSafetyCheck, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Tags, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MultiRegion, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksKeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateKeyRequest {}

                            impl Hash
                                for CreateKeyRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateKeyRequest::CreateKeyRequest{Policy, Description, KeyUsage, CustomerMasterKeySpec, KeySpec, Origin, CustomKeyStoreId, BypassPolicyLockoutSafetyCheck, Tags, MultiRegion, XksKeyId, } => {
                                            Hash::hash(Policy, _state);
                                            Hash::hash(Description, _state);
                                            Hash::hash(KeyUsage, _state);
                                            Hash::hash(CustomerMasterKeySpec, _state);
                                            Hash::hash(KeySpec, _state);
                                            Hash::hash(Origin, _state);
                                            Hash::hash(CustomKeyStoreId, _state);
                                            Hash::hash(BypassPolicyLockoutSafetyCheck, _state);
                                            Hash::hash(Tags, _state);
                                            Hash::hash(MultiRegion, _state);
                                            Hash::hash(XksKeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateKeyRequest {
                                fn default() -> CreateKeyRequest {
                                    CreateKeyRequest::CreateKeyRequest {
                                        Policy: Default::default(),
                                        Description: Default::default(),
                                        KeyUsage: Default::default(),
                                        CustomerMasterKeySpec: Default::default(),
                                        KeySpec: Default::default(),
                                        Origin: Default::default(),
                                        CustomKeyStoreId: Default::default(),
                                        BypassPolicyLockoutSafetyCheck: Default::default(),
                                        Tags: Default::default(),
                                        MultiRegion: Default::default(),
                                        XksKeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateKeyRequest>
                                for CreateKeyRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(135,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CreateKeyResponse {
                                CreateKeyResponse {
                                    KeyMetadata: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyMetadata>>>
                                }
                            }

                            impl CreateKeyResponse {
                                /// Returns a borrow of the field KeyMetadata
                                pub fn KeyMetadata(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyMetadata>>> {
                                    match self {
                                        CreateKeyResponse::CreateKeyResponse{KeyMetadata, } => KeyMetadata,
                                    }
                                }
                            }

                            impl Debug
                                for CreateKeyResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CreateKeyResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CreateKeyResponse::CreateKeyResponse{KeyMetadata, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CreateKeyResponse.CreateKeyResponse(")?;
                                            DafnyPrint::fmt_print(KeyMetadata, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CreateKeyResponse {}

                            impl Hash
                                for CreateKeyResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CreateKeyResponse::CreateKeyResponse{KeyMetadata, } => {
                                            Hash::hash(KeyMetadata, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CreateKeyResponse {
                                fn default() -> CreateKeyResponse {
                                    CreateKeyResponse::CreateKeyResponse {
                                        KeyMetadata: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CreateKeyResponse>
                                for CreateKeyResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(138,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CustomerMasterKeySpec {
                                RSA_2048 {},
                                RSA_3072 {},
                                RSA_4096 {},
                                ECC_NIST_P256 {},
                                ECC_NIST_P384 {},
                                ECC_NIST_P521 {},
                                ECC_SECG_P256K1 {},
                                SYMMETRIC_DEFAULT {},
                                HMAC_224 {},
                                HMAC_256 {},
                                HMAC_384 {},
                                HMAC_512 {},
                                SM2 {}
                            }

                            impl CustomerMasterKeySpec {}

                            impl Debug
                                for CustomerMasterKeySpec {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CustomerMasterKeySpec {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CustomerMasterKeySpec::RSA_2048{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.RSA__2048")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::RSA_3072{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.RSA__3072")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::RSA_4096{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.RSA__4096")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::ECC_NIST_P256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.ECC__NIST__P256")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::ECC_NIST_P384{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.ECC__NIST__P384")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::ECC_NIST_P521{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.ECC__NIST__P521")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::ECC_SECG_P256K1{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.ECC__SECG__P256K1")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::SYMMETRIC_DEFAULT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.SYMMETRIC__DEFAULT")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::HMAC_224{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.HMAC__224")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::HMAC_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.HMAC__256")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::HMAC_384{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.HMAC__384")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::HMAC_512{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.HMAC__512")?;
                                            Ok(())
                                        },
                                        CustomerMasterKeySpec::SM2{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.SM2")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl CustomerMasterKeySpec {
                                /// Enumerates all possible values of CustomerMasterKeySpec
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<CustomerMasterKeySpec>> {
                                    seq![Arc::new(CustomerMasterKeySpec::RSA_2048 {}), Arc::new(CustomerMasterKeySpec::RSA_3072 {}), Arc::new(CustomerMasterKeySpec::RSA_4096 {}), Arc::new(CustomerMasterKeySpec::ECC_NIST_P256 {}), Arc::new(CustomerMasterKeySpec::ECC_NIST_P384 {}), Arc::new(CustomerMasterKeySpec::ECC_NIST_P521 {}), Arc::new(CustomerMasterKeySpec::ECC_SECG_P256K1 {}), Arc::new(CustomerMasterKeySpec::SYMMETRIC_DEFAULT {}), Arc::new(CustomerMasterKeySpec::HMAC_224 {}), Arc::new(CustomerMasterKeySpec::HMAC_256 {}), Arc::new(CustomerMasterKeySpec::HMAC_384 {}), Arc::new(CustomerMasterKeySpec::HMAC_512 {}), Arc::new(CustomerMasterKeySpec::SM2 {})].iter()
                                }
                            }

                            impl Eq
                                for CustomerMasterKeySpec {}

                            impl Hash
                                for CustomerMasterKeySpec {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CustomerMasterKeySpec::RSA_2048{} => {

                                        },
                                        CustomerMasterKeySpec::RSA_3072{} => {

                                        },
                                        CustomerMasterKeySpec::RSA_4096{} => {

                                        },
                                        CustomerMasterKeySpec::ECC_NIST_P256{} => {

                                        },
                                        CustomerMasterKeySpec::ECC_NIST_P384{} => {

                                        },
                                        CustomerMasterKeySpec::ECC_NIST_P521{} => {

                                        },
                                        CustomerMasterKeySpec::ECC_SECG_P256K1{} => {

                                        },
                                        CustomerMasterKeySpec::SYMMETRIC_DEFAULT{} => {

                                        },
                                        CustomerMasterKeySpec::HMAC_224{} => {

                                        },
                                        CustomerMasterKeySpec::HMAC_256{} => {

                                        },
                                        CustomerMasterKeySpec::HMAC_384{} => {

                                        },
                                        CustomerMasterKeySpec::HMAC_512{} => {

                                        },
                                        CustomerMasterKeySpec::SM2{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for CustomerMasterKeySpec {
                                fn default() -> CustomerMasterKeySpec {
                                    CustomerMasterKeySpec::RSA_2048 {}
                                }
                            }

                            impl AsRef<CustomerMasterKeySpec>
                                for CustomerMasterKeySpec {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(152,3)
                            pub type CustomKeyStoreIdType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(156,3)
                            pub type CustomKeyStoreNameType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(161,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CustomKeyStoresListEntry {
                                CustomKeyStoresListEntry {
                                    CustomKeyStoreId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CustomKeyStoreName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CloudHsmClusterId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    TrustAnchorCertificate: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ConnectionState: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ConnectionStateType>>>,
                                    ConnectionErrorCode: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ConnectionErrorCodeType>>>,
                                    CreationDate: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CustomKeyStoreType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomKeyStoreType>>>,
                                    XksProxyConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyConfigurationType>>>
                                }
                            }

                            impl CustomKeyStoresListEntry {
                                /// Returns a borrow of the field CustomKeyStoreId
                                pub fn CustomKeyStoreId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => CustomKeyStoreId,
                                    }
                                }
                                /// Returns a borrow of the field CustomKeyStoreName
                                pub fn CustomKeyStoreName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => CustomKeyStoreName,
                                    }
                                }
                                /// Returns a borrow of the field CloudHsmClusterId
                                pub fn CloudHsmClusterId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => CloudHsmClusterId,
                                    }
                                }
                                /// Returns a borrow of the field TrustAnchorCertificate
                                pub fn TrustAnchorCertificate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => TrustAnchorCertificate,
                                    }
                                }
                                /// Returns a borrow of the field ConnectionState
                                pub fn ConnectionState(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ConnectionStateType>>> {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => ConnectionState,
                                    }
                                }
                                /// Returns a borrow of the field ConnectionErrorCode
                                pub fn ConnectionErrorCode(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ConnectionErrorCodeType>>> {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => ConnectionErrorCode,
                                    }
                                }
                                /// Returns a borrow of the field CreationDate
                                pub fn CreationDate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => CreationDate,
                                    }
                                }
                                /// Returns a borrow of the field CustomKeyStoreType
                                pub fn CustomKeyStoreType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomKeyStoreType>>> {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => CustomKeyStoreType,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyConfiguration
                                pub fn XksProxyConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyConfigurationType>>> {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => XksProxyConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for CustomKeyStoresListEntry {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CustomKeyStoresListEntry {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomKeyStoresListEntry.CustomKeyStoresListEntry(")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CloudHsmClusterId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TrustAnchorCertificate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConnectionState, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ConnectionErrorCode, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CreationDate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for CustomKeyStoresListEntry {}

                            impl Hash
                                for CustomKeyStoresListEntry {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CustomKeyStoresListEntry::CustomKeyStoresListEntry{CustomKeyStoreId, CustomKeyStoreName, CloudHsmClusterId, TrustAnchorCertificate, ConnectionState, ConnectionErrorCode, CreationDate, CustomKeyStoreType, XksProxyConfiguration, } => {
                                            Hash::hash(CustomKeyStoreId, _state);
                                            Hash::hash(CustomKeyStoreName, _state);
                                            Hash::hash(CloudHsmClusterId, _state);
                                            Hash::hash(TrustAnchorCertificate, _state);
                                            Hash::hash(ConnectionState, _state);
                                            Hash::hash(ConnectionErrorCode, _state);
                                            Hash::hash(CreationDate, _state);
                                            Hash::hash(CustomKeyStoreType, _state);
                                            Hash::hash(XksProxyConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for CustomKeyStoresListEntry {
                                fn default() -> CustomKeyStoresListEntry {
                                    CustomKeyStoresListEntry::CustomKeyStoresListEntry {
                                        CustomKeyStoreId: Default::default(),
                                        CustomKeyStoreName: Default::default(),
                                        CloudHsmClusterId: Default::default(),
                                        TrustAnchorCertificate: Default::default(),
                                        ConnectionState: Default::default(),
                                        ConnectionErrorCode: Default::default(),
                                        CreationDate: Default::default(),
                                        CustomKeyStoreType: Default::default(),
                                        XksProxyConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<CustomKeyStoresListEntry>
                                for CustomKeyStoresListEntry {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(172,3)
                            #[derive(PartialEq, Clone)]
                            pub enum CustomKeyStoreType {
                                AWS_CLOUDHSM {},
                                EXTERNAL_KEY_STORE {}
                            }

                            impl CustomKeyStoreType {}

                            impl Debug
                                for CustomKeyStoreType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for CustomKeyStoreType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        CustomKeyStoreType::AWS_CLOUDHSM{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomKeyStoreType.AWS__CLOUDHSM")?;
                                            Ok(())
                                        },
                                        CustomKeyStoreType::EXTERNAL_KEY_STORE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.CustomKeyStoreType.EXTERNAL__KEY__STORE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl CustomKeyStoreType {
                                /// Enumerates all possible values of CustomKeyStoreType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<CustomKeyStoreType>> {
                                    seq![Arc::new(CustomKeyStoreType::AWS_CLOUDHSM {}), Arc::new(CustomKeyStoreType::EXTERNAL_KEY_STORE {})].iter()
                                }
                            }

                            impl Eq
                                for CustomKeyStoreType {}

                            impl Hash
                                for CustomKeyStoreType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        CustomKeyStoreType::AWS_CLOUDHSM{} => {

                                        },
                                        CustomKeyStoreType::EXTERNAL_KEY_STORE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for CustomKeyStoreType {
                                fn default() -> CustomKeyStoreType {
                                    CustomKeyStoreType::AWS_CLOUDHSM {}
                                }
                            }

                            impl AsRef<CustomKeyStoreType>
                                for CustomKeyStoreType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(175,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DataKeyPairSpec {
                                RSA_2048 {},
                                RSA_3072 {},
                                RSA_4096 {},
                                ECC_NIST_P256 {},
                                ECC_NIST_P384 {},
                                ECC_NIST_P521 {},
                                ECC_SECG_P256K1 {},
                                SM2 {}
                            }

                            impl DataKeyPairSpec {}

                            impl Debug
                                for DataKeyPairSpec {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DataKeyPairSpec {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DataKeyPairSpec::RSA_2048{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec.RSA__2048")?;
                                            Ok(())
                                        },
                                        DataKeyPairSpec::RSA_3072{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec.RSA__3072")?;
                                            Ok(())
                                        },
                                        DataKeyPairSpec::RSA_4096{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec.RSA__4096")?;
                                            Ok(())
                                        },
                                        DataKeyPairSpec::ECC_NIST_P256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec.ECC__NIST__P256")?;
                                            Ok(())
                                        },
                                        DataKeyPairSpec::ECC_NIST_P384{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec.ECC__NIST__P384")?;
                                            Ok(())
                                        },
                                        DataKeyPairSpec::ECC_NIST_P521{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec.ECC__NIST__P521")?;
                                            Ok(())
                                        },
                                        DataKeyPairSpec::ECC_SECG_P256K1{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec.ECC__SECG__P256K1")?;
                                            Ok(())
                                        },
                                        DataKeyPairSpec::SM2{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec.SM2")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl DataKeyPairSpec {
                                /// Enumerates all possible values of DataKeyPairSpec
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DataKeyPairSpec>> {
                                    seq![Arc::new(DataKeyPairSpec::RSA_2048 {}), Arc::new(DataKeyPairSpec::RSA_3072 {}), Arc::new(DataKeyPairSpec::RSA_4096 {}), Arc::new(DataKeyPairSpec::ECC_NIST_P256 {}), Arc::new(DataKeyPairSpec::ECC_NIST_P384 {}), Arc::new(DataKeyPairSpec::ECC_NIST_P521 {}), Arc::new(DataKeyPairSpec::ECC_SECG_P256K1 {}), Arc::new(DataKeyPairSpec::SM2 {})].iter()
                                }
                            }

                            impl Eq
                                for DataKeyPairSpec {}

                            impl Hash
                                for DataKeyPairSpec {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DataKeyPairSpec::RSA_2048{} => {

                                        },
                                        DataKeyPairSpec::RSA_3072{} => {

                                        },
                                        DataKeyPairSpec::RSA_4096{} => {

                                        },
                                        DataKeyPairSpec::ECC_NIST_P256{} => {

                                        },
                                        DataKeyPairSpec::ECC_NIST_P384{} => {

                                        },
                                        DataKeyPairSpec::ECC_NIST_P521{} => {

                                        },
                                        DataKeyPairSpec::ECC_SECG_P256K1{} => {

                                        },
                                        DataKeyPairSpec::SM2{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for DataKeyPairSpec {
                                fn default() -> DataKeyPairSpec {
                                    DataKeyPairSpec::RSA_2048 {}
                                }
                            }

                            impl AsRef<DataKeyPairSpec>
                                for DataKeyPairSpec {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(184,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DataKeySpec {
                                AES_256 {},
                                AES_128 {}
                            }

                            impl DataKeySpec {}

                            impl Debug
                                for DataKeySpec {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DataKeySpec {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DataKeySpec::AES_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DataKeySpec.AES__256")?;
                                            Ok(())
                                        },
                                        DataKeySpec::AES_128{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DataKeySpec.AES__128")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl DataKeySpec {
                                /// Enumerates all possible values of DataKeySpec
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DataKeySpec>> {
                                    seq![Arc::new(DataKeySpec::AES_256 {}), Arc::new(DataKeySpec::AES_128 {})].iter()
                                }
                            }

                            impl Eq
                                for DataKeySpec {}

                            impl Hash
                                for DataKeySpec {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DataKeySpec::AES_256{} => {

                                        },
                                        DataKeySpec::AES_128{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for DataKeySpec {
                                fn default() -> DataKeySpec {
                                    DataKeySpec::AES_256 {}
                                }
                            }

                            impl AsRef<DataKeySpec>
                                for DataKeySpec {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(187,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DecryptRequest {
                                DecryptRequest {
                                    CiphertextBlob: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType,
                                    EncryptionContext: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    EncryptionAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>,
                                    Recipient: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo>>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl DecryptRequest {
                                /// Returns a borrow of the field CiphertextBlob
                                pub fn CiphertextBlob(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType {
                                    match self {
                                        DecryptRequest::DecryptRequest{CiphertextBlob, EncryptionContext, GrantTokens, KeyId, EncryptionAlgorithm, Recipient, DryRun, } => CiphertextBlob,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionContext
                                pub fn EncryptionContext(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        DecryptRequest::DecryptRequest{CiphertextBlob, EncryptionContext, GrantTokens, KeyId, EncryptionAlgorithm, Recipient, DryRun, } => EncryptionContext,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        DecryptRequest::DecryptRequest{CiphertextBlob, EncryptionContext, GrantTokens, KeyId, EncryptionAlgorithm, Recipient, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DecryptRequest::DecryptRequest{CiphertextBlob, EncryptionContext, GrantTokens, KeyId, EncryptionAlgorithm, Recipient, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionAlgorithm
                                pub fn EncryptionAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>> {
                                    match self {
                                        DecryptRequest::DecryptRequest{CiphertextBlob, EncryptionContext, GrantTokens, KeyId, EncryptionAlgorithm, Recipient, DryRun, } => EncryptionAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field Recipient
                                pub fn Recipient(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo>>> {
                                    match self {
                                        DecryptRequest::DecryptRequest{CiphertextBlob, EncryptionContext, GrantTokens, KeyId, EncryptionAlgorithm, Recipient, DryRun, } => Recipient,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        DecryptRequest::DecryptRequest{CiphertextBlob, EncryptionContext, GrantTokens, KeyId, EncryptionAlgorithm, Recipient, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for DecryptRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DecryptRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DecryptRequest::DecryptRequest{CiphertextBlob, EncryptionContext, GrantTokens, KeyId, EncryptionAlgorithm, Recipient, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DecryptRequest.DecryptRequest(")?;
                                            DafnyPrint::fmt_print(CiphertextBlob, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionContext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Recipient, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DecryptRequest {}

                            impl Hash
                                for DecryptRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DecryptRequest::DecryptRequest{CiphertextBlob, EncryptionContext, GrantTokens, KeyId, EncryptionAlgorithm, Recipient, DryRun, } => {
                                            Hash::hash(CiphertextBlob, _state);
                                            Hash::hash(EncryptionContext, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(EncryptionAlgorithm, _state);
                                            Hash::hash(Recipient, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DecryptRequest {
                                fn default() -> DecryptRequest {
                                    DecryptRequest::DecryptRequest {
                                        CiphertextBlob: Default::default(),
                                        EncryptionContext: Default::default(),
                                        GrantTokens: Default::default(),
                                        KeyId: Default::default(),
                                        EncryptionAlgorithm: Default::default(),
                                        Recipient: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DecryptRequest>
                                for DecryptRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(196,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DecryptResponse {
                                DecryptResponse {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Plaintext: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>>,
                                    EncryptionAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>,
                                    CiphertextForRecipient: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>
                                }
                            }

                            impl DecryptResponse {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DecryptResponse::DecryptResponse{KeyId, Plaintext, EncryptionAlgorithm, CiphertextForRecipient, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Plaintext
                                pub fn Plaintext(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>> {
                                    match self {
                                        DecryptResponse::DecryptResponse{KeyId, Plaintext, EncryptionAlgorithm, CiphertextForRecipient, } => Plaintext,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionAlgorithm
                                pub fn EncryptionAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>> {
                                    match self {
                                        DecryptResponse::DecryptResponse{KeyId, Plaintext, EncryptionAlgorithm, CiphertextForRecipient, } => EncryptionAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field CiphertextForRecipient
                                pub fn CiphertextForRecipient(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        DecryptResponse::DecryptResponse{KeyId, Plaintext, EncryptionAlgorithm, CiphertextForRecipient, } => CiphertextForRecipient,
                                    }
                                }
                            }

                            impl Debug
                                for DecryptResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DecryptResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DecryptResponse::DecryptResponse{KeyId, Plaintext, EncryptionAlgorithm, CiphertextForRecipient, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DecryptResponse.DecryptResponse(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Plaintext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CiphertextForRecipient, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DecryptResponse {}

                            impl Hash
                                for DecryptResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DecryptResponse::DecryptResponse{KeyId, Plaintext, EncryptionAlgorithm, CiphertextForRecipient, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Plaintext, _state);
                                            Hash::hash(EncryptionAlgorithm, _state);
                                            Hash::hash(CiphertextForRecipient, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DecryptResponse {
                                fn default() -> DecryptResponse {
                                    DecryptResponse::DecryptResponse {
                                        KeyId: Default::default(),
                                        Plaintext: Default::default(),
                                        EncryptionAlgorithm: Default::default(),
                                        CiphertextForRecipient: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DecryptResponse>
                                for DecryptResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(202,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteAliasRequest {
                                DeleteAliasRequest {
                                    AliasName: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DeleteAliasRequest {
                                /// Returns a borrow of the field AliasName
                                pub fn AliasName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeleteAliasRequest::DeleteAliasRequest{AliasName, } => AliasName,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteAliasRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteAliasRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteAliasRequest::DeleteAliasRequest{AliasName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DeleteAliasRequest.DeleteAliasRequest(")?;
                                            DafnyPrint::fmt_print(AliasName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteAliasRequest {}

                            impl Hash
                                for DeleteAliasRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteAliasRequest::DeleteAliasRequest{AliasName, } => {
                                            Hash::hash(AliasName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteAliasRequest {
                                fn default() -> DeleteAliasRequest {
                                    DeleteAliasRequest::DeleteAliasRequest {
                                        AliasName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteAliasRequest>
                                for DeleteAliasRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(205,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteCustomKeyStoreRequest {
                                DeleteCustomKeyStoreRequest {
                                    CustomKeyStoreId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DeleteCustomKeyStoreRequest {
                                /// Returns a borrow of the field CustomKeyStoreId
                                pub fn CustomKeyStoreId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeleteCustomKeyStoreRequest::DeleteCustomKeyStoreRequest{CustomKeyStoreId, } => CustomKeyStoreId,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteCustomKeyStoreRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteCustomKeyStoreRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteCustomKeyStoreRequest::DeleteCustomKeyStoreRequest{CustomKeyStoreId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DeleteCustomKeyStoreRequest.DeleteCustomKeyStoreRequest(")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteCustomKeyStoreRequest {}

                            impl Hash
                                for DeleteCustomKeyStoreRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteCustomKeyStoreRequest::DeleteCustomKeyStoreRequest{CustomKeyStoreId, } => {
                                            Hash::hash(CustomKeyStoreId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteCustomKeyStoreRequest {
                                fn default() -> DeleteCustomKeyStoreRequest {
                                    DeleteCustomKeyStoreRequest::DeleteCustomKeyStoreRequest {
                                        CustomKeyStoreId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteCustomKeyStoreRequest>
                                for DeleteCustomKeyStoreRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(208,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteCustomKeyStoreResponse {
                                DeleteCustomKeyStoreResponse {}
                            }

                            impl DeleteCustomKeyStoreResponse {}

                            impl Debug
                                for DeleteCustomKeyStoreResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteCustomKeyStoreResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteCustomKeyStoreResponse::DeleteCustomKeyStoreResponse{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DeleteCustomKeyStoreResponse.DeleteCustomKeyStoreResponse")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl DeleteCustomKeyStoreResponse {
                                /// Enumerates all possible values of DeleteCustomKeyStoreResponse
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DeleteCustomKeyStoreResponse>> {
                                    seq![Arc::new(DeleteCustomKeyStoreResponse::DeleteCustomKeyStoreResponse {})].iter()
                                }
                            }

                            impl Eq
                                for DeleteCustomKeyStoreResponse {}

                            impl Hash
                                for DeleteCustomKeyStoreResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteCustomKeyStoreResponse::DeleteCustomKeyStoreResponse{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteCustomKeyStoreResponse {
                                fn default() -> DeleteCustomKeyStoreResponse {
                                    DeleteCustomKeyStoreResponse::DeleteCustomKeyStoreResponse {}
                                }
                            }

                            impl AsRef<DeleteCustomKeyStoreResponse>
                                for DeleteCustomKeyStoreResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(211,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeleteImportedKeyMaterialRequest {
                                DeleteImportedKeyMaterialRequest {
                                    KeyId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DeleteImportedKeyMaterialRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeleteImportedKeyMaterialRequest::DeleteImportedKeyMaterialRequest{KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for DeleteImportedKeyMaterialRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeleteImportedKeyMaterialRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeleteImportedKeyMaterialRequest::DeleteImportedKeyMaterialRequest{KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DeleteImportedKeyMaterialRequest.DeleteImportedKeyMaterialRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeleteImportedKeyMaterialRequest {}

                            impl Hash
                                for DeleteImportedKeyMaterialRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeleteImportedKeyMaterialRequest::DeleteImportedKeyMaterialRequest{KeyId, } => {
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeleteImportedKeyMaterialRequest {
                                fn default() -> DeleteImportedKeyMaterialRequest {
                                    DeleteImportedKeyMaterialRequest::DeleteImportedKeyMaterialRequest {
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeleteImportedKeyMaterialRequest>
                                for DeleteImportedKeyMaterialRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(214,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeriveSharedSecretRequest {
                                DeriveSharedSecretRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    KeyAgreementAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyAgreementAlgorithmSpec>,
                                    PublicKey: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    DryRun: Arc<Option<bool>>,
                                    Recipient: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo>>>
                                }
                            }

                            impl DeriveSharedSecretRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DeriveSharedSecretRequest::DeriveSharedSecretRequest{KeyId, KeyAgreementAlgorithm, PublicKey, GrantTokens, DryRun, Recipient, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field KeyAgreementAlgorithm
                                pub fn KeyAgreementAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyAgreementAlgorithmSpec> {
                                    match self {
                                        DeriveSharedSecretRequest::DeriveSharedSecretRequest{KeyId, KeyAgreementAlgorithm, PublicKey, GrantTokens, DryRun, Recipient, } => KeyAgreementAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field PublicKey
                                pub fn PublicKey(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType {
                                    match self {
                                        DeriveSharedSecretRequest::DeriveSharedSecretRequest{KeyId, KeyAgreementAlgorithm, PublicKey, GrantTokens, DryRun, Recipient, } => PublicKey,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        DeriveSharedSecretRequest::DeriveSharedSecretRequest{KeyId, KeyAgreementAlgorithm, PublicKey, GrantTokens, DryRun, Recipient, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        DeriveSharedSecretRequest::DeriveSharedSecretRequest{KeyId, KeyAgreementAlgorithm, PublicKey, GrantTokens, DryRun, Recipient, } => DryRun,
                                    }
                                }
                                /// Returns a borrow of the field Recipient
                                pub fn Recipient(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo>>> {
                                    match self {
                                        DeriveSharedSecretRequest::DeriveSharedSecretRequest{KeyId, KeyAgreementAlgorithm, PublicKey, GrantTokens, DryRun, Recipient, } => Recipient,
                                    }
                                }
                            }

                            impl Debug
                                for DeriveSharedSecretRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeriveSharedSecretRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeriveSharedSecretRequest::DeriveSharedSecretRequest{KeyId, KeyAgreementAlgorithm, PublicKey, GrantTokens, DryRun, Recipient, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DeriveSharedSecretRequest.DeriveSharedSecretRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyAgreementAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PublicKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Recipient, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeriveSharedSecretRequest {}

                            impl Hash
                                for DeriveSharedSecretRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeriveSharedSecretRequest::DeriveSharedSecretRequest{KeyId, KeyAgreementAlgorithm, PublicKey, GrantTokens, DryRun, Recipient, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(KeyAgreementAlgorithm, _state);
                                            Hash::hash(PublicKey, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(DryRun, _state);
                                            Hash::hash(Recipient, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeriveSharedSecretRequest {
                                fn default() -> DeriveSharedSecretRequest {
                                    DeriveSharedSecretRequest::DeriveSharedSecretRequest {
                                        KeyId: Default::default(),
                                        KeyAgreementAlgorithm: Default::default(),
                                        PublicKey: Default::default(),
                                        GrantTokens: Default::default(),
                                        DryRun: Default::default(),
                                        Recipient: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeriveSharedSecretRequest>
                                for DeriveSharedSecretRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(222,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DeriveSharedSecretResponse {
                                DeriveSharedSecretResponse {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    SharedSecret: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>>,
                                    CiphertextForRecipient: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>,
                                    KeyAgreementAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyAgreementAlgorithmSpec>>>,
                                    KeyOrigin: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::OriginType>>>
                                }
                            }

                            impl DeriveSharedSecretResponse {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DeriveSharedSecretResponse::DeriveSharedSecretResponse{KeyId, SharedSecret, CiphertextForRecipient, KeyAgreementAlgorithm, KeyOrigin, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field SharedSecret
                                pub fn SharedSecret(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>> {
                                    match self {
                                        DeriveSharedSecretResponse::DeriveSharedSecretResponse{KeyId, SharedSecret, CiphertextForRecipient, KeyAgreementAlgorithm, KeyOrigin, } => SharedSecret,
                                    }
                                }
                                /// Returns a borrow of the field CiphertextForRecipient
                                pub fn CiphertextForRecipient(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        DeriveSharedSecretResponse::DeriveSharedSecretResponse{KeyId, SharedSecret, CiphertextForRecipient, KeyAgreementAlgorithm, KeyOrigin, } => CiphertextForRecipient,
                                    }
                                }
                                /// Returns a borrow of the field KeyAgreementAlgorithm
                                pub fn KeyAgreementAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyAgreementAlgorithmSpec>>> {
                                    match self {
                                        DeriveSharedSecretResponse::DeriveSharedSecretResponse{KeyId, SharedSecret, CiphertextForRecipient, KeyAgreementAlgorithm, KeyOrigin, } => KeyAgreementAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field KeyOrigin
                                pub fn KeyOrigin(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::OriginType>>> {
                                    match self {
                                        DeriveSharedSecretResponse::DeriveSharedSecretResponse{KeyId, SharedSecret, CiphertextForRecipient, KeyAgreementAlgorithm, KeyOrigin, } => KeyOrigin,
                                    }
                                }
                            }

                            impl Debug
                                for DeriveSharedSecretResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DeriveSharedSecretResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DeriveSharedSecretResponse::DeriveSharedSecretResponse{KeyId, SharedSecret, CiphertextForRecipient, KeyAgreementAlgorithm, KeyOrigin, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DeriveSharedSecretResponse.DeriveSharedSecretResponse(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SharedSecret, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CiphertextForRecipient, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyAgreementAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyOrigin, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DeriveSharedSecretResponse {}

                            impl Hash
                                for DeriveSharedSecretResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DeriveSharedSecretResponse::DeriveSharedSecretResponse{KeyId, SharedSecret, CiphertextForRecipient, KeyAgreementAlgorithm, KeyOrigin, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(SharedSecret, _state);
                                            Hash::hash(CiphertextForRecipient, _state);
                                            Hash::hash(KeyAgreementAlgorithm, _state);
                                            Hash::hash(KeyOrigin, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DeriveSharedSecretResponse {
                                fn default() -> DeriveSharedSecretResponse {
                                    DeriveSharedSecretResponse::DeriveSharedSecretResponse {
                                        KeyId: Default::default(),
                                        SharedSecret: Default::default(),
                                        CiphertextForRecipient: Default::default(),
                                        KeyAgreementAlgorithm: Default::default(),
                                        KeyOrigin: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DeriveSharedSecretResponse>
                                for DeriveSharedSecretResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(229,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeCustomKeyStoresRequest {
                                DescribeCustomKeyStoresRequest {
                                    CustomKeyStoreId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CustomKeyStoreName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>>,
                                    Marker: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl DescribeCustomKeyStoresRequest {
                                /// Returns a borrow of the field CustomKeyStoreId
                                pub fn CustomKeyStoreId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DescribeCustomKeyStoresRequest::DescribeCustomKeyStoresRequest{CustomKeyStoreId, CustomKeyStoreName, Limit, Marker, } => CustomKeyStoreId,
                                    }
                                }
                                /// Returns a borrow of the field CustomKeyStoreName
                                pub fn CustomKeyStoreName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DescribeCustomKeyStoresRequest::DescribeCustomKeyStoresRequest{CustomKeyStoreId, CustomKeyStoreName, Limit, Marker, } => CustomKeyStoreName,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>> {
                                    match self {
                                        DescribeCustomKeyStoresRequest::DescribeCustomKeyStoresRequest{CustomKeyStoreId, CustomKeyStoreName, Limit, Marker, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field Marker
                                pub fn Marker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DescribeCustomKeyStoresRequest::DescribeCustomKeyStoresRequest{CustomKeyStoreId, CustomKeyStoreName, Limit, Marker, } => Marker,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeCustomKeyStoresRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeCustomKeyStoresRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeCustomKeyStoresRequest::DescribeCustomKeyStoresRequest{CustomKeyStoreId, CustomKeyStoreName, Limit, Marker, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DescribeCustomKeyStoresRequest.DescribeCustomKeyStoresRequest(")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Marker, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeCustomKeyStoresRequest {}

                            impl Hash
                                for DescribeCustomKeyStoresRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeCustomKeyStoresRequest::DescribeCustomKeyStoresRequest{CustomKeyStoreId, CustomKeyStoreName, Limit, Marker, } => {
                                            Hash::hash(CustomKeyStoreId, _state);
                                            Hash::hash(CustomKeyStoreName, _state);
                                            Hash::hash(Limit, _state);
                                            Hash::hash(Marker, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeCustomKeyStoresRequest {
                                fn default() -> DescribeCustomKeyStoresRequest {
                                    DescribeCustomKeyStoresRequest::DescribeCustomKeyStoresRequest {
                                        CustomKeyStoreId: Default::default(),
                                        CustomKeyStoreName: Default::default(),
                                        Limit: Default::default(),
                                        Marker: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeCustomKeyStoresRequest>
                                for DescribeCustomKeyStoresRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(235,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeCustomKeyStoresResponse {
                                DescribeCustomKeyStoresResponse {
                                    CustomKeyStores: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomKeyStoresListEntry>>>>,
                                    NextMarker: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Truncated: Arc<Option<bool>>
                                }
                            }

                            impl DescribeCustomKeyStoresResponse {
                                /// Returns a borrow of the field CustomKeyStores
                                pub fn CustomKeyStores(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomKeyStoresListEntry>>>> {
                                    match self {
                                        DescribeCustomKeyStoresResponse::DescribeCustomKeyStoresResponse{CustomKeyStores, NextMarker, Truncated, } => CustomKeyStores,
                                    }
                                }
                                /// Returns a borrow of the field NextMarker
                                pub fn NextMarker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        DescribeCustomKeyStoresResponse::DescribeCustomKeyStoresResponse{CustomKeyStores, NextMarker, Truncated, } => NextMarker,
                                    }
                                }
                                /// Returns a borrow of the field Truncated
                                pub fn Truncated(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        DescribeCustomKeyStoresResponse::DescribeCustomKeyStoresResponse{CustomKeyStores, NextMarker, Truncated, } => Truncated,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeCustomKeyStoresResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeCustomKeyStoresResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeCustomKeyStoresResponse::DescribeCustomKeyStoresResponse{CustomKeyStores, NextMarker, Truncated, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DescribeCustomKeyStoresResponse.DescribeCustomKeyStoresResponse(")?;
                                            DafnyPrint::fmt_print(CustomKeyStores, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextMarker, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Truncated, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeCustomKeyStoresResponse {}

                            impl Hash
                                for DescribeCustomKeyStoresResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeCustomKeyStoresResponse::DescribeCustomKeyStoresResponse{CustomKeyStores, NextMarker, Truncated, } => {
                                            Hash::hash(CustomKeyStores, _state);
                                            Hash::hash(NextMarker, _state);
                                            Hash::hash(Truncated, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeCustomKeyStoresResponse {
                                fn default() -> DescribeCustomKeyStoresResponse {
                                    DescribeCustomKeyStoresResponse::DescribeCustomKeyStoresResponse {
                                        CustomKeyStores: Default::default(),
                                        NextMarker: Default::default(),
                                        Truncated: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeCustomKeyStoresResponse>
                                for DescribeCustomKeyStoresResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(240,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeKeyRequest {
                                DescribeKeyRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>
                                }
                            }

                            impl DescribeKeyRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DescribeKeyRequest::DescribeKeyRequest{KeyId, GrantTokens, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        DescribeKeyRequest::DescribeKeyRequest{KeyId, GrantTokens, } => GrantTokens,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeKeyRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeKeyRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeKeyRequest::DescribeKeyRequest{KeyId, GrantTokens, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DescribeKeyRequest.DescribeKeyRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeKeyRequest {}

                            impl Hash
                                for DescribeKeyRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeKeyRequest::DescribeKeyRequest{KeyId, GrantTokens, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(GrantTokens, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeKeyRequest {
                                fn default() -> DescribeKeyRequest {
                                    DescribeKeyRequest::DescribeKeyRequest {
                                        KeyId: Default::default(),
                                        GrantTokens: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeKeyRequest>
                                for DescribeKeyRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(244,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DescribeKeyResponse {
                                DescribeKeyResponse {
                                    KeyMetadata: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyMetadata>>>
                                }
                            }

                            impl DescribeKeyResponse {
                                /// Returns a borrow of the field KeyMetadata
                                pub fn KeyMetadata(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyMetadata>>> {
                                    match self {
                                        DescribeKeyResponse::DescribeKeyResponse{KeyMetadata, } => KeyMetadata,
                                    }
                                }
                            }

                            impl Debug
                                for DescribeKeyResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DescribeKeyResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DescribeKeyResponse::DescribeKeyResponse{KeyMetadata, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DescribeKeyResponse.DescribeKeyResponse(")?;
                                            DafnyPrint::fmt_print(KeyMetadata, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DescribeKeyResponse {}

                            impl Hash
                                for DescribeKeyResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DescribeKeyResponse::DescribeKeyResponse{KeyMetadata, } => {
                                            Hash::hash(KeyMetadata, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DescribeKeyResponse {
                                fn default() -> DescribeKeyResponse {
                                    DescribeKeyResponse::DescribeKeyResponse {
                                        KeyMetadata: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DescribeKeyResponse>
                                for DescribeKeyResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(247,3)
                            pub type DescriptionType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(251,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DisableKeyRequest {
                                DisableKeyRequest {
                                    KeyId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DisableKeyRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DisableKeyRequest::DisableKeyRequest{KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for DisableKeyRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DisableKeyRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DisableKeyRequest::DisableKeyRequest{KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DisableKeyRequest.DisableKeyRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DisableKeyRequest {}

                            impl Hash
                                for DisableKeyRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DisableKeyRequest::DisableKeyRequest{KeyId, } => {
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DisableKeyRequest {
                                fn default() -> DisableKeyRequest {
                                    DisableKeyRequest::DisableKeyRequest {
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DisableKeyRequest>
                                for DisableKeyRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(254,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DisableKeyRotationRequest {
                                DisableKeyRotationRequest {
                                    KeyId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DisableKeyRotationRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DisableKeyRotationRequest::DisableKeyRotationRequest{KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for DisableKeyRotationRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DisableKeyRotationRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DisableKeyRotationRequest::DisableKeyRotationRequest{KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DisableKeyRotationRequest.DisableKeyRotationRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DisableKeyRotationRequest {}

                            impl Hash
                                for DisableKeyRotationRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DisableKeyRotationRequest::DisableKeyRotationRequest{KeyId, } => {
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DisableKeyRotationRequest {
                                fn default() -> DisableKeyRotationRequest {
                                    DisableKeyRotationRequest::DisableKeyRotationRequest {
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DisableKeyRotationRequest>
                                for DisableKeyRotationRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(257,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DisconnectCustomKeyStoreRequest {
                                DisconnectCustomKeyStoreRequest {
                                    CustomKeyStoreId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl DisconnectCustomKeyStoreRequest {
                                /// Returns a borrow of the field CustomKeyStoreId
                                pub fn CustomKeyStoreId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        DisconnectCustomKeyStoreRequest::DisconnectCustomKeyStoreRequest{CustomKeyStoreId, } => CustomKeyStoreId,
                                    }
                                }
                            }

                            impl Debug
                                for DisconnectCustomKeyStoreRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DisconnectCustomKeyStoreRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DisconnectCustomKeyStoreRequest::DisconnectCustomKeyStoreRequest{CustomKeyStoreId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DisconnectCustomKeyStoreRequest.DisconnectCustomKeyStoreRequest(")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for DisconnectCustomKeyStoreRequest {}

                            impl Hash
                                for DisconnectCustomKeyStoreRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DisconnectCustomKeyStoreRequest::DisconnectCustomKeyStoreRequest{CustomKeyStoreId, } => {
                                            Hash::hash(CustomKeyStoreId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for DisconnectCustomKeyStoreRequest {
                                fn default() -> DisconnectCustomKeyStoreRequest {
                                    DisconnectCustomKeyStoreRequest::DisconnectCustomKeyStoreRequest {
                                        CustomKeyStoreId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<DisconnectCustomKeyStoreRequest>
                                for DisconnectCustomKeyStoreRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(260,3)
                            #[derive(PartialEq, Clone)]
                            pub enum DisconnectCustomKeyStoreResponse {
                                DisconnectCustomKeyStoreResponse {}
                            }

                            impl DisconnectCustomKeyStoreResponse {}

                            impl Debug
                                for DisconnectCustomKeyStoreResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for DisconnectCustomKeyStoreResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        DisconnectCustomKeyStoreResponse::DisconnectCustomKeyStoreResponse{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.DisconnectCustomKeyStoreResponse.DisconnectCustomKeyStoreResponse")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl DisconnectCustomKeyStoreResponse {
                                /// Enumerates all possible values of DisconnectCustomKeyStoreResponse
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<DisconnectCustomKeyStoreResponse>> {
                                    seq![Arc::new(DisconnectCustomKeyStoreResponse::DisconnectCustomKeyStoreResponse {})].iter()
                                }
                            }

                            impl Eq
                                for DisconnectCustomKeyStoreResponse {}

                            impl Hash
                                for DisconnectCustomKeyStoreResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        DisconnectCustomKeyStoreResponse::DisconnectCustomKeyStoreResponse{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for DisconnectCustomKeyStoreResponse {
                                fn default() -> DisconnectCustomKeyStoreResponse {
                                    DisconnectCustomKeyStoreResponse::DisconnectCustomKeyStoreResponse {}
                                }
                            }

                            impl AsRef<DisconnectCustomKeyStoreResponse>
                                for DisconnectCustomKeyStoreResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(263,3)
                            #[derive(PartialEq, Clone)]
                            pub enum EnableKeyRequest {
                                EnableKeyRequest {
                                    KeyId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl EnableKeyRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        EnableKeyRequest::EnableKeyRequest{KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for EnableKeyRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for EnableKeyRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        EnableKeyRequest::EnableKeyRequest{KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.EnableKeyRequest.EnableKeyRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for EnableKeyRequest {}

                            impl Hash
                                for EnableKeyRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        EnableKeyRequest::EnableKeyRequest{KeyId, } => {
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for EnableKeyRequest {
                                fn default() -> EnableKeyRequest {
                                    EnableKeyRequest::EnableKeyRequest {
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<EnableKeyRequest>
                                for EnableKeyRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(266,3)
                            #[derive(PartialEq, Clone)]
                            pub enum EnableKeyRotationRequest {
                                EnableKeyRotationRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    RotationPeriodInDays: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RotationPeriodInDaysType>>
                                }
                            }

                            impl EnableKeyRotationRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        EnableKeyRotationRequest::EnableKeyRotationRequest{KeyId, RotationPeriodInDays, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field RotationPeriodInDays
                                pub fn RotationPeriodInDays(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RotationPeriodInDaysType>> {
                                    match self {
                                        EnableKeyRotationRequest::EnableKeyRotationRequest{KeyId, RotationPeriodInDays, } => RotationPeriodInDays,
                                    }
                                }
                            }

                            impl Debug
                                for EnableKeyRotationRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for EnableKeyRotationRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        EnableKeyRotationRequest::EnableKeyRotationRequest{KeyId, RotationPeriodInDays, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.EnableKeyRotationRequest.EnableKeyRotationRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RotationPeriodInDays, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for EnableKeyRotationRequest {}

                            impl Hash
                                for EnableKeyRotationRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        EnableKeyRotationRequest::EnableKeyRotationRequest{KeyId, RotationPeriodInDays, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(RotationPeriodInDays, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for EnableKeyRotationRequest {
                                fn default() -> EnableKeyRotationRequest {
                                    EnableKeyRotationRequest::EnableKeyRotationRequest {
                                        KeyId: Default::default(),
                                        RotationPeriodInDays: Default::default()
                                    }
                                }
                            }

                            impl AsRef<EnableKeyRotationRequest>
                                for EnableKeyRotationRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(270,3)
                            #[derive(PartialEq, Clone)]
                            pub enum EncryptionAlgorithmSpec {
                                SYMMETRIC_DEFAULT {},
                                RSAES_OAEP_SHA_1 {},
                                RSAES_OAEP_SHA_256 {}
                            }

                            impl EncryptionAlgorithmSpec {}

                            impl Debug
                                for EncryptionAlgorithmSpec {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for EncryptionAlgorithmSpec {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        EncryptionAlgorithmSpec::SYMMETRIC_DEFAULT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.EncryptionAlgorithmSpec.SYMMETRIC__DEFAULT")?;
                                            Ok(())
                                        },
                                        EncryptionAlgorithmSpec::RSAES_OAEP_SHA_1{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.EncryptionAlgorithmSpec.RSAES__OAEP__SHA__1")?;
                                            Ok(())
                                        },
                                        EncryptionAlgorithmSpec::RSAES_OAEP_SHA_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.EncryptionAlgorithmSpec.RSAES__OAEP__SHA__256")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl EncryptionAlgorithmSpec {
                                /// Enumerates all possible values of EncryptionAlgorithmSpec
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<EncryptionAlgorithmSpec>> {
                                    seq![Arc::new(EncryptionAlgorithmSpec::SYMMETRIC_DEFAULT {}), Arc::new(EncryptionAlgorithmSpec::RSAES_OAEP_SHA_1 {}), Arc::new(EncryptionAlgorithmSpec::RSAES_OAEP_SHA_256 {})].iter()
                                }
                            }

                            impl Eq
                                for EncryptionAlgorithmSpec {}

                            impl Hash
                                for EncryptionAlgorithmSpec {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        EncryptionAlgorithmSpec::SYMMETRIC_DEFAULT{} => {

                                        },
                                        EncryptionAlgorithmSpec::RSAES_OAEP_SHA_1{} => {

                                        },
                                        EncryptionAlgorithmSpec::RSAES_OAEP_SHA_256{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for EncryptionAlgorithmSpec {
                                fn default() -> EncryptionAlgorithmSpec {
                                    EncryptionAlgorithmSpec::SYMMETRIC_DEFAULT {}
                                }
                            }

                            impl AsRef<EncryptionAlgorithmSpec>
                                for EncryptionAlgorithmSpec {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(278,3)
                            #[derive(PartialEq, Clone)]
                            pub enum EncryptRequest {
                                EncryptRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    Plaintext: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType,
                                    EncryptionContext: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    EncryptionAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl EncryptRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        EncryptRequest::EncryptRequest{KeyId, Plaintext, EncryptionContext, GrantTokens, EncryptionAlgorithm, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Plaintext
                                pub fn Plaintext(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType {
                                    match self {
                                        EncryptRequest::EncryptRequest{KeyId, Plaintext, EncryptionContext, GrantTokens, EncryptionAlgorithm, DryRun, } => Plaintext,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionContext
                                pub fn EncryptionContext(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        EncryptRequest::EncryptRequest{KeyId, Plaintext, EncryptionContext, GrantTokens, EncryptionAlgorithm, DryRun, } => EncryptionContext,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        EncryptRequest::EncryptRequest{KeyId, Plaintext, EncryptionContext, GrantTokens, EncryptionAlgorithm, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionAlgorithm
                                pub fn EncryptionAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>> {
                                    match self {
                                        EncryptRequest::EncryptRequest{KeyId, Plaintext, EncryptionContext, GrantTokens, EncryptionAlgorithm, DryRun, } => EncryptionAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        EncryptRequest::EncryptRequest{KeyId, Plaintext, EncryptionContext, GrantTokens, EncryptionAlgorithm, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for EncryptRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for EncryptRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        EncryptRequest::EncryptRequest{KeyId, Plaintext, EncryptionContext, GrantTokens, EncryptionAlgorithm, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.EncryptRequest.EncryptRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Plaintext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionContext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for EncryptRequest {}

                            impl Hash
                                for EncryptRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        EncryptRequest::EncryptRequest{KeyId, Plaintext, EncryptionContext, GrantTokens, EncryptionAlgorithm, DryRun, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Plaintext, _state);
                                            Hash::hash(EncryptionContext, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(EncryptionAlgorithm, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for EncryptRequest {
                                fn default() -> EncryptRequest {
                                    EncryptRequest::EncryptRequest {
                                        KeyId: Default::default(),
                                        Plaintext: Default::default(),
                                        EncryptionContext: Default::default(),
                                        GrantTokens: Default::default(),
                                        EncryptionAlgorithm: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<EncryptRequest>
                                for EncryptRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(286,3)
                            #[derive(PartialEq, Clone)]
                            pub enum EncryptResponse {
                                EncryptResponse {
                                    CiphertextBlob: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>,
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    EncryptionAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>
                                }
                            }

                            impl EncryptResponse {
                                /// Returns a borrow of the field CiphertextBlob
                                pub fn CiphertextBlob(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        EncryptResponse::EncryptResponse{CiphertextBlob, KeyId, EncryptionAlgorithm, } => CiphertextBlob,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        EncryptResponse::EncryptResponse{CiphertextBlob, KeyId, EncryptionAlgorithm, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionAlgorithm
                                pub fn EncryptionAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>> {
                                    match self {
                                        EncryptResponse::EncryptResponse{CiphertextBlob, KeyId, EncryptionAlgorithm, } => EncryptionAlgorithm,
                                    }
                                }
                            }

                            impl Debug
                                for EncryptResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for EncryptResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        EncryptResponse::EncryptResponse{CiphertextBlob, KeyId, EncryptionAlgorithm, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.EncryptResponse.EncryptResponse(")?;
                                            DafnyPrint::fmt_print(CiphertextBlob, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionAlgorithm, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for EncryptResponse {}

                            impl Hash
                                for EncryptResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        EncryptResponse::EncryptResponse{CiphertextBlob, KeyId, EncryptionAlgorithm, } => {
                                            Hash::hash(CiphertextBlob, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(EncryptionAlgorithm, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for EncryptResponse {
                                fn default() -> EncryptResponse {
                                    EncryptResponse::EncryptResponse {
                                        CiphertextBlob: Default::default(),
                                        KeyId: Default::default(),
                                        EncryptionAlgorithm: Default::default()
                                    }
                                }
                            }

                            impl AsRef<EncryptResponse>
                                for EncryptResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(292,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ExpirationModelType {
                                KEY_MATERIAL_EXPIRES {},
                                KEY_MATERIAL_DOES_NOT_EXPIRE {}
                            }

                            impl ExpirationModelType {}

                            impl Debug
                                for ExpirationModelType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ExpirationModelType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ExpirationModelType::KEY_MATERIAL_EXPIRES{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ExpirationModelType.KEY__MATERIAL__EXPIRES")?;
                                            Ok(())
                                        },
                                        ExpirationModelType::KEY_MATERIAL_DOES_NOT_EXPIRE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ExpirationModelType.KEY__MATERIAL__DOES__NOT__EXPIRE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ExpirationModelType {
                                /// Enumerates all possible values of ExpirationModelType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ExpirationModelType>> {
                                    seq![Arc::new(ExpirationModelType::KEY_MATERIAL_EXPIRES {}), Arc::new(ExpirationModelType::KEY_MATERIAL_DOES_NOT_EXPIRE {})].iter()
                                }
                            }

                            impl Eq
                                for ExpirationModelType {}

                            impl Hash
                                for ExpirationModelType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ExpirationModelType::KEY_MATERIAL_EXPIRES{} => {

                                        },
                                        ExpirationModelType::KEY_MATERIAL_DOES_NOT_EXPIRE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ExpirationModelType {
                                fn default() -> ExpirationModelType {
                                    ExpirationModelType::KEY_MATERIAL_EXPIRES {}
                                }
                            }

                            impl AsRef<ExpirationModelType>
                                for ExpirationModelType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(295,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateDataKeyPairRequest {
                                GenerateDataKeyPairRequest {
                                    EncryptionContext: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    KeyPairSpec: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeyPairSpec>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    Recipient: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo>>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl GenerateDataKeyPairRequest {
                                /// Returns a borrow of the field EncryptionContext
                                pub fn EncryptionContext(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        GenerateDataKeyPairRequest::GenerateDataKeyPairRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, Recipient, DryRun, } => EncryptionContext,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GenerateDataKeyPairRequest::GenerateDataKeyPairRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, Recipient, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field KeyPairSpec
                                pub fn KeyPairSpec(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeyPairSpec> {
                                    match self {
                                        GenerateDataKeyPairRequest::GenerateDataKeyPairRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, Recipient, DryRun, } => KeyPairSpec,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        GenerateDataKeyPairRequest::GenerateDataKeyPairRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, Recipient, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field Recipient
                                pub fn Recipient(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo>>> {
                                    match self {
                                        GenerateDataKeyPairRequest::GenerateDataKeyPairRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, Recipient, DryRun, } => Recipient,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        GenerateDataKeyPairRequest::GenerateDataKeyPairRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, Recipient, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateDataKeyPairRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateDataKeyPairRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateDataKeyPairRequest::GenerateDataKeyPairRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, Recipient, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairRequest.GenerateDataKeyPairRequest(")?;
                                            DafnyPrint::fmt_print(EncryptionContext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyPairSpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Recipient, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateDataKeyPairRequest {}

                            impl Hash
                                for GenerateDataKeyPairRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateDataKeyPairRequest::GenerateDataKeyPairRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, Recipient, DryRun, } => {
                                            Hash::hash(EncryptionContext, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(KeyPairSpec, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(Recipient, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateDataKeyPairRequest {
                                fn default() -> GenerateDataKeyPairRequest {
                                    GenerateDataKeyPairRequest::GenerateDataKeyPairRequest {
                                        EncryptionContext: Default::default(),
                                        KeyId: Default::default(),
                                        KeyPairSpec: Default::default(),
                                        GrantTokens: Default::default(),
                                        Recipient: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateDataKeyPairRequest>
                                for GenerateDataKeyPairRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(303,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateDataKeyPairResponse {
                                GenerateDataKeyPairResponse {
                                    PrivateKeyCiphertextBlob: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>,
                                    PrivateKeyPlaintext: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>>,
                                    PublicKey: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType>>,
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyPairSpec: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeyPairSpec>>>,
                                    CiphertextForRecipient: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>
                                }
                            }

                            impl GenerateDataKeyPairResponse {
                                /// Returns a borrow of the field PrivateKeyCiphertextBlob
                                pub fn PrivateKeyCiphertextBlob(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        GenerateDataKeyPairResponse::GenerateDataKeyPairResponse{PrivateKeyCiphertextBlob, PrivateKeyPlaintext, PublicKey, KeyId, KeyPairSpec, CiphertextForRecipient, } => PrivateKeyCiphertextBlob,
                                    }
                                }
                                /// Returns a borrow of the field PrivateKeyPlaintext
                                pub fn PrivateKeyPlaintext(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>> {
                                    match self {
                                        GenerateDataKeyPairResponse::GenerateDataKeyPairResponse{PrivateKeyCiphertextBlob, PrivateKeyPlaintext, PublicKey, KeyId, KeyPairSpec, CiphertextForRecipient, } => PrivateKeyPlaintext,
                                    }
                                }
                                /// Returns a borrow of the field PublicKey
                                pub fn PublicKey(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType>> {
                                    match self {
                                        GenerateDataKeyPairResponse::GenerateDataKeyPairResponse{PrivateKeyCiphertextBlob, PrivateKeyPlaintext, PublicKey, KeyId, KeyPairSpec, CiphertextForRecipient, } => PublicKey,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GenerateDataKeyPairResponse::GenerateDataKeyPairResponse{PrivateKeyCiphertextBlob, PrivateKeyPlaintext, PublicKey, KeyId, KeyPairSpec, CiphertextForRecipient, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field KeyPairSpec
                                pub fn KeyPairSpec(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeyPairSpec>>> {
                                    match self {
                                        GenerateDataKeyPairResponse::GenerateDataKeyPairResponse{PrivateKeyCiphertextBlob, PrivateKeyPlaintext, PublicKey, KeyId, KeyPairSpec, CiphertextForRecipient, } => KeyPairSpec,
                                    }
                                }
                                /// Returns a borrow of the field CiphertextForRecipient
                                pub fn CiphertextForRecipient(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        GenerateDataKeyPairResponse::GenerateDataKeyPairResponse{PrivateKeyCiphertextBlob, PrivateKeyPlaintext, PublicKey, KeyId, KeyPairSpec, CiphertextForRecipient, } => CiphertextForRecipient,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateDataKeyPairResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateDataKeyPairResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateDataKeyPairResponse::GenerateDataKeyPairResponse{PrivateKeyCiphertextBlob, PrivateKeyPlaintext, PublicKey, KeyId, KeyPairSpec, CiphertextForRecipient, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairResponse.GenerateDataKeyPairResponse(")?;
                                            DafnyPrint::fmt_print(PrivateKeyCiphertextBlob, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PrivateKeyPlaintext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PublicKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyPairSpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CiphertextForRecipient, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateDataKeyPairResponse {}

                            impl Hash
                                for GenerateDataKeyPairResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateDataKeyPairResponse::GenerateDataKeyPairResponse{PrivateKeyCiphertextBlob, PrivateKeyPlaintext, PublicKey, KeyId, KeyPairSpec, CiphertextForRecipient, } => {
                                            Hash::hash(PrivateKeyCiphertextBlob, _state);
                                            Hash::hash(PrivateKeyPlaintext, _state);
                                            Hash::hash(PublicKey, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(KeyPairSpec, _state);
                                            Hash::hash(CiphertextForRecipient, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateDataKeyPairResponse {
                                fn default() -> GenerateDataKeyPairResponse {
                                    GenerateDataKeyPairResponse::GenerateDataKeyPairResponse {
                                        PrivateKeyCiphertextBlob: Default::default(),
                                        PrivateKeyPlaintext: Default::default(),
                                        PublicKey: Default::default(),
                                        KeyId: Default::default(),
                                        KeyPairSpec: Default::default(),
                                        CiphertextForRecipient: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateDataKeyPairResponse>
                                for GenerateDataKeyPairResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(311,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateDataKeyPairWithoutPlaintextRequest {
                                GenerateDataKeyPairWithoutPlaintextRequest {
                                    EncryptionContext: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    KeyPairSpec: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeyPairSpec>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl GenerateDataKeyPairWithoutPlaintextRequest {
                                /// Returns a borrow of the field EncryptionContext
                                pub fn EncryptionContext(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextRequest::GenerateDataKeyPairWithoutPlaintextRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, DryRun, } => EncryptionContext,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextRequest::GenerateDataKeyPairWithoutPlaintextRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field KeyPairSpec
                                pub fn KeyPairSpec(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeyPairSpec> {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextRequest::GenerateDataKeyPairWithoutPlaintextRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, DryRun, } => KeyPairSpec,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextRequest::GenerateDataKeyPairWithoutPlaintextRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextRequest::GenerateDataKeyPairWithoutPlaintextRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateDataKeyPairWithoutPlaintextRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateDataKeyPairWithoutPlaintextRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextRequest::GenerateDataKeyPairWithoutPlaintextRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairWithoutPlaintextRequest.GenerateDataKeyPairWithoutPlaintextRequest(")?;
                                            DafnyPrint::fmt_print(EncryptionContext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyPairSpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateDataKeyPairWithoutPlaintextRequest {}

                            impl Hash
                                for GenerateDataKeyPairWithoutPlaintextRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextRequest::GenerateDataKeyPairWithoutPlaintextRequest{EncryptionContext, KeyId, KeyPairSpec, GrantTokens, DryRun, } => {
                                            Hash::hash(EncryptionContext, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(KeyPairSpec, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateDataKeyPairWithoutPlaintextRequest {
                                fn default() -> GenerateDataKeyPairWithoutPlaintextRequest {
                                    GenerateDataKeyPairWithoutPlaintextRequest::GenerateDataKeyPairWithoutPlaintextRequest {
                                        EncryptionContext: Default::default(),
                                        KeyId: Default::default(),
                                        KeyPairSpec: Default::default(),
                                        GrantTokens: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateDataKeyPairWithoutPlaintextRequest>
                                for GenerateDataKeyPairWithoutPlaintextRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(318,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateDataKeyPairWithoutPlaintextResponse {
                                GenerateDataKeyPairWithoutPlaintextResponse {
                                    PrivateKeyCiphertextBlob: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>,
                                    PublicKey: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType>>,
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyPairSpec: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeyPairSpec>>>
                                }
                            }

                            impl GenerateDataKeyPairWithoutPlaintextResponse {
                                /// Returns a borrow of the field PrivateKeyCiphertextBlob
                                pub fn PrivateKeyCiphertextBlob(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextResponse::GenerateDataKeyPairWithoutPlaintextResponse{PrivateKeyCiphertextBlob, PublicKey, KeyId, KeyPairSpec, } => PrivateKeyCiphertextBlob,
                                    }
                                }
                                /// Returns a borrow of the field PublicKey
                                pub fn PublicKey(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType>> {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextResponse::GenerateDataKeyPairWithoutPlaintextResponse{PrivateKeyCiphertextBlob, PublicKey, KeyId, KeyPairSpec, } => PublicKey,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextResponse::GenerateDataKeyPairWithoutPlaintextResponse{PrivateKeyCiphertextBlob, PublicKey, KeyId, KeyPairSpec, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field KeyPairSpec
                                pub fn KeyPairSpec(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeyPairSpec>>> {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextResponse::GenerateDataKeyPairWithoutPlaintextResponse{PrivateKeyCiphertextBlob, PublicKey, KeyId, KeyPairSpec, } => KeyPairSpec,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateDataKeyPairWithoutPlaintextResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateDataKeyPairWithoutPlaintextResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextResponse::GenerateDataKeyPairWithoutPlaintextResponse{PrivateKeyCiphertextBlob, PublicKey, KeyId, KeyPairSpec, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairWithoutPlaintextResponse.GenerateDataKeyPairWithoutPlaintextResponse(")?;
                                            DafnyPrint::fmt_print(PrivateKeyCiphertextBlob, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PublicKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyPairSpec, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateDataKeyPairWithoutPlaintextResponse {}

                            impl Hash
                                for GenerateDataKeyPairWithoutPlaintextResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateDataKeyPairWithoutPlaintextResponse::GenerateDataKeyPairWithoutPlaintextResponse{PrivateKeyCiphertextBlob, PublicKey, KeyId, KeyPairSpec, } => {
                                            Hash::hash(PrivateKeyCiphertextBlob, _state);
                                            Hash::hash(PublicKey, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(KeyPairSpec, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateDataKeyPairWithoutPlaintextResponse {
                                fn default() -> GenerateDataKeyPairWithoutPlaintextResponse {
                                    GenerateDataKeyPairWithoutPlaintextResponse::GenerateDataKeyPairWithoutPlaintextResponse {
                                        PrivateKeyCiphertextBlob: Default::default(),
                                        PublicKey: Default::default(),
                                        KeyId: Default::default(),
                                        KeyPairSpec: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateDataKeyPairWithoutPlaintextResponse>
                                for GenerateDataKeyPairWithoutPlaintextResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(324,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateDataKeyRequest {
                                GenerateDataKeyRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    EncryptionContext: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    NumberOfBytes: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::NumberOfBytesType>>,
                                    KeySpec: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeySpec>>>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    Recipient: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo>>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl GenerateDataKeyRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GenerateDataKeyRequest::GenerateDataKeyRequest{KeyId, EncryptionContext, NumberOfBytes, KeySpec, GrantTokens, Recipient, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionContext
                                pub fn EncryptionContext(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        GenerateDataKeyRequest::GenerateDataKeyRequest{KeyId, EncryptionContext, NumberOfBytes, KeySpec, GrantTokens, Recipient, DryRun, } => EncryptionContext,
                                    }
                                }
                                /// Returns a borrow of the field NumberOfBytes
                                pub fn NumberOfBytes(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::NumberOfBytesType>> {
                                    match self {
                                        GenerateDataKeyRequest::GenerateDataKeyRequest{KeyId, EncryptionContext, NumberOfBytes, KeySpec, GrantTokens, Recipient, DryRun, } => NumberOfBytes,
                                    }
                                }
                                /// Returns a borrow of the field KeySpec
                                pub fn KeySpec(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeySpec>>> {
                                    match self {
                                        GenerateDataKeyRequest::GenerateDataKeyRequest{KeyId, EncryptionContext, NumberOfBytes, KeySpec, GrantTokens, Recipient, DryRun, } => KeySpec,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        GenerateDataKeyRequest::GenerateDataKeyRequest{KeyId, EncryptionContext, NumberOfBytes, KeySpec, GrantTokens, Recipient, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field Recipient
                                pub fn Recipient(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo>>> {
                                    match self {
                                        GenerateDataKeyRequest::GenerateDataKeyRequest{KeyId, EncryptionContext, NumberOfBytes, KeySpec, GrantTokens, Recipient, DryRun, } => Recipient,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        GenerateDataKeyRequest::GenerateDataKeyRequest{KeyId, EncryptionContext, NumberOfBytes, KeySpec, GrantTokens, Recipient, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateDataKeyRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateDataKeyRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateDataKeyRequest::GenerateDataKeyRequest{KeyId, EncryptionContext, NumberOfBytes, KeySpec, GrantTokens, Recipient, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyRequest.GenerateDataKeyRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionContext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NumberOfBytes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Recipient, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateDataKeyRequest {}

                            impl Hash
                                for GenerateDataKeyRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateDataKeyRequest::GenerateDataKeyRequest{KeyId, EncryptionContext, NumberOfBytes, KeySpec, GrantTokens, Recipient, DryRun, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(EncryptionContext, _state);
                                            Hash::hash(NumberOfBytes, _state);
                                            Hash::hash(KeySpec, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(Recipient, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateDataKeyRequest {
                                fn default() -> GenerateDataKeyRequest {
                                    GenerateDataKeyRequest::GenerateDataKeyRequest {
                                        KeyId: Default::default(),
                                        EncryptionContext: Default::default(),
                                        NumberOfBytes: Default::default(),
                                        KeySpec: Default::default(),
                                        GrantTokens: Default::default(),
                                        Recipient: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateDataKeyRequest>
                                for GenerateDataKeyRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(333,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateDataKeyResponse {
                                GenerateDataKeyResponse {
                                    CiphertextBlob: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>,
                                    Plaintext: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>>,
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CiphertextForRecipient: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>
                                }
                            }

                            impl GenerateDataKeyResponse {
                                /// Returns a borrow of the field CiphertextBlob
                                pub fn CiphertextBlob(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        GenerateDataKeyResponse::GenerateDataKeyResponse{CiphertextBlob, Plaintext, KeyId, CiphertextForRecipient, } => CiphertextBlob,
                                    }
                                }
                                /// Returns a borrow of the field Plaintext
                                pub fn Plaintext(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>> {
                                    match self {
                                        GenerateDataKeyResponse::GenerateDataKeyResponse{CiphertextBlob, Plaintext, KeyId, CiphertextForRecipient, } => Plaintext,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GenerateDataKeyResponse::GenerateDataKeyResponse{CiphertextBlob, Plaintext, KeyId, CiphertextForRecipient, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field CiphertextForRecipient
                                pub fn CiphertextForRecipient(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        GenerateDataKeyResponse::GenerateDataKeyResponse{CiphertextBlob, Plaintext, KeyId, CiphertextForRecipient, } => CiphertextForRecipient,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateDataKeyResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateDataKeyResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateDataKeyResponse::GenerateDataKeyResponse{CiphertextBlob, Plaintext, KeyId, CiphertextForRecipient, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyResponse.GenerateDataKeyResponse(")?;
                                            DafnyPrint::fmt_print(CiphertextBlob, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Plaintext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CiphertextForRecipient, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateDataKeyResponse {}

                            impl Hash
                                for GenerateDataKeyResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateDataKeyResponse::GenerateDataKeyResponse{CiphertextBlob, Plaintext, KeyId, CiphertextForRecipient, } => {
                                            Hash::hash(CiphertextBlob, _state);
                                            Hash::hash(Plaintext, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(CiphertextForRecipient, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateDataKeyResponse {
                                fn default() -> GenerateDataKeyResponse {
                                    GenerateDataKeyResponse::GenerateDataKeyResponse {
                                        CiphertextBlob: Default::default(),
                                        Plaintext: Default::default(),
                                        KeyId: Default::default(),
                                        CiphertextForRecipient: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateDataKeyResponse>
                                for GenerateDataKeyResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(339,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateDataKeyWithoutPlaintextRequest {
                                GenerateDataKeyWithoutPlaintextRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    EncryptionContext: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    KeySpec: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeySpec>>>,
                                    NumberOfBytes: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::NumberOfBytesType>>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl GenerateDataKeyWithoutPlaintextRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest{KeyId, EncryptionContext, KeySpec, NumberOfBytes, GrantTokens, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionContext
                                pub fn EncryptionContext(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest{KeyId, EncryptionContext, KeySpec, NumberOfBytes, GrantTokens, DryRun, } => EncryptionContext,
                                    }
                                }
                                /// Returns a borrow of the field KeySpec
                                pub fn KeySpec(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeySpec>>> {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest{KeyId, EncryptionContext, KeySpec, NumberOfBytes, GrantTokens, DryRun, } => KeySpec,
                                    }
                                }
                                /// Returns a borrow of the field NumberOfBytes
                                pub fn NumberOfBytes(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::NumberOfBytesType>> {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest{KeyId, EncryptionContext, KeySpec, NumberOfBytes, GrantTokens, DryRun, } => NumberOfBytes,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest{KeyId, EncryptionContext, KeySpec, NumberOfBytes, GrantTokens, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest{KeyId, EncryptionContext, KeySpec, NumberOfBytes, GrantTokens, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateDataKeyWithoutPlaintextRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateDataKeyWithoutPlaintextRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest{KeyId, EncryptionContext, KeySpec, NumberOfBytes, GrantTokens, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyWithoutPlaintextRequest.GenerateDataKeyWithoutPlaintextRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionContext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NumberOfBytes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateDataKeyWithoutPlaintextRequest {}

                            impl Hash
                                for GenerateDataKeyWithoutPlaintextRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest{KeyId, EncryptionContext, KeySpec, NumberOfBytes, GrantTokens, DryRun, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(EncryptionContext, _state);
                                            Hash::hash(KeySpec, _state);
                                            Hash::hash(NumberOfBytes, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateDataKeyWithoutPlaintextRequest {
                                fn default() -> GenerateDataKeyWithoutPlaintextRequest {
                                    GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest {
                                        KeyId: Default::default(),
                                        EncryptionContext: Default::default(),
                                        KeySpec: Default::default(),
                                        NumberOfBytes: Default::default(),
                                        GrantTokens: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateDataKeyWithoutPlaintextRequest>
                                for GenerateDataKeyWithoutPlaintextRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(347,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateDataKeyWithoutPlaintextResponse {
                                GenerateDataKeyWithoutPlaintextResponse {
                                    CiphertextBlob: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>,
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl GenerateDataKeyWithoutPlaintextResponse {
                                /// Returns a borrow of the field CiphertextBlob
                                pub fn CiphertextBlob(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextResponse::GenerateDataKeyWithoutPlaintextResponse{CiphertextBlob, KeyId, } => CiphertextBlob,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextResponse::GenerateDataKeyWithoutPlaintextResponse{CiphertextBlob, KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateDataKeyWithoutPlaintextResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateDataKeyWithoutPlaintextResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextResponse::GenerateDataKeyWithoutPlaintextResponse{CiphertextBlob, KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyWithoutPlaintextResponse.GenerateDataKeyWithoutPlaintextResponse(")?;
                                            DafnyPrint::fmt_print(CiphertextBlob, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateDataKeyWithoutPlaintextResponse {}

                            impl Hash
                                for GenerateDataKeyWithoutPlaintextResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateDataKeyWithoutPlaintextResponse::GenerateDataKeyWithoutPlaintextResponse{CiphertextBlob, KeyId, } => {
                                            Hash::hash(CiphertextBlob, _state);
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateDataKeyWithoutPlaintextResponse {
                                fn default() -> GenerateDataKeyWithoutPlaintextResponse {
                                    GenerateDataKeyWithoutPlaintextResponse::GenerateDataKeyWithoutPlaintextResponse {
                                        CiphertextBlob: Default::default(),
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateDataKeyWithoutPlaintextResponse>
                                for GenerateDataKeyWithoutPlaintextResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(351,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateMacRequest {
                                GenerateMacRequest {
                                    Message: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType,
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    MacAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MacAlgorithmSpec>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl GenerateMacRequest {
                                /// Returns a borrow of the field Message
                                pub fn Message(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType {
                                    match self {
                                        GenerateMacRequest::GenerateMacRequest{Message, KeyId, MacAlgorithm, GrantTokens, DryRun, } => Message,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GenerateMacRequest::GenerateMacRequest{Message, KeyId, MacAlgorithm, GrantTokens, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field MacAlgorithm
                                pub fn MacAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MacAlgorithmSpec> {
                                    match self {
                                        GenerateMacRequest::GenerateMacRequest{Message, KeyId, MacAlgorithm, GrantTokens, DryRun, } => MacAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        GenerateMacRequest::GenerateMacRequest{Message, KeyId, MacAlgorithm, GrantTokens, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        GenerateMacRequest::GenerateMacRequest{Message, KeyId, MacAlgorithm, GrantTokens, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateMacRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateMacRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateMacRequest::GenerateMacRequest{Message, KeyId, MacAlgorithm, GrantTokens, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateMacRequest.GenerateMacRequest(")?;
                                            DafnyPrint::fmt_print(Message, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MacAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateMacRequest {}

                            impl Hash
                                for GenerateMacRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateMacRequest::GenerateMacRequest{Message, KeyId, MacAlgorithm, GrantTokens, DryRun, } => {
                                            Hash::hash(Message, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(MacAlgorithm, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateMacRequest {
                                fn default() -> GenerateMacRequest {
                                    GenerateMacRequest::GenerateMacRequest {
                                        Message: Default::default(),
                                        KeyId: Default::default(),
                                        MacAlgorithm: Default::default(),
                                        GrantTokens: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateMacRequest>
                                for GenerateMacRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(358,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateMacResponse {
                                GenerateMacResponse {
                                    Mac: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>,
                                    MacAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MacAlgorithmSpec>>>,
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl GenerateMacResponse {
                                /// Returns a borrow of the field Mac
                                pub fn Mac(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        GenerateMacResponse::GenerateMacResponse{Mac, MacAlgorithm, KeyId, } => Mac,
                                    }
                                }
                                /// Returns a borrow of the field MacAlgorithm
                                pub fn MacAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MacAlgorithmSpec>>> {
                                    match self {
                                        GenerateMacResponse::GenerateMacResponse{Mac, MacAlgorithm, KeyId, } => MacAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GenerateMacResponse::GenerateMacResponse{Mac, MacAlgorithm, KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateMacResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateMacResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateMacResponse::GenerateMacResponse{Mac, MacAlgorithm, KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateMacResponse.GenerateMacResponse(")?;
                                            DafnyPrint::fmt_print(Mac, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MacAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateMacResponse {}

                            impl Hash
                                for GenerateMacResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateMacResponse::GenerateMacResponse{Mac, MacAlgorithm, KeyId, } => {
                                            Hash::hash(Mac, _state);
                                            Hash::hash(MacAlgorithm, _state);
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateMacResponse {
                                fn default() -> GenerateMacResponse {
                                    GenerateMacResponse::GenerateMacResponse {
                                        Mac: Default::default(),
                                        MacAlgorithm: Default::default(),
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateMacResponse>
                                for GenerateMacResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(363,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateRandomRequest {
                                GenerateRandomRequest {
                                    NumberOfBytes: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::NumberOfBytesType>>,
                                    CustomKeyStoreId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Recipient: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo>>>
                                }
                            }

                            impl GenerateRandomRequest {
                                /// Returns a borrow of the field NumberOfBytes
                                pub fn NumberOfBytes(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::NumberOfBytesType>> {
                                    match self {
                                        GenerateRandomRequest::GenerateRandomRequest{NumberOfBytes, CustomKeyStoreId, Recipient, } => NumberOfBytes,
                                    }
                                }
                                /// Returns a borrow of the field CustomKeyStoreId
                                pub fn CustomKeyStoreId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GenerateRandomRequest::GenerateRandomRequest{NumberOfBytes, CustomKeyStoreId, Recipient, } => CustomKeyStoreId,
                                    }
                                }
                                /// Returns a borrow of the field Recipient
                                pub fn Recipient(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo>>> {
                                    match self {
                                        GenerateRandomRequest::GenerateRandomRequest{NumberOfBytes, CustomKeyStoreId, Recipient, } => Recipient,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateRandomRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateRandomRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateRandomRequest::GenerateRandomRequest{NumberOfBytes, CustomKeyStoreId, Recipient, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateRandomRequest.GenerateRandomRequest(")?;
                                            DafnyPrint::fmt_print(NumberOfBytes, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Recipient, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateRandomRequest {}

                            impl Hash
                                for GenerateRandomRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateRandomRequest::GenerateRandomRequest{NumberOfBytes, CustomKeyStoreId, Recipient, } => {
                                            Hash::hash(NumberOfBytes, _state);
                                            Hash::hash(CustomKeyStoreId, _state);
                                            Hash::hash(Recipient, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateRandomRequest {
                                fn default() -> GenerateRandomRequest {
                                    GenerateRandomRequest::GenerateRandomRequest {
                                        NumberOfBytes: Default::default(),
                                        CustomKeyStoreId: Default::default(),
                                        Recipient: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateRandomRequest>
                                for GenerateRandomRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(368,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GenerateRandomResponse {
                                GenerateRandomResponse {
                                    Plaintext: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>>,
                                    CiphertextForRecipient: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>
                                }
                            }

                            impl GenerateRandomResponse {
                                /// Returns a borrow of the field Plaintext
                                pub fn Plaintext(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>> {
                                    match self {
                                        GenerateRandomResponse::GenerateRandomResponse{Plaintext, CiphertextForRecipient, } => Plaintext,
                                    }
                                }
                                /// Returns a borrow of the field CiphertextForRecipient
                                pub fn CiphertextForRecipient(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        GenerateRandomResponse::GenerateRandomResponse{Plaintext, CiphertextForRecipient, } => CiphertextForRecipient,
                                    }
                                }
                            }

                            impl Debug
                                for GenerateRandomResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GenerateRandomResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GenerateRandomResponse::GenerateRandomResponse{Plaintext, CiphertextForRecipient, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GenerateRandomResponse.GenerateRandomResponse(")?;
                                            DafnyPrint::fmt_print(Plaintext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CiphertextForRecipient, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GenerateRandomResponse {}

                            impl Hash
                                for GenerateRandomResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GenerateRandomResponse::GenerateRandomResponse{Plaintext, CiphertextForRecipient, } => {
                                            Hash::hash(Plaintext, _state);
                                            Hash::hash(CiphertextForRecipient, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GenerateRandomResponse {
                                fn default() -> GenerateRandomResponse {
                                    GenerateRandomResponse::GenerateRandomResponse {
                                        Plaintext: Default::default(),
                                        CiphertextForRecipient: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GenerateRandomResponse>
                                for GenerateRandomResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(372,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetKeyPolicyRequest {
                                GetKeyPolicyRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    PolicyName: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl GetKeyPolicyRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GetKeyPolicyRequest::GetKeyPolicyRequest{KeyId, PolicyName, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field PolicyName
                                pub fn PolicyName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetKeyPolicyRequest::GetKeyPolicyRequest{KeyId, PolicyName, } => PolicyName,
                                    }
                                }
                            }

                            impl Debug
                                for GetKeyPolicyRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetKeyPolicyRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetKeyPolicyRequest::GetKeyPolicyRequest{KeyId, PolicyName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GetKeyPolicyRequest.GetKeyPolicyRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PolicyName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetKeyPolicyRequest {}

                            impl Hash
                                for GetKeyPolicyRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetKeyPolicyRequest::GetKeyPolicyRequest{KeyId, PolicyName, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(PolicyName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetKeyPolicyRequest {
                                fn default() -> GetKeyPolicyRequest {
                                    GetKeyPolicyRequest::GetKeyPolicyRequest {
                                        KeyId: Default::default(),
                                        PolicyName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetKeyPolicyRequest>
                                for GetKeyPolicyRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(376,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetKeyPolicyResponse {
                                GetKeyPolicyResponse {
                                    Policy: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    PolicyName: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl GetKeyPolicyResponse {
                                /// Returns a borrow of the field Policy
                                pub fn Policy(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetKeyPolicyResponse::GetKeyPolicyResponse{Policy, PolicyName, } => Policy,
                                    }
                                }
                                /// Returns a borrow of the field PolicyName
                                pub fn PolicyName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetKeyPolicyResponse::GetKeyPolicyResponse{Policy, PolicyName, } => PolicyName,
                                    }
                                }
                            }

                            impl Debug
                                for GetKeyPolicyResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetKeyPolicyResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetKeyPolicyResponse::GetKeyPolicyResponse{Policy, PolicyName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GetKeyPolicyResponse.GetKeyPolicyResponse(")?;
                                            DafnyPrint::fmt_print(Policy, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PolicyName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetKeyPolicyResponse {}

                            impl Hash
                                for GetKeyPolicyResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetKeyPolicyResponse::GetKeyPolicyResponse{Policy, PolicyName, } => {
                                            Hash::hash(Policy, _state);
                                            Hash::hash(PolicyName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetKeyPolicyResponse {
                                fn default() -> GetKeyPolicyResponse {
                                    GetKeyPolicyResponse::GetKeyPolicyResponse {
                                        Policy: Default::default(),
                                        PolicyName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetKeyPolicyResponse>
                                for GetKeyPolicyResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(380,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetKeyRotationStatusRequest {
                                GetKeyRotationStatusRequest {
                                    KeyId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl GetKeyRotationStatusRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GetKeyRotationStatusRequest::GetKeyRotationStatusRequest{KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for GetKeyRotationStatusRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetKeyRotationStatusRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetKeyRotationStatusRequest::GetKeyRotationStatusRequest{KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GetKeyRotationStatusRequest.GetKeyRotationStatusRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetKeyRotationStatusRequest {}

                            impl Hash
                                for GetKeyRotationStatusRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetKeyRotationStatusRequest::GetKeyRotationStatusRequest{KeyId, } => {
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetKeyRotationStatusRequest {
                                fn default() -> GetKeyRotationStatusRequest {
                                    GetKeyRotationStatusRequest::GetKeyRotationStatusRequest {
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetKeyRotationStatusRequest>
                                for GetKeyRotationStatusRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(383,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetKeyRotationStatusResponse {
                                GetKeyRotationStatusResponse {
                                    KeyRotationEnabled: Arc<Option<bool>>,
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    RotationPeriodInDays: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RotationPeriodInDaysType>>,
                                    NextRotationDate: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    OnDemandRotationStartDate: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl GetKeyRotationStatusResponse {
                                /// Returns a borrow of the field KeyRotationEnabled
                                pub fn KeyRotationEnabled(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        GetKeyRotationStatusResponse::GetKeyRotationStatusResponse{KeyRotationEnabled, KeyId, RotationPeriodInDays, NextRotationDate, OnDemandRotationStartDate, } => KeyRotationEnabled,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetKeyRotationStatusResponse::GetKeyRotationStatusResponse{KeyRotationEnabled, KeyId, RotationPeriodInDays, NextRotationDate, OnDemandRotationStartDate, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field RotationPeriodInDays
                                pub fn RotationPeriodInDays(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RotationPeriodInDaysType>> {
                                    match self {
                                        GetKeyRotationStatusResponse::GetKeyRotationStatusResponse{KeyRotationEnabled, KeyId, RotationPeriodInDays, NextRotationDate, OnDemandRotationStartDate, } => RotationPeriodInDays,
                                    }
                                }
                                /// Returns a borrow of the field NextRotationDate
                                pub fn NextRotationDate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetKeyRotationStatusResponse::GetKeyRotationStatusResponse{KeyRotationEnabled, KeyId, RotationPeriodInDays, NextRotationDate, OnDemandRotationStartDate, } => NextRotationDate,
                                    }
                                }
                                /// Returns a borrow of the field OnDemandRotationStartDate
                                pub fn OnDemandRotationStartDate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetKeyRotationStatusResponse::GetKeyRotationStatusResponse{KeyRotationEnabled, KeyId, RotationPeriodInDays, NextRotationDate, OnDemandRotationStartDate, } => OnDemandRotationStartDate,
                                    }
                                }
                            }

                            impl Debug
                                for GetKeyRotationStatusResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetKeyRotationStatusResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetKeyRotationStatusResponse::GetKeyRotationStatusResponse{KeyRotationEnabled, KeyId, RotationPeriodInDays, NextRotationDate, OnDemandRotationStartDate, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GetKeyRotationStatusResponse.GetKeyRotationStatusResponse(")?;
                                            DafnyPrint::fmt_print(KeyRotationEnabled, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RotationPeriodInDays, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextRotationDate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(OnDemandRotationStartDate, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetKeyRotationStatusResponse {}

                            impl Hash
                                for GetKeyRotationStatusResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetKeyRotationStatusResponse::GetKeyRotationStatusResponse{KeyRotationEnabled, KeyId, RotationPeriodInDays, NextRotationDate, OnDemandRotationStartDate, } => {
                                            Hash::hash(KeyRotationEnabled, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(RotationPeriodInDays, _state);
                                            Hash::hash(NextRotationDate, _state);
                                            Hash::hash(OnDemandRotationStartDate, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetKeyRotationStatusResponse {
                                fn default() -> GetKeyRotationStatusResponse {
                                    GetKeyRotationStatusResponse::GetKeyRotationStatusResponse {
                                        KeyRotationEnabled: Default::default(),
                                        KeyId: Default::default(),
                                        RotationPeriodInDays: Default::default(),
                                        NextRotationDate: Default::default(),
                                        OnDemandRotationStartDate: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetKeyRotationStatusResponse>
                                for GetKeyRotationStatusResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(390,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetParametersForImportRequest {
                                GetParametersForImportRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    WrappingAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::AlgorithmSpec>,
                                    WrappingKeySpec: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::WrappingKeySpec>
                                }
                            }

                            impl GetParametersForImportRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GetParametersForImportRequest::GetParametersForImportRequest{KeyId, WrappingAlgorithm, WrappingKeySpec, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field WrappingAlgorithm
                                pub fn WrappingAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::AlgorithmSpec> {
                                    match self {
                                        GetParametersForImportRequest::GetParametersForImportRequest{KeyId, WrappingAlgorithm, WrappingKeySpec, } => WrappingAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field WrappingKeySpec
                                pub fn WrappingKeySpec(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::WrappingKeySpec> {
                                    match self {
                                        GetParametersForImportRequest::GetParametersForImportRequest{KeyId, WrappingAlgorithm, WrappingKeySpec, } => WrappingKeySpec,
                                    }
                                }
                            }

                            impl Debug
                                for GetParametersForImportRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetParametersForImportRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetParametersForImportRequest::GetParametersForImportRequest{KeyId, WrappingAlgorithm, WrappingKeySpec, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GetParametersForImportRequest.GetParametersForImportRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(WrappingAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(WrappingKeySpec, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetParametersForImportRequest {}

                            impl Hash
                                for GetParametersForImportRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetParametersForImportRequest::GetParametersForImportRequest{KeyId, WrappingAlgorithm, WrappingKeySpec, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(WrappingAlgorithm, _state);
                                            Hash::hash(WrappingKeySpec, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetParametersForImportRequest {
                                fn default() -> GetParametersForImportRequest {
                                    GetParametersForImportRequest::GetParametersForImportRequest {
                                        KeyId: Default::default(),
                                        WrappingAlgorithm: Default::default(),
                                        WrappingKeySpec: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetParametersForImportRequest>
                                for GetParametersForImportRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(395,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetParametersForImportResponse {
                                GetParametersForImportResponse {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ImportToken: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>,
                                    PublicKey: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>>,
                                    ParametersValidTo: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl GetParametersForImportResponse {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetParametersForImportResponse::GetParametersForImportResponse{KeyId, ImportToken, PublicKey, ParametersValidTo, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field ImportToken
                                pub fn ImportToken(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        GetParametersForImportResponse::GetParametersForImportResponse{KeyId, ImportToken, PublicKey, ParametersValidTo, } => ImportToken,
                                    }
                                }
                                /// Returns a borrow of the field PublicKey
                                pub fn PublicKey(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType>> {
                                    match self {
                                        GetParametersForImportResponse::GetParametersForImportResponse{KeyId, ImportToken, PublicKey, ParametersValidTo, } => PublicKey,
                                    }
                                }
                                /// Returns a borrow of the field ParametersValidTo
                                pub fn ParametersValidTo(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetParametersForImportResponse::GetParametersForImportResponse{KeyId, ImportToken, PublicKey, ParametersValidTo, } => ParametersValidTo,
                                    }
                                }
                            }

                            impl Debug
                                for GetParametersForImportResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetParametersForImportResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetParametersForImportResponse::GetParametersForImportResponse{KeyId, ImportToken, PublicKey, ParametersValidTo, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GetParametersForImportResponse.GetParametersForImportResponse(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ImportToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PublicKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ParametersValidTo, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetParametersForImportResponse {}

                            impl Hash
                                for GetParametersForImportResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetParametersForImportResponse::GetParametersForImportResponse{KeyId, ImportToken, PublicKey, ParametersValidTo, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(ImportToken, _state);
                                            Hash::hash(PublicKey, _state);
                                            Hash::hash(ParametersValidTo, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetParametersForImportResponse {
                                fn default() -> GetParametersForImportResponse {
                                    GetParametersForImportResponse::GetParametersForImportResponse {
                                        KeyId: Default::default(),
                                        ImportToken: Default::default(),
                                        PublicKey: Default::default(),
                                        ParametersValidTo: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetParametersForImportResponse>
                                for GetParametersForImportResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(401,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetPublicKeyRequest {
                                GetPublicKeyRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>
                                }
                            }

                            impl GetPublicKeyRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        GetPublicKeyRequest::GetPublicKeyRequest{KeyId, GrantTokens, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        GetPublicKeyRequest::GetPublicKeyRequest{KeyId, GrantTokens, } => GrantTokens,
                                    }
                                }
                            }

                            impl Debug
                                for GetPublicKeyRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetPublicKeyRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetPublicKeyRequest::GetPublicKeyRequest{KeyId, GrantTokens, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GetPublicKeyRequest.GetPublicKeyRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetPublicKeyRequest {}

                            impl Hash
                                for GetPublicKeyRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetPublicKeyRequest::GetPublicKeyRequest{KeyId, GrantTokens, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(GrantTokens, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetPublicKeyRequest {
                                fn default() -> GetPublicKeyRequest {
                                    GetPublicKeyRequest::GetPublicKeyRequest {
                                        KeyId: Default::default(),
                                        GrantTokens: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetPublicKeyRequest>
                                for GetPublicKeyRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(405,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GetPublicKeyResponse {
                                GetPublicKeyResponse {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    PublicKey: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType>>,
                                    CustomerMasterKeySpec: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomerMasterKeySpec>>>,
                                    KeySpec: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeySpec>>>,
                                    KeyUsage: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyUsageType>>>,
                                    EncryptionAlgorithms: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>>,
                                    SigningAlgorithms: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec>>>>,
                                    KeyAgreementAlgorithms: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyAgreementAlgorithmSpec>>>>
                                }
                            }

                            impl GetPublicKeyResponse {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GetPublicKeyResponse::GetPublicKeyResponse{KeyId, PublicKey, CustomerMasterKeySpec, KeySpec, KeyUsage, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field PublicKey
                                pub fn PublicKey(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType>> {
                                    match self {
                                        GetPublicKeyResponse::GetPublicKeyResponse{KeyId, PublicKey, CustomerMasterKeySpec, KeySpec, KeyUsage, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, } => PublicKey,
                                    }
                                }
                                /// Returns a borrow of the field CustomerMasterKeySpec
                                pub fn CustomerMasterKeySpec(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomerMasterKeySpec>>> {
                                    match self {
                                        GetPublicKeyResponse::GetPublicKeyResponse{KeyId, PublicKey, CustomerMasterKeySpec, KeySpec, KeyUsage, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, } => CustomerMasterKeySpec,
                                    }
                                }
                                /// Returns a borrow of the field KeySpec
                                pub fn KeySpec(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeySpec>>> {
                                    match self {
                                        GetPublicKeyResponse::GetPublicKeyResponse{KeyId, PublicKey, CustomerMasterKeySpec, KeySpec, KeyUsage, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, } => KeySpec,
                                    }
                                }
                                /// Returns a borrow of the field KeyUsage
                                pub fn KeyUsage(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyUsageType>>> {
                                    match self {
                                        GetPublicKeyResponse::GetPublicKeyResponse{KeyId, PublicKey, CustomerMasterKeySpec, KeySpec, KeyUsage, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, } => KeyUsage,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionAlgorithms
                                pub fn EncryptionAlgorithms(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>> {
                                    match self {
                                        GetPublicKeyResponse::GetPublicKeyResponse{KeyId, PublicKey, CustomerMasterKeySpec, KeySpec, KeyUsage, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, } => EncryptionAlgorithms,
                                    }
                                }
                                /// Returns a borrow of the field SigningAlgorithms
                                pub fn SigningAlgorithms(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec>>>> {
                                    match self {
                                        GetPublicKeyResponse::GetPublicKeyResponse{KeyId, PublicKey, CustomerMasterKeySpec, KeySpec, KeyUsage, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, } => SigningAlgorithms,
                                    }
                                }
                                /// Returns a borrow of the field KeyAgreementAlgorithms
                                pub fn KeyAgreementAlgorithms(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyAgreementAlgorithmSpec>>>> {
                                    match self {
                                        GetPublicKeyResponse::GetPublicKeyResponse{KeyId, PublicKey, CustomerMasterKeySpec, KeySpec, KeyUsage, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, } => KeyAgreementAlgorithms,
                                    }
                                }
                            }

                            impl Debug
                                for GetPublicKeyResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GetPublicKeyResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GetPublicKeyResponse::GetPublicKeyResponse{KeyId, PublicKey, CustomerMasterKeySpec, KeySpec, KeyUsage, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GetPublicKeyResponse.GetPublicKeyResponse(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PublicKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CustomerMasterKeySpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyUsage, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionAlgorithms, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SigningAlgorithms, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyAgreementAlgorithms, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GetPublicKeyResponse {}

                            impl Hash
                                for GetPublicKeyResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GetPublicKeyResponse::GetPublicKeyResponse{KeyId, PublicKey, CustomerMasterKeySpec, KeySpec, KeyUsage, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(PublicKey, _state);
                                            Hash::hash(CustomerMasterKeySpec, _state);
                                            Hash::hash(KeySpec, _state);
                                            Hash::hash(KeyUsage, _state);
                                            Hash::hash(EncryptionAlgorithms, _state);
                                            Hash::hash(SigningAlgorithms, _state);
                                            Hash::hash(KeyAgreementAlgorithms, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GetPublicKeyResponse {
                                fn default() -> GetPublicKeyResponse {
                                    GetPublicKeyResponse::GetPublicKeyResponse {
                                        KeyId: Default::default(),
                                        PublicKey: Default::default(),
                                        CustomerMasterKeySpec: Default::default(),
                                        KeySpec: Default::default(),
                                        KeyUsage: Default::default(),
                                        EncryptionAlgorithms: Default::default(),
                                        SigningAlgorithms: Default::default(),
                                        KeyAgreementAlgorithms: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GetPublicKeyResponse>
                                for GetPublicKeyResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(415,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GrantConstraints {
                                GrantConstraints {
                                    EncryptionContextSubset: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    EncryptionContextEquals: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>
                                }
                            }

                            impl GrantConstraints {
                                /// Returns a borrow of the field EncryptionContextSubset
                                pub fn EncryptionContextSubset(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        GrantConstraints::GrantConstraints{EncryptionContextSubset, EncryptionContextEquals, } => EncryptionContextSubset,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionContextEquals
                                pub fn EncryptionContextEquals(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        GrantConstraints::GrantConstraints{EncryptionContextSubset, EncryptionContextEquals, } => EncryptionContextEquals,
                                    }
                                }
                            }

                            impl Debug
                                for GrantConstraints {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GrantConstraints {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GrantConstraints::GrantConstraints{EncryptionContextSubset, EncryptionContextEquals, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantConstraints.GrantConstraints(")?;
                                            DafnyPrint::fmt_print(EncryptionContextSubset, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionContextEquals, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GrantConstraints {}

                            impl Hash
                                for GrantConstraints {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GrantConstraints::GrantConstraints{EncryptionContextSubset, EncryptionContextEquals, } => {
                                            Hash::hash(EncryptionContextSubset, _state);
                                            Hash::hash(EncryptionContextEquals, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GrantConstraints {
                                fn default() -> GrantConstraints {
                                    GrantConstraints::GrantConstraints {
                                        EncryptionContextSubset: Default::default(),
                                        EncryptionContextEquals: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GrantConstraints>
                                for GrantConstraints {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(419,3)
                            pub type GrantIdType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(424,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GrantListEntry {
                                GrantListEntry {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    GrantId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Name: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CreationDate: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    GranteePrincipal: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    RetiringPrincipal: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    IssuingAccount: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Operations: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantOperation>>>>,
                                    Constraints: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantConstraints>>>
                                }
                            }

                            impl GrantListEntry {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field GrantId
                                pub fn GrantId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => GrantId,
                                    }
                                }
                                /// Returns a borrow of the field Name
                                pub fn Name(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => Name,
                                    }
                                }
                                /// Returns a borrow of the field CreationDate
                                pub fn CreationDate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => CreationDate,
                                    }
                                }
                                /// Returns a borrow of the field GranteePrincipal
                                pub fn GranteePrincipal(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => GranteePrincipal,
                                    }
                                }
                                /// Returns a borrow of the field RetiringPrincipal
                                pub fn RetiringPrincipal(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => RetiringPrincipal,
                                    }
                                }
                                /// Returns a borrow of the field IssuingAccount
                                pub fn IssuingAccount(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => IssuingAccount,
                                    }
                                }
                                /// Returns a borrow of the field Operations
                                pub fn Operations(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantOperation>>>> {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => Operations,
                                    }
                                }
                                /// Returns a borrow of the field Constraints
                                pub fn Constraints(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantConstraints>>> {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => Constraints,
                                    }
                                }
                            }

                            impl Debug
                                for GrantListEntry {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GrantListEntry {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantListEntry.GrantListEntry(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Name, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CreationDate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GranteePrincipal, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RetiringPrincipal, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(IssuingAccount, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Operations, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Constraints, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for GrantListEntry {}

                            impl Hash
                                for GrantListEntry {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GrantListEntry::GrantListEntry{KeyId, GrantId, Name, CreationDate, GranteePrincipal, RetiringPrincipal, IssuingAccount, Operations, Constraints, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(GrantId, _state);
                                            Hash::hash(Name, _state);
                                            Hash::hash(CreationDate, _state);
                                            Hash::hash(GranteePrincipal, _state);
                                            Hash::hash(RetiringPrincipal, _state);
                                            Hash::hash(IssuingAccount, _state);
                                            Hash::hash(Operations, _state);
                                            Hash::hash(Constraints, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for GrantListEntry {
                                fn default() -> GrantListEntry {
                                    GrantListEntry::GrantListEntry {
                                        KeyId: Default::default(),
                                        GrantId: Default::default(),
                                        Name: Default::default(),
                                        CreationDate: Default::default(),
                                        GranteePrincipal: Default::default(),
                                        RetiringPrincipal: Default::default(),
                                        IssuingAccount: Default::default(),
                                        Operations: Default::default(),
                                        Constraints: Default::default()
                                    }
                                }
                            }

                            impl AsRef<GrantListEntry>
                                for GrantListEntry {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(435,3)
                            pub type GrantNameType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(439,3)
                            #[derive(PartialEq, Clone)]
                            pub enum GrantOperation {
                                Decrypt {},
                                Encrypt {},
                                GenerateDataKey {},
                                GenerateDataKeyWithoutPlaintext {},
                                ReEncryptFrom {},
                                ReEncryptTo {},
                                Sign {},
                                Verify {},
                                GetPublicKey {},
                                CreateGrant {},
                                RetireGrant {},
                                DescribeKey {},
                                GenerateDataKeyPair {},
                                GenerateDataKeyPairWithoutPlaintext {},
                                GenerateMac {},
                                VerifyMac {},
                                DeriveSharedSecret {}
                            }

                            impl GrantOperation {}

                            impl Debug
                                for GrantOperation {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for GrantOperation {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        GrantOperation::Decrypt{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.Decrypt")?;
                                            Ok(())
                                        },
                                        GrantOperation::Encrypt{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.Encrypt")?;
                                            Ok(())
                                        },
                                        GrantOperation::GenerateDataKey{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.GenerateDataKey")?;
                                            Ok(())
                                        },
                                        GrantOperation::GenerateDataKeyWithoutPlaintext{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.GenerateDataKeyWithoutPlaintext")?;
                                            Ok(())
                                        },
                                        GrantOperation::ReEncryptFrom{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.ReEncryptFrom")?;
                                            Ok(())
                                        },
                                        GrantOperation::ReEncryptTo{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.ReEncryptTo")?;
                                            Ok(())
                                        },
                                        GrantOperation::Sign{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.Sign")?;
                                            Ok(())
                                        },
                                        GrantOperation::Verify{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.Verify")?;
                                            Ok(())
                                        },
                                        GrantOperation::GetPublicKey{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.GetPublicKey")?;
                                            Ok(())
                                        },
                                        GrantOperation::CreateGrant{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.CreateGrant")?;
                                            Ok(())
                                        },
                                        GrantOperation::RetireGrant{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.RetireGrant")?;
                                            Ok(())
                                        },
                                        GrantOperation::DescribeKey{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.DescribeKey")?;
                                            Ok(())
                                        },
                                        GrantOperation::GenerateDataKeyPair{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.GenerateDataKeyPair")?;
                                            Ok(())
                                        },
                                        GrantOperation::GenerateDataKeyPairWithoutPlaintext{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.GenerateDataKeyPairWithoutPlaintext")?;
                                            Ok(())
                                        },
                                        GrantOperation::GenerateMac{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.GenerateMac")?;
                                            Ok(())
                                        },
                                        GrantOperation::VerifyMac{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.VerifyMac")?;
                                            Ok(())
                                        },
                                        GrantOperation::DeriveSharedSecret{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.DeriveSharedSecret")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl GrantOperation {
                                /// Enumerates all possible values of GrantOperation
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<GrantOperation>> {
                                    seq![Arc::new(GrantOperation::Decrypt {}), Arc::new(GrantOperation::Encrypt {}), Arc::new(GrantOperation::GenerateDataKey {}), Arc::new(GrantOperation::GenerateDataKeyWithoutPlaintext {}), Arc::new(GrantOperation::ReEncryptFrom {}), Arc::new(GrantOperation::ReEncryptTo {}), Arc::new(GrantOperation::Sign {}), Arc::new(GrantOperation::Verify {}), Arc::new(GrantOperation::GetPublicKey {}), Arc::new(GrantOperation::CreateGrant {}), Arc::new(GrantOperation::RetireGrant {}), Arc::new(GrantOperation::DescribeKey {}), Arc::new(GrantOperation::GenerateDataKeyPair {}), Arc::new(GrantOperation::GenerateDataKeyPairWithoutPlaintext {}), Arc::new(GrantOperation::GenerateMac {}), Arc::new(GrantOperation::VerifyMac {}), Arc::new(GrantOperation::DeriveSharedSecret {})].iter()
                                }
                            }

                            impl Eq
                                for GrantOperation {}

                            impl Hash
                                for GrantOperation {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        GrantOperation::Decrypt{} => {

                                        },
                                        GrantOperation::Encrypt{} => {

                                        },
                                        GrantOperation::GenerateDataKey{} => {

                                        },
                                        GrantOperation::GenerateDataKeyWithoutPlaintext{} => {

                                        },
                                        GrantOperation::ReEncryptFrom{} => {

                                        },
                                        GrantOperation::ReEncryptTo{} => {

                                        },
                                        GrantOperation::Sign{} => {

                                        },
                                        GrantOperation::Verify{} => {

                                        },
                                        GrantOperation::GetPublicKey{} => {

                                        },
                                        GrantOperation::CreateGrant{} => {

                                        },
                                        GrantOperation::RetireGrant{} => {

                                        },
                                        GrantOperation::DescribeKey{} => {

                                        },
                                        GrantOperation::GenerateDataKeyPair{} => {

                                        },
                                        GrantOperation::GenerateDataKeyPairWithoutPlaintext{} => {

                                        },
                                        GrantOperation::GenerateMac{} => {

                                        },
                                        GrantOperation::VerifyMac{} => {

                                        },
                                        GrantOperation::DeriveSharedSecret{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for GrantOperation {
                                fn default() -> GrantOperation {
                                    GrantOperation::Decrypt {}
                                }
                            }

                            impl AsRef<GrantOperation>
                                for GrantOperation {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(458,3)
                            pub type GrantTokenList = Sequence<Sequence<DafnyCharUTF16>>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(462,3)
                            pub type GrantTokenType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(466,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ImportKeyMaterialRequest {
                                ImportKeyMaterialRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    ImportToken: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType,
                                    EncryptedKeyMaterial: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType,
                                    ValidTo: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpirationModel: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ExpirationModelType>>>
                                }
                            }

                            impl ImportKeyMaterialRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ImportKeyMaterialRequest::ImportKeyMaterialRequest{KeyId, ImportToken, EncryptedKeyMaterial, ValidTo, ExpirationModel, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field ImportToken
                                pub fn ImportToken(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType {
                                    match self {
                                        ImportKeyMaterialRequest::ImportKeyMaterialRequest{KeyId, ImportToken, EncryptedKeyMaterial, ValidTo, ExpirationModel, } => ImportToken,
                                    }
                                }
                                /// Returns a borrow of the field EncryptedKeyMaterial
                                pub fn EncryptedKeyMaterial(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType {
                                    match self {
                                        ImportKeyMaterialRequest::ImportKeyMaterialRequest{KeyId, ImportToken, EncryptedKeyMaterial, ValidTo, ExpirationModel, } => EncryptedKeyMaterial,
                                    }
                                }
                                /// Returns a borrow of the field ValidTo
                                pub fn ValidTo(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ImportKeyMaterialRequest::ImportKeyMaterialRequest{KeyId, ImportToken, EncryptedKeyMaterial, ValidTo, ExpirationModel, } => ValidTo,
                                    }
                                }
                                /// Returns a borrow of the field ExpirationModel
                                pub fn ExpirationModel(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ExpirationModelType>>> {
                                    match self {
                                        ImportKeyMaterialRequest::ImportKeyMaterialRequest{KeyId, ImportToken, EncryptedKeyMaterial, ValidTo, ExpirationModel, } => ExpirationModel,
                                    }
                                }
                            }

                            impl Debug
                                for ImportKeyMaterialRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ImportKeyMaterialRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ImportKeyMaterialRequest::ImportKeyMaterialRequest{KeyId, ImportToken, EncryptedKeyMaterial, ValidTo, ExpirationModel, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ImportKeyMaterialRequest.ImportKeyMaterialRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ImportToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptedKeyMaterial, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ValidTo, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpirationModel, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ImportKeyMaterialRequest {}

                            impl Hash
                                for ImportKeyMaterialRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ImportKeyMaterialRequest::ImportKeyMaterialRequest{KeyId, ImportToken, EncryptedKeyMaterial, ValidTo, ExpirationModel, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(ImportToken, _state);
                                            Hash::hash(EncryptedKeyMaterial, _state);
                                            Hash::hash(ValidTo, _state);
                                            Hash::hash(ExpirationModel, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ImportKeyMaterialRequest {
                                fn default() -> ImportKeyMaterialRequest {
                                    ImportKeyMaterialRequest::ImportKeyMaterialRequest {
                                        KeyId: Default::default(),
                                        ImportToken: Default::default(),
                                        EncryptedKeyMaterial: Default::default(),
                                        ValidTo: Default::default(),
                                        ExpirationModel: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ImportKeyMaterialRequest>
                                for ImportKeyMaterialRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(473,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ImportKeyMaterialResponse {
                                ImportKeyMaterialResponse {}
                            }

                            impl ImportKeyMaterialResponse {}

                            impl Debug
                                for ImportKeyMaterialResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ImportKeyMaterialResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ImportKeyMaterialResponse::ImportKeyMaterialResponse{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ImportKeyMaterialResponse.ImportKeyMaterialResponse")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl ImportKeyMaterialResponse {
                                /// Enumerates all possible values of ImportKeyMaterialResponse
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ImportKeyMaterialResponse>> {
                                    seq![Arc::new(ImportKeyMaterialResponse::ImportKeyMaterialResponse {})].iter()
                                }
                            }

                            impl Eq
                                for ImportKeyMaterialResponse {}

                            impl Hash
                                for ImportKeyMaterialResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ImportKeyMaterialResponse::ImportKeyMaterialResponse{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for ImportKeyMaterialResponse {
                                fn default() -> ImportKeyMaterialResponse {
                                    ImportKeyMaterialResponse::ImportKeyMaterialResponse {}
                                }
                            }

                            impl AsRef<ImportKeyMaterialResponse>
                                for ImportKeyMaterialResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(476,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeyAgreementAlgorithmSpec {
                                ECDH {}
                            }

                            impl KeyAgreementAlgorithmSpec {}

                            impl Debug
                                for KeyAgreementAlgorithmSpec {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeyAgreementAlgorithmSpec {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeyAgreementAlgorithmSpec::ECDH{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyAgreementAlgorithmSpec.ECDH")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl KeyAgreementAlgorithmSpec {
                                /// Enumerates all possible values of KeyAgreementAlgorithmSpec
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KeyAgreementAlgorithmSpec>> {
                                    seq![Arc::new(KeyAgreementAlgorithmSpec::ECDH {})].iter()
                                }
                            }

                            impl Eq
                                for KeyAgreementAlgorithmSpec {}

                            impl Hash
                                for KeyAgreementAlgorithmSpec {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeyAgreementAlgorithmSpec::ECDH{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeyAgreementAlgorithmSpec {
                                fn default() -> KeyAgreementAlgorithmSpec {
                                    KeyAgreementAlgorithmSpec::ECDH {}
                                }
                            }

                            impl AsRef<KeyAgreementAlgorithmSpec>
                                for KeyAgreementAlgorithmSpec {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(479,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeyEncryptionMechanism {
                                RSAES_OAEP_SHA_256 {}
                            }

                            impl KeyEncryptionMechanism {}

                            impl Debug
                                for KeyEncryptionMechanism {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeyEncryptionMechanism {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeyEncryptionMechanism::RSAES_OAEP_SHA_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyEncryptionMechanism.RSAES__OAEP__SHA__256")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl KeyEncryptionMechanism {
                                /// Enumerates all possible values of KeyEncryptionMechanism
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KeyEncryptionMechanism>> {
                                    seq![Arc::new(KeyEncryptionMechanism::RSAES_OAEP_SHA_256 {})].iter()
                                }
                            }

                            impl Eq
                                for KeyEncryptionMechanism {}

                            impl Hash
                                for KeyEncryptionMechanism {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeyEncryptionMechanism::RSAES_OAEP_SHA_256{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeyEncryptionMechanism {
                                fn default() -> KeyEncryptionMechanism {
                                    KeyEncryptionMechanism::RSAES_OAEP_SHA_256 {}
                                }
                            }

                            impl AsRef<KeyEncryptionMechanism>
                                for KeyEncryptionMechanism {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(481,3)
                            pub type KeyIdType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(486,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeyListEntry {
                                KeyListEntry {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyArn: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl KeyListEntry {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeyListEntry::KeyListEntry{KeyId, KeyArn, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field KeyArn
                                pub fn KeyArn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeyListEntry::KeyListEntry{KeyId, KeyArn, } => KeyArn,
                                    }
                                }
                            }

                            impl Debug
                                for KeyListEntry {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeyListEntry {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeyListEntry::KeyListEntry{KeyId, KeyArn, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyListEntry.KeyListEntry(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyArn, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for KeyListEntry {}

                            impl Hash
                                for KeyListEntry {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeyListEntry::KeyListEntry{KeyId, KeyArn, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(KeyArn, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeyListEntry {
                                fn default() -> KeyListEntry {
                                    KeyListEntry::KeyListEntry {
                                        KeyId: Default::default(),
                                        KeyArn: Default::default()
                                    }
                                }
                            }

                            impl AsRef<KeyListEntry>
                                for KeyListEntry {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(490,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeyManagerType {
                                AWS {},
                                CUSTOMER {}
                            }

                            impl KeyManagerType {}

                            impl Debug
                                for KeyManagerType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeyManagerType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeyManagerType::AWS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyManagerType.AWS")?;
                                            Ok(())
                                        },
                                        KeyManagerType::CUSTOMER{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyManagerType.CUSTOMER")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl KeyManagerType {
                                /// Enumerates all possible values of KeyManagerType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KeyManagerType>> {
                                    seq![Arc::new(KeyManagerType::AWS {}), Arc::new(KeyManagerType::CUSTOMER {})].iter()
                                }
                            }

                            impl Eq
                                for KeyManagerType {}

                            impl Hash
                                for KeyManagerType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeyManagerType::AWS{} => {

                                        },
                                        KeyManagerType::CUSTOMER{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeyManagerType {
                                fn default() -> KeyManagerType {
                                    KeyManagerType::AWS {}
                                }
                            }

                            impl AsRef<KeyManagerType>
                                for KeyManagerType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(493,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeyMetadata {
                                KeyMetadata {
                                    AWSAccountId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    Arn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CreationDate: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Enabled: Arc<Option<bool>>,
                                    Description: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyUsage: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyUsageType>>>,
                                    KeyState: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyState>>>,
                                    DeletionDate: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ValidTo: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Origin: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::OriginType>>>,
                                    CustomKeyStoreId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CloudHsmClusterId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ExpirationModel: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ExpirationModelType>>>,
                                    KeyManager: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyManagerType>>>,
                                    CustomerMasterKeySpec: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomerMasterKeySpec>>>,
                                    KeySpec: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeySpec>>>,
                                    EncryptionAlgorithms: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>>,
                                    SigningAlgorithms: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec>>>>,
                                    KeyAgreementAlgorithms: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyAgreementAlgorithmSpec>>>>,
                                    MultiRegion: Arc<Option<bool>>,
                                    MultiRegionConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MultiRegionConfiguration>>>,
                                    PendingDeletionWindowInDays: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PendingWindowInDaysType>>,
                                    MacAlgorithms: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MacAlgorithmSpec>>>>,
                                    XksKeyConfiguration: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksKeyConfigurationType>>>
                                }
                            }

                            impl KeyMetadata {
                                /// Returns a borrow of the field AWSAccountId
                                pub fn AWSAccountId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => AWSAccountId,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Arn
                                pub fn Arn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => Arn,
                                    }
                                }
                                /// Returns a borrow of the field CreationDate
                                pub fn CreationDate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => CreationDate,
                                    }
                                }
                                /// Returns a borrow of the field Enabled
                                pub fn Enabled(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => Enabled,
                                    }
                                }
                                /// Returns a borrow of the field Description
                                pub fn Description(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => Description,
                                    }
                                }
                                /// Returns a borrow of the field KeyUsage
                                pub fn KeyUsage(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyUsageType>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => KeyUsage,
                                    }
                                }
                                /// Returns a borrow of the field KeyState
                                pub fn KeyState(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyState>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => KeyState,
                                    }
                                }
                                /// Returns a borrow of the field DeletionDate
                                pub fn DeletionDate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => DeletionDate,
                                    }
                                }
                                /// Returns a borrow of the field ValidTo
                                pub fn ValidTo(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => ValidTo,
                                    }
                                }
                                /// Returns a borrow of the field Origin
                                pub fn Origin(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::OriginType>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => Origin,
                                    }
                                }
                                /// Returns a borrow of the field CustomKeyStoreId
                                pub fn CustomKeyStoreId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => CustomKeyStoreId,
                                    }
                                }
                                /// Returns a borrow of the field CloudHsmClusterId
                                pub fn CloudHsmClusterId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => CloudHsmClusterId,
                                    }
                                }
                                /// Returns a borrow of the field ExpirationModel
                                pub fn ExpirationModel(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ExpirationModelType>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => ExpirationModel,
                                    }
                                }
                                /// Returns a borrow of the field KeyManager
                                pub fn KeyManager(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyManagerType>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => KeyManager,
                                    }
                                }
                                /// Returns a borrow of the field CustomerMasterKeySpec
                                pub fn CustomerMasterKeySpec(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CustomerMasterKeySpec>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => CustomerMasterKeySpec,
                                    }
                                }
                                /// Returns a borrow of the field KeySpec
                                pub fn KeySpec(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeySpec>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => KeySpec,
                                    }
                                }
                                /// Returns a borrow of the field EncryptionAlgorithms
                                pub fn EncryptionAlgorithms(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => EncryptionAlgorithms,
                                    }
                                }
                                /// Returns a borrow of the field SigningAlgorithms
                                pub fn SigningAlgorithms(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec>>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => SigningAlgorithms,
                                    }
                                }
                                /// Returns a borrow of the field KeyAgreementAlgorithms
                                pub fn KeyAgreementAlgorithms(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyAgreementAlgorithmSpec>>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => KeyAgreementAlgorithms,
                                    }
                                }
                                /// Returns a borrow of the field MultiRegion
                                pub fn MultiRegion(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => MultiRegion,
                                    }
                                }
                                /// Returns a borrow of the field MultiRegionConfiguration
                                pub fn MultiRegionConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MultiRegionConfiguration>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => MultiRegionConfiguration,
                                    }
                                }
                                /// Returns a borrow of the field PendingDeletionWindowInDays
                                pub fn PendingDeletionWindowInDays(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PendingWindowInDaysType>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => PendingDeletionWindowInDays,
                                    }
                                }
                                /// Returns a borrow of the field MacAlgorithms
                                pub fn MacAlgorithms(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MacAlgorithmSpec>>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => MacAlgorithms,
                                    }
                                }
                                /// Returns a borrow of the field XksKeyConfiguration
                                pub fn XksKeyConfiguration(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksKeyConfigurationType>>> {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => XksKeyConfiguration,
                                    }
                                }
                            }

                            impl Debug
                                for KeyMetadata {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeyMetadata {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyMetadata.KeyMetadata(")?;
                                            DafnyPrint::fmt_print(AWSAccountId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Arn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CreationDate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Enabled, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Description, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyUsage, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyState, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DeletionDate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ValidTo, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Origin, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CloudHsmClusterId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ExpirationModel, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyManager, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CustomerMasterKeySpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeySpec, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(EncryptionAlgorithms, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SigningAlgorithms, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyAgreementAlgorithms, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MultiRegion, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MultiRegionConfiguration, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PendingDeletionWindowInDays, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MacAlgorithms, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksKeyConfiguration, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for KeyMetadata {}

                            impl Hash
                                for KeyMetadata {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeyMetadata::KeyMetadata{AWSAccountId, KeyId, Arn, CreationDate, Enabled, Description, KeyUsage, KeyState, DeletionDate, ValidTo, Origin, CustomKeyStoreId, CloudHsmClusterId, ExpirationModel, KeyManager, CustomerMasterKeySpec, KeySpec, EncryptionAlgorithms, SigningAlgorithms, KeyAgreementAlgorithms, MultiRegion, MultiRegionConfiguration, PendingDeletionWindowInDays, MacAlgorithms, XksKeyConfiguration, } => {
                                            Hash::hash(AWSAccountId, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Arn, _state);
                                            Hash::hash(CreationDate, _state);
                                            Hash::hash(Enabled, _state);
                                            Hash::hash(Description, _state);
                                            Hash::hash(KeyUsage, _state);
                                            Hash::hash(KeyState, _state);
                                            Hash::hash(DeletionDate, _state);
                                            Hash::hash(ValidTo, _state);
                                            Hash::hash(Origin, _state);
                                            Hash::hash(CustomKeyStoreId, _state);
                                            Hash::hash(CloudHsmClusterId, _state);
                                            Hash::hash(ExpirationModel, _state);
                                            Hash::hash(KeyManager, _state);
                                            Hash::hash(CustomerMasterKeySpec, _state);
                                            Hash::hash(KeySpec, _state);
                                            Hash::hash(EncryptionAlgorithms, _state);
                                            Hash::hash(SigningAlgorithms, _state);
                                            Hash::hash(KeyAgreementAlgorithms, _state);
                                            Hash::hash(MultiRegion, _state);
                                            Hash::hash(MultiRegionConfiguration, _state);
                                            Hash::hash(PendingDeletionWindowInDays, _state);
                                            Hash::hash(MacAlgorithms, _state);
                                            Hash::hash(XksKeyConfiguration, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeyMetadata {
                                fn default() -> KeyMetadata {
                                    KeyMetadata::KeyMetadata {
                                        AWSAccountId: Default::default(),
                                        KeyId: Default::default(),
                                        Arn: Default::default(),
                                        CreationDate: Default::default(),
                                        Enabled: Default::default(),
                                        Description: Default::default(),
                                        KeyUsage: Default::default(),
                                        KeyState: Default::default(),
                                        DeletionDate: Default::default(),
                                        ValidTo: Default::default(),
                                        Origin: Default::default(),
                                        CustomKeyStoreId: Default::default(),
                                        CloudHsmClusterId: Default::default(),
                                        ExpirationModel: Default::default(),
                                        KeyManager: Default::default(),
                                        CustomerMasterKeySpec: Default::default(),
                                        KeySpec: Default::default(),
                                        EncryptionAlgorithms: Default::default(),
                                        SigningAlgorithms: Default::default(),
                                        KeyAgreementAlgorithms: Default::default(),
                                        MultiRegion: Default::default(),
                                        MultiRegionConfiguration: Default::default(),
                                        PendingDeletionWindowInDays: Default::default(),
                                        MacAlgorithms: Default::default(),
                                        XksKeyConfiguration: Default::default()
                                    }
                                }
                            }

                            impl AsRef<KeyMetadata>
                                for KeyMetadata {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(520,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeySpec {
                                RSA_2048 {},
                                RSA_3072 {},
                                RSA_4096 {},
                                ECC_NIST_P256 {},
                                ECC_NIST_P384 {},
                                ECC_NIST_P521 {},
                                ECC_SECG_P256K1 {},
                                SYMMETRIC_DEFAULT {},
                                HMAC_224 {},
                                HMAC_256 {},
                                HMAC_384 {},
                                HMAC_512 {},
                                SM2 {}
                            }

                            impl KeySpec {}

                            impl Debug
                                for KeySpec {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeySpec {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeySpec::RSA_2048{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.RSA__2048")?;
                                            Ok(())
                                        },
                                        KeySpec::RSA_3072{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.RSA__3072")?;
                                            Ok(())
                                        },
                                        KeySpec::RSA_4096{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.RSA__4096")?;
                                            Ok(())
                                        },
                                        KeySpec::ECC_NIST_P256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.ECC__NIST__P256")?;
                                            Ok(())
                                        },
                                        KeySpec::ECC_NIST_P384{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.ECC__NIST__P384")?;
                                            Ok(())
                                        },
                                        KeySpec::ECC_NIST_P521{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.ECC__NIST__P521")?;
                                            Ok(())
                                        },
                                        KeySpec::ECC_SECG_P256K1{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.ECC__SECG__P256K1")?;
                                            Ok(())
                                        },
                                        KeySpec::SYMMETRIC_DEFAULT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.SYMMETRIC__DEFAULT")?;
                                            Ok(())
                                        },
                                        KeySpec::HMAC_224{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.HMAC__224")?;
                                            Ok(())
                                        },
                                        KeySpec::HMAC_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.HMAC__256")?;
                                            Ok(())
                                        },
                                        KeySpec::HMAC_384{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.HMAC__384")?;
                                            Ok(())
                                        },
                                        KeySpec::HMAC_512{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.HMAC__512")?;
                                            Ok(())
                                        },
                                        KeySpec::SM2{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.SM2")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl KeySpec {
                                /// Enumerates all possible values of KeySpec
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KeySpec>> {
                                    seq![Arc::new(KeySpec::RSA_2048 {}), Arc::new(KeySpec::RSA_3072 {}), Arc::new(KeySpec::RSA_4096 {}), Arc::new(KeySpec::ECC_NIST_P256 {}), Arc::new(KeySpec::ECC_NIST_P384 {}), Arc::new(KeySpec::ECC_NIST_P521 {}), Arc::new(KeySpec::ECC_SECG_P256K1 {}), Arc::new(KeySpec::SYMMETRIC_DEFAULT {}), Arc::new(KeySpec::HMAC_224 {}), Arc::new(KeySpec::HMAC_256 {}), Arc::new(KeySpec::HMAC_384 {}), Arc::new(KeySpec::HMAC_512 {}), Arc::new(KeySpec::SM2 {})].iter()
                                }
                            }

                            impl Eq
                                for KeySpec {}

                            impl Hash
                                for KeySpec {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeySpec::RSA_2048{} => {

                                        },
                                        KeySpec::RSA_3072{} => {

                                        },
                                        KeySpec::RSA_4096{} => {

                                        },
                                        KeySpec::ECC_NIST_P256{} => {

                                        },
                                        KeySpec::ECC_NIST_P384{} => {

                                        },
                                        KeySpec::ECC_NIST_P521{} => {

                                        },
                                        KeySpec::ECC_SECG_P256K1{} => {

                                        },
                                        KeySpec::SYMMETRIC_DEFAULT{} => {

                                        },
                                        KeySpec::HMAC_224{} => {

                                        },
                                        KeySpec::HMAC_256{} => {

                                        },
                                        KeySpec::HMAC_384{} => {

                                        },
                                        KeySpec::HMAC_512{} => {

                                        },
                                        KeySpec::SM2{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeySpec {
                                fn default() -> KeySpec {
                                    KeySpec::RSA_2048 {}
                                }
                            }

                            impl AsRef<KeySpec>
                                for KeySpec {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(534,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeyState {
                                Creating {},
                                Enabled {},
                                Disabled {},
                                PendingDeletion {},
                                PendingImport {},
                                PendingReplicaDeletion {},
                                Unavailable {},
                                Updating {}
                            }

                            impl KeyState {}

                            impl Debug
                                for KeyState {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeyState {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeyState::Creating{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyState.Creating")?;
                                            Ok(())
                                        },
                                        KeyState::Enabled{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyState.Enabled")?;
                                            Ok(())
                                        },
                                        KeyState::Disabled{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyState.Disabled")?;
                                            Ok(())
                                        },
                                        KeyState::PendingDeletion{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyState.PendingDeletion")?;
                                            Ok(())
                                        },
                                        KeyState::PendingImport{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyState.PendingImport")?;
                                            Ok(())
                                        },
                                        KeyState::PendingReplicaDeletion{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyState.PendingReplicaDeletion")?;
                                            Ok(())
                                        },
                                        KeyState::Unavailable{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyState.Unavailable")?;
                                            Ok(())
                                        },
                                        KeyState::Updating{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyState.Updating")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl KeyState {
                                /// Enumerates all possible values of KeyState
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KeyState>> {
                                    seq![Arc::new(KeyState::Creating {}), Arc::new(KeyState::Enabled {}), Arc::new(KeyState::Disabled {}), Arc::new(KeyState::PendingDeletion {}), Arc::new(KeyState::PendingImport {}), Arc::new(KeyState::PendingReplicaDeletion {}), Arc::new(KeyState::Unavailable {}), Arc::new(KeyState::Updating {})].iter()
                                }
                            }

                            impl Eq
                                for KeyState {}

                            impl Hash
                                for KeyState {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeyState::Creating{} => {

                                        },
                                        KeyState::Enabled{} => {

                                        },
                                        KeyState::Disabled{} => {

                                        },
                                        KeyState::PendingDeletion{} => {

                                        },
                                        KeyState::PendingImport{} => {

                                        },
                                        KeyState::PendingReplicaDeletion{} => {

                                        },
                                        KeyState::Unavailable{} => {

                                        },
                                        KeyState::Updating{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeyState {
                                fn default() -> KeyState {
                                    KeyState::Creating {}
                                }
                            }

                            impl AsRef<KeyState>
                                for KeyState {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(543,3)
                            pub type KeyStorePasswordType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(547,3)
                            #[derive(PartialEq, Clone)]
                            pub enum KeyUsageType {
                                SIGN_VERIFY {},
                                ENCRYPT_DECRYPT {},
                                GENERATE_VERIFY_MAC {},
                                KEY_AGREEMENT {}
                            }

                            impl KeyUsageType {}

                            impl Debug
                                for KeyUsageType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for KeyUsageType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        KeyUsageType::SIGN_VERIFY{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyUsageType.SIGN__VERIFY")?;
                                            Ok(())
                                        },
                                        KeyUsageType::ENCRYPT_DECRYPT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyUsageType.ENCRYPT__DECRYPT")?;
                                            Ok(())
                                        },
                                        KeyUsageType::GENERATE_VERIFY_MAC{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyUsageType.GENERATE__VERIFY__MAC")?;
                                            Ok(())
                                        },
                                        KeyUsageType::KEY_AGREEMENT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.KeyUsageType.KEY__AGREEMENT")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl KeyUsageType {
                                /// Enumerates all possible values of KeyUsageType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KeyUsageType>> {
                                    seq![Arc::new(KeyUsageType::SIGN_VERIFY {}), Arc::new(KeyUsageType::ENCRYPT_DECRYPT {}), Arc::new(KeyUsageType::GENERATE_VERIFY_MAC {}), Arc::new(KeyUsageType::KEY_AGREEMENT {})].iter()
                                }
                            }

                            impl Eq
                                for KeyUsageType {}

                            impl Hash
                                for KeyUsageType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        KeyUsageType::SIGN_VERIFY{} => {

                                        },
                                        KeyUsageType::ENCRYPT_DECRYPT{} => {

                                        },
                                        KeyUsageType::GENERATE_VERIFY_MAC{} => {

                                        },
                                        KeyUsageType::KEY_AGREEMENT{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for KeyUsageType {
                                fn default() -> KeyUsageType {
                                    KeyUsageType::SIGN_VERIFY {}
                                }
                            }

                            impl AsRef<KeyUsageType>
                                for KeyUsageType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(552,3)
                            pub type LimitType = i32;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(556,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListAliasesRequest {
                                ListAliasesRequest {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>>,
                                    Marker: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListAliasesRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListAliasesRequest::ListAliasesRequest{KeyId, Limit, Marker, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>> {
                                    match self {
                                        ListAliasesRequest::ListAliasesRequest{KeyId, Limit, Marker, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field Marker
                                pub fn Marker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListAliasesRequest::ListAliasesRequest{KeyId, Limit, Marker, } => Marker,
                                    }
                                }
                            }

                            impl Debug
                                for ListAliasesRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListAliasesRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListAliasesRequest::ListAliasesRequest{KeyId, Limit, Marker, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListAliasesRequest.ListAliasesRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Marker, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListAliasesRequest {}

                            impl Hash
                                for ListAliasesRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListAliasesRequest::ListAliasesRequest{KeyId, Limit, Marker, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Limit, _state);
                                            Hash::hash(Marker, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListAliasesRequest {
                                fn default() -> ListAliasesRequest {
                                    ListAliasesRequest::ListAliasesRequest {
                                        KeyId: Default::default(),
                                        Limit: Default::default(),
                                        Marker: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListAliasesRequest>
                                for ListAliasesRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(561,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListAliasesResponse {
                                ListAliasesResponse {
                                    Aliases: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::AliasListEntry>>>>,
                                    NextMarker: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Truncated: Arc<Option<bool>>
                                }
                            }

                            impl ListAliasesResponse {
                                /// Returns a borrow of the field Aliases
                                pub fn Aliases(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::AliasListEntry>>>> {
                                    match self {
                                        ListAliasesResponse::ListAliasesResponse{Aliases, NextMarker, Truncated, } => Aliases,
                                    }
                                }
                                /// Returns a borrow of the field NextMarker
                                pub fn NextMarker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListAliasesResponse::ListAliasesResponse{Aliases, NextMarker, Truncated, } => NextMarker,
                                    }
                                }
                                /// Returns a borrow of the field Truncated
                                pub fn Truncated(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ListAliasesResponse::ListAliasesResponse{Aliases, NextMarker, Truncated, } => Truncated,
                                    }
                                }
                            }

                            impl Debug
                                for ListAliasesResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListAliasesResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListAliasesResponse::ListAliasesResponse{Aliases, NextMarker, Truncated, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListAliasesResponse.ListAliasesResponse(")?;
                                            DafnyPrint::fmt_print(Aliases, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextMarker, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Truncated, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListAliasesResponse {}

                            impl Hash
                                for ListAliasesResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListAliasesResponse::ListAliasesResponse{Aliases, NextMarker, Truncated, } => {
                                            Hash::hash(Aliases, _state);
                                            Hash::hash(NextMarker, _state);
                                            Hash::hash(Truncated, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListAliasesResponse {
                                fn default() -> ListAliasesResponse {
                                    ListAliasesResponse::ListAliasesResponse {
                                        Aliases: Default::default(),
                                        NextMarker: Default::default(),
                                        Truncated: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListAliasesResponse>
                                for ListAliasesResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(566,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListGrantsRequest {
                                ListGrantsRequest {
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>>,
                                    Marker: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    GrantId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    GranteePrincipal: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListGrantsRequest {
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>> {
                                    match self {
                                        ListGrantsRequest::ListGrantsRequest{Limit, Marker, KeyId, GrantId, GranteePrincipal, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field Marker
                                pub fn Marker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListGrantsRequest::ListGrantsRequest{Limit, Marker, KeyId, GrantId, GranteePrincipal, } => Marker,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ListGrantsRequest::ListGrantsRequest{Limit, Marker, KeyId, GrantId, GranteePrincipal, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field GrantId
                                pub fn GrantId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListGrantsRequest::ListGrantsRequest{Limit, Marker, KeyId, GrantId, GranteePrincipal, } => GrantId,
                                    }
                                }
                                /// Returns a borrow of the field GranteePrincipal
                                pub fn GranteePrincipal(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListGrantsRequest::ListGrantsRequest{Limit, Marker, KeyId, GrantId, GranteePrincipal, } => GranteePrincipal,
                                    }
                                }
                            }

                            impl Debug
                                for ListGrantsRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListGrantsRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListGrantsRequest::ListGrantsRequest{Limit, Marker, KeyId, GrantId, GranteePrincipal, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListGrantsRequest.ListGrantsRequest(")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Marker, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GranteePrincipal, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListGrantsRequest {}

                            impl Hash
                                for ListGrantsRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListGrantsRequest::ListGrantsRequest{Limit, Marker, KeyId, GrantId, GranteePrincipal, } => {
                                            Hash::hash(Limit, _state);
                                            Hash::hash(Marker, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(GrantId, _state);
                                            Hash::hash(GranteePrincipal, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListGrantsRequest {
                                fn default() -> ListGrantsRequest {
                                    ListGrantsRequest::ListGrantsRequest {
                                        Limit: Default::default(),
                                        Marker: Default::default(),
                                        KeyId: Default::default(),
                                        GrantId: Default::default(),
                                        GranteePrincipal: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListGrantsRequest>
                                for ListGrantsRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(573,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListGrantsResponse {
                                ListGrantsResponse {
                                    Grants: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantListEntry>>>>,
                                    NextMarker: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Truncated: Arc<Option<bool>>
                                }
                            }

                            impl ListGrantsResponse {
                                /// Returns a borrow of the field Grants
                                pub fn Grants(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantListEntry>>>> {
                                    match self {
                                        ListGrantsResponse::ListGrantsResponse{Grants, NextMarker, Truncated, } => Grants,
                                    }
                                }
                                /// Returns a borrow of the field NextMarker
                                pub fn NextMarker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListGrantsResponse::ListGrantsResponse{Grants, NextMarker, Truncated, } => NextMarker,
                                    }
                                }
                                /// Returns a borrow of the field Truncated
                                pub fn Truncated(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ListGrantsResponse::ListGrantsResponse{Grants, NextMarker, Truncated, } => Truncated,
                                    }
                                }
                            }

                            impl Debug
                                for ListGrantsResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListGrantsResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListGrantsResponse::ListGrantsResponse{Grants, NextMarker, Truncated, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListGrantsResponse.ListGrantsResponse(")?;
                                            DafnyPrint::fmt_print(Grants, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextMarker, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Truncated, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListGrantsResponse {}

                            impl Hash
                                for ListGrantsResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListGrantsResponse::ListGrantsResponse{Grants, NextMarker, Truncated, } => {
                                            Hash::hash(Grants, _state);
                                            Hash::hash(NextMarker, _state);
                                            Hash::hash(Truncated, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListGrantsResponse {
                                fn default() -> ListGrantsResponse {
                                    ListGrantsResponse::ListGrantsResponse {
                                        Grants: Default::default(),
                                        NextMarker: Default::default(),
                                        Truncated: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListGrantsResponse>
                                for ListGrantsResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(578,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListKeyPoliciesRequest {
                                ListKeyPoliciesRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>>,
                                    Marker: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListKeyPoliciesRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ListKeyPoliciesRequest::ListKeyPoliciesRequest{KeyId, Limit, Marker, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>> {
                                    match self {
                                        ListKeyPoliciesRequest::ListKeyPoliciesRequest{KeyId, Limit, Marker, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field Marker
                                pub fn Marker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListKeyPoliciesRequest::ListKeyPoliciesRequest{KeyId, Limit, Marker, } => Marker,
                                    }
                                }
                            }

                            impl Debug
                                for ListKeyPoliciesRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListKeyPoliciesRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListKeyPoliciesRequest::ListKeyPoliciesRequest{KeyId, Limit, Marker, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListKeyPoliciesRequest.ListKeyPoliciesRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Marker, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListKeyPoliciesRequest {}

                            impl Hash
                                for ListKeyPoliciesRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListKeyPoliciesRequest::ListKeyPoliciesRequest{KeyId, Limit, Marker, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Limit, _state);
                                            Hash::hash(Marker, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListKeyPoliciesRequest {
                                fn default() -> ListKeyPoliciesRequest {
                                    ListKeyPoliciesRequest::ListKeyPoliciesRequest {
                                        KeyId: Default::default(),
                                        Limit: Default::default(),
                                        Marker: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListKeyPoliciesRequest>
                                for ListKeyPoliciesRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(583,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListKeyPoliciesResponse {
                                ListKeyPoliciesResponse {
                                    PolicyNames: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>,
                                    NextMarker: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Truncated: Arc<Option<bool>>
                                }
                            }

                            impl ListKeyPoliciesResponse {
                                /// Returns a borrow of the field PolicyNames
                                pub fn PolicyNames(&self) -> &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        ListKeyPoliciesResponse::ListKeyPoliciesResponse{PolicyNames, NextMarker, Truncated, } => PolicyNames,
                                    }
                                }
                                /// Returns a borrow of the field NextMarker
                                pub fn NextMarker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListKeyPoliciesResponse::ListKeyPoliciesResponse{PolicyNames, NextMarker, Truncated, } => NextMarker,
                                    }
                                }
                                /// Returns a borrow of the field Truncated
                                pub fn Truncated(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ListKeyPoliciesResponse::ListKeyPoliciesResponse{PolicyNames, NextMarker, Truncated, } => Truncated,
                                    }
                                }
                            }

                            impl Debug
                                for ListKeyPoliciesResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListKeyPoliciesResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListKeyPoliciesResponse::ListKeyPoliciesResponse{PolicyNames, NextMarker, Truncated, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListKeyPoliciesResponse.ListKeyPoliciesResponse(")?;
                                            DafnyPrint::fmt_print(PolicyNames, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextMarker, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Truncated, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListKeyPoliciesResponse {}

                            impl Hash
                                for ListKeyPoliciesResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListKeyPoliciesResponse::ListKeyPoliciesResponse{PolicyNames, NextMarker, Truncated, } => {
                                            Hash::hash(PolicyNames, _state);
                                            Hash::hash(NextMarker, _state);
                                            Hash::hash(Truncated, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListKeyPoliciesResponse {
                                fn default() -> ListKeyPoliciesResponse {
                                    ListKeyPoliciesResponse::ListKeyPoliciesResponse {
                                        PolicyNames: Default::default(),
                                        NextMarker: Default::default(),
                                        Truncated: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListKeyPoliciesResponse>
                                for ListKeyPoliciesResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(588,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListKeyRotationsRequest {
                                ListKeyRotationsRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>>,
                                    Marker: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListKeyRotationsRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ListKeyRotationsRequest::ListKeyRotationsRequest{KeyId, Limit, Marker, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>> {
                                    match self {
                                        ListKeyRotationsRequest::ListKeyRotationsRequest{KeyId, Limit, Marker, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field Marker
                                pub fn Marker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListKeyRotationsRequest::ListKeyRotationsRequest{KeyId, Limit, Marker, } => Marker,
                                    }
                                }
                            }

                            impl Debug
                                for ListKeyRotationsRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListKeyRotationsRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListKeyRotationsRequest::ListKeyRotationsRequest{KeyId, Limit, Marker, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListKeyRotationsRequest.ListKeyRotationsRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Marker, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListKeyRotationsRequest {}

                            impl Hash
                                for ListKeyRotationsRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListKeyRotationsRequest::ListKeyRotationsRequest{KeyId, Limit, Marker, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Limit, _state);
                                            Hash::hash(Marker, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListKeyRotationsRequest {
                                fn default() -> ListKeyRotationsRequest {
                                    ListKeyRotationsRequest::ListKeyRotationsRequest {
                                        KeyId: Default::default(),
                                        Limit: Default::default(),
                                        Marker: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListKeyRotationsRequest>
                                for ListKeyRotationsRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(593,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListKeyRotationsResponse {
                                ListKeyRotationsResponse {
                                    Rotations: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RotationsListEntry>>>>,
                                    NextMarker: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Truncated: Arc<Option<bool>>
                                }
                            }

                            impl ListKeyRotationsResponse {
                                /// Returns a borrow of the field Rotations
                                pub fn Rotations(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RotationsListEntry>>>> {
                                    match self {
                                        ListKeyRotationsResponse::ListKeyRotationsResponse{Rotations, NextMarker, Truncated, } => Rotations,
                                    }
                                }
                                /// Returns a borrow of the field NextMarker
                                pub fn NextMarker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListKeyRotationsResponse::ListKeyRotationsResponse{Rotations, NextMarker, Truncated, } => NextMarker,
                                    }
                                }
                                /// Returns a borrow of the field Truncated
                                pub fn Truncated(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ListKeyRotationsResponse::ListKeyRotationsResponse{Rotations, NextMarker, Truncated, } => Truncated,
                                    }
                                }
                            }

                            impl Debug
                                for ListKeyRotationsResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListKeyRotationsResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListKeyRotationsResponse::ListKeyRotationsResponse{Rotations, NextMarker, Truncated, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListKeyRotationsResponse.ListKeyRotationsResponse(")?;
                                            DafnyPrint::fmt_print(Rotations, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextMarker, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Truncated, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListKeyRotationsResponse {}

                            impl Hash
                                for ListKeyRotationsResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListKeyRotationsResponse::ListKeyRotationsResponse{Rotations, NextMarker, Truncated, } => {
                                            Hash::hash(Rotations, _state);
                                            Hash::hash(NextMarker, _state);
                                            Hash::hash(Truncated, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListKeyRotationsResponse {
                                fn default() -> ListKeyRotationsResponse {
                                    ListKeyRotationsResponse::ListKeyRotationsResponse {
                                        Rotations: Default::default(),
                                        NextMarker: Default::default(),
                                        Truncated: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListKeyRotationsResponse>
                                for ListKeyRotationsResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(598,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListKeysRequest {
                                ListKeysRequest {
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>>,
                                    Marker: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListKeysRequest {
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>> {
                                    match self {
                                        ListKeysRequest::ListKeysRequest{Limit, Marker, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field Marker
                                pub fn Marker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListKeysRequest::ListKeysRequest{Limit, Marker, } => Marker,
                                    }
                                }
                            }

                            impl Debug
                                for ListKeysRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListKeysRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListKeysRequest::ListKeysRequest{Limit, Marker, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListKeysRequest.ListKeysRequest(")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Marker, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListKeysRequest {}

                            impl Hash
                                for ListKeysRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListKeysRequest::ListKeysRequest{Limit, Marker, } => {
                                            Hash::hash(Limit, _state);
                                            Hash::hash(Marker, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListKeysRequest {
                                fn default() -> ListKeysRequest {
                                    ListKeysRequest::ListKeysRequest {
                                        Limit: Default::default(),
                                        Marker: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListKeysRequest>
                                for ListKeysRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(602,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListKeysResponse {
                                ListKeysResponse {
                                    Keys: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyListEntry>>>>,
                                    NextMarker: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Truncated: Arc<Option<bool>>
                                }
                            }

                            impl ListKeysResponse {
                                /// Returns a borrow of the field Keys
                                pub fn Keys(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyListEntry>>>> {
                                    match self {
                                        ListKeysResponse::ListKeysResponse{Keys, NextMarker, Truncated, } => Keys,
                                    }
                                }
                                /// Returns a borrow of the field NextMarker
                                pub fn NextMarker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListKeysResponse::ListKeysResponse{Keys, NextMarker, Truncated, } => NextMarker,
                                    }
                                }
                                /// Returns a borrow of the field Truncated
                                pub fn Truncated(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ListKeysResponse::ListKeysResponse{Keys, NextMarker, Truncated, } => Truncated,
                                    }
                                }
                            }

                            impl Debug
                                for ListKeysResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListKeysResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListKeysResponse::ListKeysResponse{Keys, NextMarker, Truncated, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListKeysResponse.ListKeysResponse(")?;
                                            DafnyPrint::fmt_print(Keys, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextMarker, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Truncated, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListKeysResponse {}

                            impl Hash
                                for ListKeysResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListKeysResponse::ListKeysResponse{Keys, NextMarker, Truncated, } => {
                                            Hash::hash(Keys, _state);
                                            Hash::hash(NextMarker, _state);
                                            Hash::hash(Truncated, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListKeysResponse {
                                fn default() -> ListKeysResponse {
                                    ListKeysResponse::ListKeysResponse {
                                        Keys: Default::default(),
                                        NextMarker: Default::default(),
                                        Truncated: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListKeysResponse>
                                for ListKeysResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(607,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListResourceTagsRequest {
                                ListResourceTagsRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    Limit: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>>,
                                    Marker: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl ListResourceTagsRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ListResourceTagsRequest::ListResourceTagsRequest{KeyId, Limit, Marker, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Limit
                                pub fn Limit(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::LimitType>> {
                                    match self {
                                        ListResourceTagsRequest::ListResourceTagsRequest{KeyId, Limit, Marker, } => Limit,
                                    }
                                }
                                /// Returns a borrow of the field Marker
                                pub fn Marker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListResourceTagsRequest::ListResourceTagsRequest{KeyId, Limit, Marker, } => Marker,
                                    }
                                }
                            }

                            impl Debug
                                for ListResourceTagsRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListResourceTagsRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListResourceTagsRequest::ListResourceTagsRequest{KeyId, Limit, Marker, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListResourceTagsRequest.ListResourceTagsRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Limit, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Marker, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListResourceTagsRequest {}

                            impl Hash
                                for ListResourceTagsRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListResourceTagsRequest::ListResourceTagsRequest{KeyId, Limit, Marker, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Limit, _state);
                                            Hash::hash(Marker, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListResourceTagsRequest {
                                fn default() -> ListResourceTagsRequest {
                                    ListResourceTagsRequest::ListResourceTagsRequest {
                                        KeyId: Default::default(),
                                        Limit: Default::default(),
                                        Marker: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListResourceTagsRequest>
                                for ListResourceTagsRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(612,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ListResourceTagsResponse {
                                ListResourceTagsResponse {
                                    Tags: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Tag>>>>,
                                    NextMarker: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Truncated: Arc<Option<bool>>
                                }
                            }

                            impl ListResourceTagsResponse {
                                /// Returns a borrow of the field Tags
                                pub fn Tags(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Tag>>>> {
                                    match self {
                                        ListResourceTagsResponse::ListResourceTagsResponse{Tags, NextMarker, Truncated, } => Tags,
                                    }
                                }
                                /// Returns a borrow of the field NextMarker
                                pub fn NextMarker(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ListResourceTagsResponse::ListResourceTagsResponse{Tags, NextMarker, Truncated, } => NextMarker,
                                    }
                                }
                                /// Returns a borrow of the field Truncated
                                pub fn Truncated(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ListResourceTagsResponse::ListResourceTagsResponse{Tags, NextMarker, Truncated, } => Truncated,
                                    }
                                }
                            }

                            impl Debug
                                for ListResourceTagsResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ListResourceTagsResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ListResourceTagsResponse::ListResourceTagsResponse{Tags, NextMarker, Truncated, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ListResourceTagsResponse.ListResourceTagsResponse(")?;
                                            DafnyPrint::fmt_print(Tags, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NextMarker, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Truncated, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ListResourceTagsResponse {}

                            impl Hash
                                for ListResourceTagsResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ListResourceTagsResponse::ListResourceTagsResponse{Tags, NextMarker, Truncated, } => {
                                            Hash::hash(Tags, _state);
                                            Hash::hash(NextMarker, _state);
                                            Hash::hash(Truncated, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ListResourceTagsResponse {
                                fn default() -> ListResourceTagsResponse {
                                    ListResourceTagsResponse::ListResourceTagsResponse {
                                        Tags: Default::default(),
                                        NextMarker: Default::default(),
                                        Truncated: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ListResourceTagsResponse>
                                for ListResourceTagsResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(617,3)
                            #[derive(PartialEq, Clone)]
                            pub enum MacAlgorithmSpec {
                                HMAC_SHA_224 {},
                                HMAC_SHA_256 {},
                                HMAC_SHA_384 {},
                                HMAC_SHA_512 {}
                            }

                            impl MacAlgorithmSpec {}

                            impl Debug
                                for MacAlgorithmSpec {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for MacAlgorithmSpec {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        MacAlgorithmSpec::HMAC_SHA_224{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.MacAlgorithmSpec.HMAC__SHA__224")?;
                                            Ok(())
                                        },
                                        MacAlgorithmSpec::HMAC_SHA_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.MacAlgorithmSpec.HMAC__SHA__256")?;
                                            Ok(())
                                        },
                                        MacAlgorithmSpec::HMAC_SHA_384{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.MacAlgorithmSpec.HMAC__SHA__384")?;
                                            Ok(())
                                        },
                                        MacAlgorithmSpec::HMAC_SHA_512{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.MacAlgorithmSpec.HMAC__SHA__512")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl MacAlgorithmSpec {
                                /// Enumerates all possible values of MacAlgorithmSpec
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<MacAlgorithmSpec>> {
                                    seq![Arc::new(MacAlgorithmSpec::HMAC_SHA_224 {}), Arc::new(MacAlgorithmSpec::HMAC_SHA_256 {}), Arc::new(MacAlgorithmSpec::HMAC_SHA_384 {}), Arc::new(MacAlgorithmSpec::HMAC_SHA_512 {})].iter()
                                }
                            }

                            impl Eq
                                for MacAlgorithmSpec {}

                            impl Hash
                                for MacAlgorithmSpec {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        MacAlgorithmSpec::HMAC_SHA_224{} => {

                                        },
                                        MacAlgorithmSpec::HMAC_SHA_256{} => {

                                        },
                                        MacAlgorithmSpec::HMAC_SHA_384{} => {

                                        },
                                        MacAlgorithmSpec::HMAC_SHA_512{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for MacAlgorithmSpec {
                                fn default() -> MacAlgorithmSpec {
                                    MacAlgorithmSpec::HMAC_SHA_224 {}
                                }
                            }

                            impl AsRef<MacAlgorithmSpec>
                                for MacAlgorithmSpec {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(623,3)
                            pub type MarkerType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(627,3)
                            #[derive(PartialEq, Clone)]
                            pub enum MessageType {
                                RAW {},
                                DIGEST {}
                            }

                            impl MessageType {}

                            impl Debug
                                for MessageType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for MessageType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        MessageType::RAW{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.MessageType.RAW")?;
                                            Ok(())
                                        },
                                        MessageType::DIGEST{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.MessageType.DIGEST")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl MessageType {
                                /// Enumerates all possible values of MessageType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<MessageType>> {
                                    seq![Arc::new(MessageType::RAW {}), Arc::new(MessageType::DIGEST {})].iter()
                                }
                            }

                            impl Eq
                                for MessageType {}

                            impl Hash
                                for MessageType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        MessageType::RAW{} => {

                                        },
                                        MessageType::DIGEST{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for MessageType {
                                fn default() -> MessageType {
                                    MessageType::RAW {}
                                }
                            }

                            impl AsRef<MessageType>
                                for MessageType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(630,3)
                            #[derive(PartialEq, Clone)]
                            pub enum MultiRegionConfiguration {
                                MultiRegionConfiguration {
                                    MultiRegionKeyType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MultiRegionKeyType>>>,
                                    PrimaryKey: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MultiRegionKey>>>,
                                    ReplicaKeys: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MultiRegionKey>>>>
                                }
                            }

                            impl MultiRegionConfiguration {
                                /// Returns a borrow of the field MultiRegionKeyType
                                pub fn MultiRegionKeyType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MultiRegionKeyType>>> {
                                    match self {
                                        MultiRegionConfiguration::MultiRegionConfiguration{MultiRegionKeyType, PrimaryKey, ReplicaKeys, } => MultiRegionKeyType,
                                    }
                                }
                                /// Returns a borrow of the field PrimaryKey
                                pub fn PrimaryKey(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MultiRegionKey>>> {
                                    match self {
                                        MultiRegionConfiguration::MultiRegionConfiguration{MultiRegionKeyType, PrimaryKey, ReplicaKeys, } => PrimaryKey,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaKeys
                                pub fn ReplicaKeys(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MultiRegionKey>>>> {
                                    match self {
                                        MultiRegionConfiguration::MultiRegionConfiguration{MultiRegionKeyType, PrimaryKey, ReplicaKeys, } => ReplicaKeys,
                                    }
                                }
                            }

                            impl Debug
                                for MultiRegionConfiguration {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for MultiRegionConfiguration {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        MultiRegionConfiguration::MultiRegionConfiguration{MultiRegionKeyType, PrimaryKey, ReplicaKeys, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionConfiguration.MultiRegionConfiguration(")?;
                                            DafnyPrint::fmt_print(MultiRegionKeyType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PrimaryKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaKeys, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for MultiRegionConfiguration {}

                            impl Hash
                                for MultiRegionConfiguration {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        MultiRegionConfiguration::MultiRegionConfiguration{MultiRegionKeyType, PrimaryKey, ReplicaKeys, } => {
                                            Hash::hash(MultiRegionKeyType, _state);
                                            Hash::hash(PrimaryKey, _state);
                                            Hash::hash(ReplicaKeys, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for MultiRegionConfiguration {
                                fn default() -> MultiRegionConfiguration {
                                    MultiRegionConfiguration::MultiRegionConfiguration {
                                        MultiRegionKeyType: Default::default(),
                                        PrimaryKey: Default::default(),
                                        ReplicaKeys: Default::default()
                                    }
                                }
                            }

                            impl AsRef<MultiRegionConfiguration>
                                for MultiRegionConfiguration {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(635,3)
                            #[derive(PartialEq, Clone)]
                            pub enum MultiRegionKey {
                                MultiRegionKey {
                                    Arn: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Region: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl MultiRegionKey {
                                /// Returns a borrow of the field Arn
                                pub fn Arn(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        MultiRegionKey::MultiRegionKey{Arn, Region, } => Arn,
                                    }
                                }
                                /// Returns a borrow of the field Region
                                pub fn Region(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        MultiRegionKey::MultiRegionKey{Arn, Region, } => Region,
                                    }
                                }
                            }

                            impl Debug
                                for MultiRegionKey {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for MultiRegionKey {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        MultiRegionKey::MultiRegionKey{Arn, Region, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionKey.MultiRegionKey(")?;
                                            DafnyPrint::fmt_print(Arn, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Region, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for MultiRegionKey {}

                            impl Hash
                                for MultiRegionKey {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        MultiRegionKey::MultiRegionKey{Arn, Region, } => {
                                            Hash::hash(Arn, _state);
                                            Hash::hash(Region, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for MultiRegionKey {
                                fn default() -> MultiRegionKey {
                                    MultiRegionKey::MultiRegionKey {
                                        Arn: Default::default(),
                                        Region: Default::default()
                                    }
                                }
                            }

                            impl AsRef<MultiRegionKey>
                                for MultiRegionKey {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(640,3)
                            #[derive(PartialEq, Clone)]
                            pub enum MultiRegionKeyType {
                                PRIMARY {},
                                REPLICA {}
                            }

                            impl MultiRegionKeyType {}

                            impl Debug
                                for MultiRegionKeyType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for MultiRegionKeyType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        MultiRegionKeyType::PRIMARY{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionKeyType.PRIMARY")?;
                                            Ok(())
                                        },
                                        MultiRegionKeyType::REPLICA{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionKeyType.REPLICA")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl MultiRegionKeyType {
                                /// Enumerates all possible values of MultiRegionKeyType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<MultiRegionKeyType>> {
                                    seq![Arc::new(MultiRegionKeyType::PRIMARY {}), Arc::new(MultiRegionKeyType::REPLICA {})].iter()
                                }
                            }

                            impl Eq
                                for MultiRegionKeyType {}

                            impl Hash
                                for MultiRegionKeyType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        MultiRegionKeyType::PRIMARY{} => {

                                        },
                                        MultiRegionKeyType::REPLICA{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for MultiRegionKeyType {
                                fn default() -> MultiRegionKeyType {
                                    MultiRegionKeyType::PRIMARY {}
                                }
                            }

                            impl AsRef<MultiRegionKeyType>
                                for MultiRegionKeyType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(644,3)
                            pub type NumberOfBytesType = i32;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(648,3)
                            #[derive(PartialEq, Clone)]
                            pub enum OriginType {
                                AWS_KMS {},
                                EXTERNAL {},
                                AWS_CLOUDHSM {},
                                EXTERNAL_KEY_STORE {}
                            }

                            impl OriginType {}

                            impl Debug
                                for OriginType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for OriginType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        OriginType::AWS_KMS{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.OriginType.AWS__KMS")?;
                                            Ok(())
                                        },
                                        OriginType::EXTERNAL{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.OriginType.EXTERNAL")?;
                                            Ok(())
                                        },
                                        OriginType::AWS_CLOUDHSM{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.OriginType.AWS__CLOUDHSM")?;
                                            Ok(())
                                        },
                                        OriginType::EXTERNAL_KEY_STORE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.OriginType.EXTERNAL__KEY__STORE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl OriginType {
                                /// Enumerates all possible values of OriginType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<OriginType>> {
                                    seq![Arc::new(OriginType::AWS_KMS {}), Arc::new(OriginType::EXTERNAL {}), Arc::new(OriginType::AWS_CLOUDHSM {}), Arc::new(OriginType::EXTERNAL_KEY_STORE {})].iter()
                                }
                            }

                            impl Eq
                                for OriginType {}

                            impl Hash
                                for OriginType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        OriginType::AWS_KMS{} => {

                                        },
                                        OriginType::EXTERNAL{} => {

                                        },
                                        OriginType::AWS_CLOUDHSM{} => {

                                        },
                                        OriginType::EXTERNAL_KEY_STORE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for OriginType {
                                fn default() -> OriginType {
                                    OriginType::AWS_KMS {}
                                }
                            }

                            impl AsRef<OriginType>
                                for OriginType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(653,3)
                            pub type PendingWindowInDaysType = i32;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(657,3)
                            pub type PlaintextType = Sequence<u8>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(662,3)
                            pub type PolicyNameType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(666,3)
                            pub type PolicyType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(670,3)
                            pub type PrincipalIdType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(674,3)
                            pub type PublicKeyType = Sequence<u8>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(678,3)
                            #[derive(PartialEq, Clone)]
                            pub enum PutKeyPolicyRequest {
                                PutKeyPolicyRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    PolicyName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Policy: Sequence<DafnyCharUTF16>,
                                    BypassPolicyLockoutSafetyCheck: Arc<Option<bool>>
                                }
                            }

                            impl PutKeyPolicyRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        PutKeyPolicyRequest::PutKeyPolicyRequest{KeyId, PolicyName, Policy, BypassPolicyLockoutSafetyCheck, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field PolicyName
                                pub fn PolicyName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        PutKeyPolicyRequest::PutKeyPolicyRequest{KeyId, PolicyName, Policy, BypassPolicyLockoutSafetyCheck, } => PolicyName,
                                    }
                                }
                                /// Returns a borrow of the field Policy
                                pub fn Policy(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        PutKeyPolicyRequest::PutKeyPolicyRequest{KeyId, PolicyName, Policy, BypassPolicyLockoutSafetyCheck, } => Policy,
                                    }
                                }
                                /// Returns a borrow of the field BypassPolicyLockoutSafetyCheck
                                pub fn BypassPolicyLockoutSafetyCheck(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        PutKeyPolicyRequest::PutKeyPolicyRequest{KeyId, PolicyName, Policy, BypassPolicyLockoutSafetyCheck, } => BypassPolicyLockoutSafetyCheck,
                                    }
                                }
                            }

                            impl Debug
                                for PutKeyPolicyRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for PutKeyPolicyRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        PutKeyPolicyRequest::PutKeyPolicyRequest{KeyId, PolicyName, Policy, BypassPolicyLockoutSafetyCheck, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.PutKeyPolicyRequest.PutKeyPolicyRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PolicyName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Policy, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BypassPolicyLockoutSafetyCheck, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for PutKeyPolicyRequest {}

                            impl Hash
                                for PutKeyPolicyRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        PutKeyPolicyRequest::PutKeyPolicyRequest{KeyId, PolicyName, Policy, BypassPolicyLockoutSafetyCheck, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(PolicyName, _state);
                                            Hash::hash(Policy, _state);
                                            Hash::hash(BypassPolicyLockoutSafetyCheck, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for PutKeyPolicyRequest {
                                fn default() -> PutKeyPolicyRequest {
                                    PutKeyPolicyRequest::PutKeyPolicyRequest {
                                        KeyId: Default::default(),
                                        PolicyName: Default::default(),
                                        Policy: Default::default(),
                                        BypassPolicyLockoutSafetyCheck: Default::default()
                                    }
                                }
                            }

                            impl AsRef<PutKeyPolicyRequest>
                                for PutKeyPolicyRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(684,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RecipientInfo {
                                RecipientInfo {
                                    KeyEncryptionAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyEncryptionMechanism>>>,
                                    AttestationDocument: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::AttestationDocumentType>>
                                }
                            }

                            impl RecipientInfo {
                                /// Returns a borrow of the field KeyEncryptionAlgorithm
                                pub fn KeyEncryptionAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyEncryptionMechanism>>> {
                                    match self {
                                        RecipientInfo::RecipientInfo{KeyEncryptionAlgorithm, AttestationDocument, } => KeyEncryptionAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field AttestationDocument
                                pub fn AttestationDocument(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::AttestationDocumentType>> {
                                    match self {
                                        RecipientInfo::RecipientInfo{KeyEncryptionAlgorithm, AttestationDocument, } => AttestationDocument,
                                    }
                                }
                            }

                            impl Debug
                                for RecipientInfo {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RecipientInfo {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RecipientInfo::RecipientInfo{KeyEncryptionAlgorithm, AttestationDocument, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.RecipientInfo.RecipientInfo(")?;
                                            DafnyPrint::fmt_print(KeyEncryptionAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AttestationDocument, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RecipientInfo {}

                            impl Hash
                                for RecipientInfo {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RecipientInfo::RecipientInfo{KeyEncryptionAlgorithm, AttestationDocument, } => {
                                            Hash::hash(KeyEncryptionAlgorithm, _state);
                                            Hash::hash(AttestationDocument, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RecipientInfo {
                                fn default() -> RecipientInfo {
                                    RecipientInfo::RecipientInfo {
                                        KeyEncryptionAlgorithm: Default::default(),
                                        AttestationDocument: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RecipientInfo>
                                for RecipientInfo {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(688,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReEncryptRequest {
                                ReEncryptRequest {
                                    CiphertextBlob: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType,
                                    SourceEncryptionContext: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    SourceKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    DestinationKeyId: Sequence<DafnyCharUTF16>,
                                    DestinationEncryptionContext: Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>>,
                                    SourceEncryptionAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>,
                                    DestinationEncryptionAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl ReEncryptRequest {
                                /// Returns a borrow of the field CiphertextBlob
                                pub fn CiphertextBlob(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => CiphertextBlob,
                                    }
                                }
                                /// Returns a borrow of the field SourceEncryptionContext
                                pub fn SourceEncryptionContext(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => SourceEncryptionContext,
                                    }
                                }
                                /// Returns a borrow of the field SourceKeyId
                                pub fn SourceKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => SourceKeyId,
                                    }
                                }
                                /// Returns a borrow of the field DestinationKeyId
                                pub fn DestinationKeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => DestinationKeyId,
                                    }
                                }
                                /// Returns a borrow of the field DestinationEncryptionContext
                                pub fn DestinationEncryptionContext(&self) -> &Arc<Option<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>> {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => DestinationEncryptionContext,
                                    }
                                }
                                /// Returns a borrow of the field SourceEncryptionAlgorithm
                                pub fn SourceEncryptionAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>> {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => SourceEncryptionAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field DestinationEncryptionAlgorithm
                                pub fn DestinationEncryptionAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>> {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => DestinationEncryptionAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for ReEncryptRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReEncryptRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ReEncryptRequest.ReEncryptRequest(")?;
                                            DafnyPrint::fmt_print(CiphertextBlob, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SourceEncryptionContext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SourceKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DestinationKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DestinationEncryptionContext, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SourceEncryptionAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DestinationEncryptionAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReEncryptRequest {}

                            impl Hash
                                for ReEncryptRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReEncryptRequest::ReEncryptRequest{CiphertextBlob, SourceEncryptionContext, SourceKeyId, DestinationKeyId, DestinationEncryptionContext, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, GrantTokens, DryRun, } => {
                                            Hash::hash(CiphertextBlob, _state);
                                            Hash::hash(SourceEncryptionContext, _state);
                                            Hash::hash(SourceKeyId, _state);
                                            Hash::hash(DestinationKeyId, _state);
                                            Hash::hash(DestinationEncryptionContext, _state);
                                            Hash::hash(SourceEncryptionAlgorithm, _state);
                                            Hash::hash(DestinationEncryptionAlgorithm, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReEncryptRequest {
                                fn default() -> ReEncryptRequest {
                                    ReEncryptRequest::ReEncryptRequest {
                                        CiphertextBlob: Default::default(),
                                        SourceEncryptionContext: Default::default(),
                                        SourceKeyId: Default::default(),
                                        DestinationKeyId: Default::default(),
                                        DestinationEncryptionContext: Default::default(),
                                        SourceEncryptionAlgorithm: Default::default(),
                                        DestinationEncryptionAlgorithm: Default::default(),
                                        GrantTokens: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReEncryptRequest>
                                for ReEncryptRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(699,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReEncryptResponse {
                                ReEncryptResponse {
                                    CiphertextBlob: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>,
                                    SourceKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    SourceEncryptionAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>,
                                    DestinationEncryptionAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>>
                                }
                            }

                            impl ReEncryptResponse {
                                /// Returns a borrow of the field CiphertextBlob
                                pub fn CiphertextBlob(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        ReEncryptResponse::ReEncryptResponse{CiphertextBlob, SourceKeyId, KeyId, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, } => CiphertextBlob,
                                    }
                                }
                                /// Returns a borrow of the field SourceKeyId
                                pub fn SourceKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReEncryptResponse::ReEncryptResponse{CiphertextBlob, SourceKeyId, KeyId, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, } => SourceKeyId,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReEncryptResponse::ReEncryptResponse{CiphertextBlob, SourceKeyId, KeyId, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field SourceEncryptionAlgorithm
                                pub fn SourceEncryptionAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>> {
                                    match self {
                                        ReEncryptResponse::ReEncryptResponse{CiphertextBlob, SourceKeyId, KeyId, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, } => SourceEncryptionAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field DestinationEncryptionAlgorithm
                                pub fn DestinationEncryptionAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec>>> {
                                    match self {
                                        ReEncryptResponse::ReEncryptResponse{CiphertextBlob, SourceKeyId, KeyId, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, } => DestinationEncryptionAlgorithm,
                                    }
                                }
                            }

                            impl Debug
                                for ReEncryptResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReEncryptResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReEncryptResponse::ReEncryptResponse{CiphertextBlob, SourceKeyId, KeyId, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ReEncryptResponse.ReEncryptResponse(")?;
                                            DafnyPrint::fmt_print(CiphertextBlob, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SourceKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SourceEncryptionAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DestinationEncryptionAlgorithm, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReEncryptResponse {}

                            impl Hash
                                for ReEncryptResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReEncryptResponse::ReEncryptResponse{CiphertextBlob, SourceKeyId, KeyId, SourceEncryptionAlgorithm, DestinationEncryptionAlgorithm, } => {
                                            Hash::hash(CiphertextBlob, _state);
                                            Hash::hash(SourceKeyId, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(SourceEncryptionAlgorithm, _state);
                                            Hash::hash(DestinationEncryptionAlgorithm, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReEncryptResponse {
                                fn default() -> ReEncryptResponse {
                                    ReEncryptResponse::ReEncryptResponse {
                                        CiphertextBlob: Default::default(),
                                        SourceKeyId: Default::default(),
                                        KeyId: Default::default(),
                                        SourceEncryptionAlgorithm: Default::default(),
                                        DestinationEncryptionAlgorithm: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReEncryptResponse>
                                for ReEncryptResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(706,3)
                            pub type RegionType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(710,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicateKeyRequest {
                                ReplicateKeyRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    ReplicaRegion: Sequence<DafnyCharUTF16>,
                                    Policy: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    BypassPolicyLockoutSafetyCheck: Arc<Option<bool>>,
                                    Description: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Tags: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Tag>>>>
                                }
                            }

                            impl ReplicateKeyRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ReplicateKeyRequest::ReplicateKeyRequest{KeyId, ReplicaRegion, Policy, BypassPolicyLockoutSafetyCheck, Description, Tags, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaRegion
                                pub fn ReplicaRegion(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ReplicateKeyRequest::ReplicateKeyRequest{KeyId, ReplicaRegion, Policy, BypassPolicyLockoutSafetyCheck, Description, Tags, } => ReplicaRegion,
                                    }
                                }
                                /// Returns a borrow of the field Policy
                                pub fn Policy(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicateKeyRequest::ReplicateKeyRequest{KeyId, ReplicaRegion, Policy, BypassPolicyLockoutSafetyCheck, Description, Tags, } => Policy,
                                    }
                                }
                                /// Returns a borrow of the field BypassPolicyLockoutSafetyCheck
                                pub fn BypassPolicyLockoutSafetyCheck(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        ReplicateKeyRequest::ReplicateKeyRequest{KeyId, ReplicaRegion, Policy, BypassPolicyLockoutSafetyCheck, Description, Tags, } => BypassPolicyLockoutSafetyCheck,
                                    }
                                }
                                /// Returns a borrow of the field Description
                                pub fn Description(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicateKeyRequest::ReplicateKeyRequest{KeyId, ReplicaRegion, Policy, BypassPolicyLockoutSafetyCheck, Description, Tags, } => Description,
                                    }
                                }
                                /// Returns a borrow of the field Tags
                                pub fn Tags(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Tag>>>> {
                                    match self {
                                        ReplicateKeyRequest::ReplicateKeyRequest{KeyId, ReplicaRegion, Policy, BypassPolicyLockoutSafetyCheck, Description, Tags, } => Tags,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicateKeyRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicateKeyRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicateKeyRequest::ReplicateKeyRequest{KeyId, ReplicaRegion, Policy, BypassPolicyLockoutSafetyCheck, Description, Tags, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ReplicateKeyRequest.ReplicateKeyRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaRegion, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Policy, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(BypassPolicyLockoutSafetyCheck, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Description, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Tags, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicateKeyRequest {}

                            impl Hash
                                for ReplicateKeyRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicateKeyRequest::ReplicateKeyRequest{KeyId, ReplicaRegion, Policy, BypassPolicyLockoutSafetyCheck, Description, Tags, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(ReplicaRegion, _state);
                                            Hash::hash(Policy, _state);
                                            Hash::hash(BypassPolicyLockoutSafetyCheck, _state);
                                            Hash::hash(Description, _state);
                                            Hash::hash(Tags, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicateKeyRequest {
                                fn default() -> ReplicateKeyRequest {
                                    ReplicateKeyRequest::ReplicateKeyRequest {
                                        KeyId: Default::default(),
                                        ReplicaRegion: Default::default(),
                                        Policy: Default::default(),
                                        BypassPolicyLockoutSafetyCheck: Default::default(),
                                        Description: Default::default(),
                                        Tags: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicateKeyRequest>
                                for ReplicateKeyRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(718,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ReplicateKeyResponse {
                                ReplicateKeyResponse {
                                    ReplicaKeyMetadata: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyMetadata>>>,
                                    ReplicaPolicy: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    ReplicaTags: Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Tag>>>>
                                }
                            }

                            impl ReplicateKeyResponse {
                                /// Returns a borrow of the field ReplicaKeyMetadata
                                pub fn ReplicaKeyMetadata(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyMetadata>>> {
                                    match self {
                                        ReplicateKeyResponse::ReplicateKeyResponse{ReplicaKeyMetadata, ReplicaPolicy, ReplicaTags, } => ReplicaKeyMetadata,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaPolicy
                                pub fn ReplicaPolicy(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ReplicateKeyResponse::ReplicateKeyResponse{ReplicaKeyMetadata, ReplicaPolicy, ReplicaTags, } => ReplicaPolicy,
                                    }
                                }
                                /// Returns a borrow of the field ReplicaTags
                                pub fn ReplicaTags(&self) -> &Arc<Option<Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Tag>>>> {
                                    match self {
                                        ReplicateKeyResponse::ReplicateKeyResponse{ReplicaKeyMetadata, ReplicaPolicy, ReplicaTags, } => ReplicaTags,
                                    }
                                }
                            }

                            impl Debug
                                for ReplicateKeyResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ReplicateKeyResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ReplicateKeyResponse::ReplicateKeyResponse{ReplicaKeyMetadata, ReplicaPolicy, ReplicaTags, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ReplicateKeyResponse.ReplicateKeyResponse(")?;
                                            DafnyPrint::fmt_print(ReplicaKeyMetadata, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaPolicy, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(ReplicaTags, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ReplicateKeyResponse {}

                            impl Hash
                                for ReplicateKeyResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ReplicateKeyResponse::ReplicateKeyResponse{ReplicaKeyMetadata, ReplicaPolicy, ReplicaTags, } => {
                                            Hash::hash(ReplicaKeyMetadata, _state);
                                            Hash::hash(ReplicaPolicy, _state);
                                            Hash::hash(ReplicaTags, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ReplicateKeyResponse {
                                fn default() -> ReplicateKeyResponse {
                                    ReplicateKeyResponse::ReplicateKeyResponse {
                                        ReplicaKeyMetadata: Default::default(),
                                        ReplicaPolicy: Default::default(),
                                        ReplicaTags: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ReplicateKeyResponse>
                                for ReplicateKeyResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(723,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RetireGrantRequest {
                                RetireGrantRequest {
                                    GrantToken: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    GrantId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl RetireGrantRequest {
                                /// Returns a borrow of the field GrantToken
                                pub fn GrantToken(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RetireGrantRequest::RetireGrantRequest{GrantToken, KeyId, GrantId, DryRun, } => GrantToken,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RetireGrantRequest::RetireGrantRequest{GrantToken, KeyId, GrantId, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field GrantId
                                pub fn GrantId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RetireGrantRequest::RetireGrantRequest{GrantToken, KeyId, GrantId, DryRun, } => GrantId,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        RetireGrantRequest::RetireGrantRequest{GrantToken, KeyId, GrantId, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for RetireGrantRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RetireGrantRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RetireGrantRequest::RetireGrantRequest{GrantToken, KeyId, GrantId, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.RetireGrantRequest.RetireGrantRequest(")?;
                                            DafnyPrint::fmt_print(GrantToken, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RetireGrantRequest {}

                            impl Hash
                                for RetireGrantRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RetireGrantRequest::RetireGrantRequest{GrantToken, KeyId, GrantId, DryRun, } => {
                                            Hash::hash(GrantToken, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(GrantId, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RetireGrantRequest {
                                fn default() -> RetireGrantRequest {
                                    RetireGrantRequest::RetireGrantRequest {
                                        GrantToken: Default::default(),
                                        KeyId: Default::default(),
                                        GrantId: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RetireGrantRequest>
                                for RetireGrantRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(729,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RevokeGrantRequest {
                                RevokeGrantRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    GrantId: Sequence<DafnyCharUTF16>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl RevokeGrantRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        RevokeGrantRequest::RevokeGrantRequest{KeyId, GrantId, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field GrantId
                                pub fn GrantId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        RevokeGrantRequest::RevokeGrantRequest{KeyId, GrantId, DryRun, } => GrantId,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        RevokeGrantRequest::RevokeGrantRequest{KeyId, GrantId, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for RevokeGrantRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RevokeGrantRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RevokeGrantRequest::RevokeGrantRequest{KeyId, GrantId, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.RevokeGrantRequest.RevokeGrantRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RevokeGrantRequest {}

                            impl Hash
                                for RevokeGrantRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RevokeGrantRequest::RevokeGrantRequest{KeyId, GrantId, DryRun, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(GrantId, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RevokeGrantRequest {
                                fn default() -> RevokeGrantRequest {
                                    RevokeGrantRequest::RevokeGrantRequest {
                                        KeyId: Default::default(),
                                        GrantId: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RevokeGrantRequest>
                                for RevokeGrantRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(734,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RotateKeyOnDemandRequest {
                                RotateKeyOnDemandRequest {
                                    KeyId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl RotateKeyOnDemandRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        RotateKeyOnDemandRequest::RotateKeyOnDemandRequest{KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for RotateKeyOnDemandRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RotateKeyOnDemandRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RotateKeyOnDemandRequest::RotateKeyOnDemandRequest{KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.RotateKeyOnDemandRequest.RotateKeyOnDemandRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RotateKeyOnDemandRequest {}

                            impl Hash
                                for RotateKeyOnDemandRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RotateKeyOnDemandRequest::RotateKeyOnDemandRequest{KeyId, } => {
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RotateKeyOnDemandRequest {
                                fn default() -> RotateKeyOnDemandRequest {
                                    RotateKeyOnDemandRequest::RotateKeyOnDemandRequest {
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RotateKeyOnDemandRequest>
                                for RotateKeyOnDemandRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(737,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RotateKeyOnDemandResponse {
                                RotateKeyOnDemandResponse {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl RotateKeyOnDemandResponse {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RotateKeyOnDemandResponse::RotateKeyOnDemandResponse{KeyId, } => KeyId,
                                    }
                                }
                            }

                            impl Debug
                                for RotateKeyOnDemandResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RotateKeyOnDemandResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RotateKeyOnDemandResponse::RotateKeyOnDemandResponse{KeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.RotateKeyOnDemandResponse.RotateKeyOnDemandResponse(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RotateKeyOnDemandResponse {}

                            impl Hash
                                for RotateKeyOnDemandResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RotateKeyOnDemandResponse::RotateKeyOnDemandResponse{KeyId, } => {
                                            Hash::hash(KeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RotateKeyOnDemandResponse {
                                fn default() -> RotateKeyOnDemandResponse {
                                    RotateKeyOnDemandResponse::RotateKeyOnDemandResponse {
                                        KeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RotateKeyOnDemandResponse>
                                for RotateKeyOnDemandResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(740,3)
                            pub type RotationPeriodInDaysType = i32;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(745,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RotationsListEntry {
                                RotationsListEntry {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    RotationDate: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    RotationType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RotationType>>>
                                }
                            }

                            impl RotationsListEntry {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RotationsListEntry::RotationsListEntry{KeyId, RotationDate, RotationType, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field RotationDate
                                pub fn RotationDate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        RotationsListEntry::RotationsListEntry{KeyId, RotationDate, RotationType, } => RotationDate,
                                    }
                                }
                                /// Returns a borrow of the field RotationType
                                pub fn RotationType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RotationType>>> {
                                    match self {
                                        RotationsListEntry::RotationsListEntry{KeyId, RotationDate, RotationType, } => RotationType,
                                    }
                                }
                            }

                            impl Debug
                                for RotationsListEntry {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RotationsListEntry {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RotationsListEntry::RotationsListEntry{KeyId, RotationDate, RotationType, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.RotationsListEntry.RotationsListEntry(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RotationDate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RotationType, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for RotationsListEntry {}

                            impl Hash
                                for RotationsListEntry {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RotationsListEntry::RotationsListEntry{KeyId, RotationDate, RotationType, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(RotationDate, _state);
                                            Hash::hash(RotationType, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for RotationsListEntry {
                                fn default() -> RotationsListEntry {
                                    RotationsListEntry::RotationsListEntry {
                                        KeyId: Default::default(),
                                        RotationDate: Default::default(),
                                        RotationType: Default::default()
                                    }
                                }
                            }

                            impl AsRef<RotationsListEntry>
                                for RotationsListEntry {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(750,3)
                            #[derive(PartialEq, Clone)]
                            pub enum RotationType {
                                AUTOMATIC {},
                                ON_DEMAND {}
                            }

                            impl RotationType {}

                            impl Debug
                                for RotationType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for RotationType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        RotationType::AUTOMATIC{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.RotationType.AUTOMATIC")?;
                                            Ok(())
                                        },
                                        RotationType::ON_DEMAND{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.RotationType.ON__DEMAND")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl RotationType {
                                /// Enumerates all possible values of RotationType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<RotationType>> {
                                    seq![Arc::new(RotationType::AUTOMATIC {}), Arc::new(RotationType::ON_DEMAND {})].iter()
                                }
                            }

                            impl Eq
                                for RotationType {}

                            impl Hash
                                for RotationType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        RotationType::AUTOMATIC{} => {

                                        },
                                        RotationType::ON_DEMAND{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for RotationType {
                                fn default() -> RotationType {
                                    RotationType::AUTOMATIC {}
                                }
                            }

                            impl AsRef<RotationType>
                                for RotationType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(753,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ScheduleKeyDeletionRequest {
                                ScheduleKeyDeletionRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    PendingWindowInDays: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PendingWindowInDaysType>>
                                }
                            }

                            impl ScheduleKeyDeletionRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        ScheduleKeyDeletionRequest::ScheduleKeyDeletionRequest{KeyId, PendingWindowInDays, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field PendingWindowInDays
                                pub fn PendingWindowInDays(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PendingWindowInDaysType>> {
                                    match self {
                                        ScheduleKeyDeletionRequest::ScheduleKeyDeletionRequest{KeyId, PendingWindowInDays, } => PendingWindowInDays,
                                    }
                                }
                            }

                            impl Debug
                                for ScheduleKeyDeletionRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ScheduleKeyDeletionRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ScheduleKeyDeletionRequest::ScheduleKeyDeletionRequest{KeyId, PendingWindowInDays, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ScheduleKeyDeletionRequest.ScheduleKeyDeletionRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PendingWindowInDays, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ScheduleKeyDeletionRequest {}

                            impl Hash
                                for ScheduleKeyDeletionRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ScheduleKeyDeletionRequest::ScheduleKeyDeletionRequest{KeyId, PendingWindowInDays, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(PendingWindowInDays, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ScheduleKeyDeletionRequest {
                                fn default() -> ScheduleKeyDeletionRequest {
                                    ScheduleKeyDeletionRequest::ScheduleKeyDeletionRequest {
                                        KeyId: Default::default(),
                                        PendingWindowInDays: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ScheduleKeyDeletionRequest>
                                for ScheduleKeyDeletionRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(757,3)
                            #[derive(PartialEq, Clone)]
                            pub enum ScheduleKeyDeletionResponse {
                                ScheduleKeyDeletionResponse {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    DeletionDate: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyState: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyState>>>,
                                    PendingWindowInDays: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PendingWindowInDaysType>>
                                }
                            }

                            impl ScheduleKeyDeletionResponse {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ScheduleKeyDeletionResponse::ScheduleKeyDeletionResponse{KeyId, DeletionDate, KeyState, PendingWindowInDays, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field DeletionDate
                                pub fn DeletionDate(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        ScheduleKeyDeletionResponse::ScheduleKeyDeletionResponse{KeyId, DeletionDate, KeyState, PendingWindowInDays, } => DeletionDate,
                                    }
                                }
                                /// Returns a borrow of the field KeyState
                                pub fn KeyState(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyState>>> {
                                    match self {
                                        ScheduleKeyDeletionResponse::ScheduleKeyDeletionResponse{KeyId, DeletionDate, KeyState, PendingWindowInDays, } => KeyState,
                                    }
                                }
                                /// Returns a borrow of the field PendingWindowInDays
                                pub fn PendingWindowInDays(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PendingWindowInDaysType>> {
                                    match self {
                                        ScheduleKeyDeletionResponse::ScheduleKeyDeletionResponse{KeyId, DeletionDate, KeyState, PendingWindowInDays, } => PendingWindowInDays,
                                    }
                                }
                            }

                            impl Debug
                                for ScheduleKeyDeletionResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for ScheduleKeyDeletionResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        ScheduleKeyDeletionResponse::ScheduleKeyDeletionResponse{KeyId, DeletionDate, KeyState, PendingWindowInDays, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.ScheduleKeyDeletionResponse.ScheduleKeyDeletionResponse(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DeletionDate, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyState, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PendingWindowInDays, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for ScheduleKeyDeletionResponse {}

                            impl Hash
                                for ScheduleKeyDeletionResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        ScheduleKeyDeletionResponse::ScheduleKeyDeletionResponse{KeyId, DeletionDate, KeyState, PendingWindowInDays, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(DeletionDate, _state);
                                            Hash::hash(KeyState, _state);
                                            Hash::hash(PendingWindowInDays, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for ScheduleKeyDeletionResponse {
                                fn default() -> ScheduleKeyDeletionResponse {
                                    ScheduleKeyDeletionResponse::ScheduleKeyDeletionResponse {
                                        KeyId: Default::default(),
                                        DeletionDate: Default::default(),
                                        KeyState: Default::default(),
                                        PendingWindowInDays: Default::default()
                                    }
                                }
                            }

                            impl AsRef<ScheduleKeyDeletionResponse>
                                for ScheduleKeyDeletionResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(763,3)
                            #[derive(PartialEq, Clone)]
                            pub enum SigningAlgorithmSpec {
                                RSASSA_PSS_SHA_256 {},
                                RSASSA_PSS_SHA_384 {},
                                RSASSA_PSS_SHA_512 {},
                                RSASSA_PKCS1_V1_5_SHA_256 {},
                                RSASSA_PKCS1_V1_5_SHA_384 {},
                                RSASSA_PKCS1_V1_5_SHA_512 {},
                                ECDSA_SHA_256 {},
                                ECDSA_SHA_384 {},
                                ECDSA_SHA_512 {},
                                SM2DSA {}
                            }

                            impl SigningAlgorithmSpec {}

                            impl Debug
                                for SigningAlgorithmSpec {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for SigningAlgorithmSpec {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        SigningAlgorithmSpec::RSASSA_PSS_SHA_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.RSASSA__PSS__SHA__256")?;
                                            Ok(())
                                        },
                                        SigningAlgorithmSpec::RSASSA_PSS_SHA_384{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.RSASSA__PSS__SHA__384")?;
                                            Ok(())
                                        },
                                        SigningAlgorithmSpec::RSASSA_PSS_SHA_512{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.RSASSA__PSS__SHA__512")?;
                                            Ok(())
                                        },
                                        SigningAlgorithmSpec::RSASSA_PKCS1_V1_5_SHA_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.RSASSA__PKCS1__V1__5__SHA__256")?;
                                            Ok(())
                                        },
                                        SigningAlgorithmSpec::RSASSA_PKCS1_V1_5_SHA_384{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.RSASSA__PKCS1__V1__5__SHA__384")?;
                                            Ok(())
                                        },
                                        SigningAlgorithmSpec::RSASSA_PKCS1_V1_5_SHA_512{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.RSASSA__PKCS1__V1__5__SHA__512")?;
                                            Ok(())
                                        },
                                        SigningAlgorithmSpec::ECDSA_SHA_256{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.ECDSA__SHA__256")?;
                                            Ok(())
                                        },
                                        SigningAlgorithmSpec::ECDSA_SHA_384{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.ECDSA__SHA__384")?;
                                            Ok(())
                                        },
                                        SigningAlgorithmSpec::ECDSA_SHA_512{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.ECDSA__SHA__512")?;
                                            Ok(())
                                        },
                                        SigningAlgorithmSpec::SM2DSA{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.SM2DSA")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl SigningAlgorithmSpec {
                                /// Enumerates all possible values of SigningAlgorithmSpec
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<SigningAlgorithmSpec>> {
                                    seq![Arc::new(SigningAlgorithmSpec::RSASSA_PSS_SHA_256 {}), Arc::new(SigningAlgorithmSpec::RSASSA_PSS_SHA_384 {}), Arc::new(SigningAlgorithmSpec::RSASSA_PSS_SHA_512 {}), Arc::new(SigningAlgorithmSpec::RSASSA_PKCS1_V1_5_SHA_256 {}), Arc::new(SigningAlgorithmSpec::RSASSA_PKCS1_V1_5_SHA_384 {}), Arc::new(SigningAlgorithmSpec::RSASSA_PKCS1_V1_5_SHA_512 {}), Arc::new(SigningAlgorithmSpec::ECDSA_SHA_256 {}), Arc::new(SigningAlgorithmSpec::ECDSA_SHA_384 {}), Arc::new(SigningAlgorithmSpec::ECDSA_SHA_512 {}), Arc::new(SigningAlgorithmSpec::SM2DSA {})].iter()
                                }
                            }

                            impl Eq
                                for SigningAlgorithmSpec {}

                            impl Hash
                                for SigningAlgorithmSpec {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        SigningAlgorithmSpec::RSASSA_PSS_SHA_256{} => {

                                        },
                                        SigningAlgorithmSpec::RSASSA_PSS_SHA_384{} => {

                                        },
                                        SigningAlgorithmSpec::RSASSA_PSS_SHA_512{} => {

                                        },
                                        SigningAlgorithmSpec::RSASSA_PKCS1_V1_5_SHA_256{} => {

                                        },
                                        SigningAlgorithmSpec::RSASSA_PKCS1_V1_5_SHA_384{} => {

                                        },
                                        SigningAlgorithmSpec::RSASSA_PKCS1_V1_5_SHA_512{} => {

                                        },
                                        SigningAlgorithmSpec::ECDSA_SHA_256{} => {

                                        },
                                        SigningAlgorithmSpec::ECDSA_SHA_384{} => {

                                        },
                                        SigningAlgorithmSpec::ECDSA_SHA_512{} => {

                                        },
                                        SigningAlgorithmSpec::SM2DSA{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for SigningAlgorithmSpec {
                                fn default() -> SigningAlgorithmSpec {
                                    SigningAlgorithmSpec::RSASSA_PSS_SHA_256 {}
                                }
                            }

                            impl AsRef<SigningAlgorithmSpec>
                                for SigningAlgorithmSpec {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(775,3)
                            #[derive(PartialEq, Clone)]
                            pub enum SignRequest {
                                SignRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    Message: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType,
                                    MessageType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MessageType>>>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    SigningAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl SignRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        SignRequest::SignRequest{KeyId, Message, MessageType, GrantTokens, SigningAlgorithm, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Message
                                pub fn Message(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType {
                                    match self {
                                        SignRequest::SignRequest{KeyId, Message, MessageType, GrantTokens, SigningAlgorithm, DryRun, } => Message,
                                    }
                                }
                                /// Returns a borrow of the field MessageType
                                pub fn MessageType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MessageType>>> {
                                    match self {
                                        SignRequest::SignRequest{KeyId, Message, MessageType, GrantTokens, SigningAlgorithm, DryRun, } => MessageType,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        SignRequest::SignRequest{KeyId, Message, MessageType, GrantTokens, SigningAlgorithm, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field SigningAlgorithm
                                pub fn SigningAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec> {
                                    match self {
                                        SignRequest::SignRequest{KeyId, Message, MessageType, GrantTokens, SigningAlgorithm, DryRun, } => SigningAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        SignRequest::SignRequest{KeyId, Message, MessageType, GrantTokens, SigningAlgorithm, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for SignRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for SignRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        SignRequest::SignRequest{KeyId, Message, MessageType, GrantTokens, SigningAlgorithm, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SignRequest.SignRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Message, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MessageType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SigningAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for SignRequest {}

                            impl Hash
                                for SignRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        SignRequest::SignRequest{KeyId, Message, MessageType, GrantTokens, SigningAlgorithm, DryRun, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Message, _state);
                                            Hash::hash(MessageType, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(SigningAlgorithm, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for SignRequest {
                                fn default() -> SignRequest {
                                    SignRequest::SignRequest {
                                        KeyId: Default::default(),
                                        Message: Default::default(),
                                        MessageType: Default::default(),
                                        GrantTokens: Default::default(),
                                        SigningAlgorithm: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<SignRequest>
                                for SignRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(783,3)
                            #[derive(PartialEq, Clone)]
                            pub enum SignResponse {
                                SignResponse {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    Signature: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>>,
                                    SigningAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec>>>
                                }
                            }

                            impl SignResponse {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        SignResponse::SignResponse{KeyId, Signature, SigningAlgorithm, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Signature
                                pub fn Signature(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType>> {
                                    match self {
                                        SignResponse::SignResponse{KeyId, Signature, SigningAlgorithm, } => Signature,
                                    }
                                }
                                /// Returns a borrow of the field SigningAlgorithm
                                pub fn SigningAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec>>> {
                                    match self {
                                        SignResponse::SignResponse{KeyId, Signature, SigningAlgorithm, } => SigningAlgorithm,
                                    }
                                }
                            }

                            impl Debug
                                for SignResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for SignResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        SignResponse::SignResponse{KeyId, Signature, SigningAlgorithm, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.SignResponse.SignResponse(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Signature, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SigningAlgorithm, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for SignResponse {}

                            impl Hash
                                for SignResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        SignResponse::SignResponse{KeyId, Signature, SigningAlgorithm, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Signature, _state);
                                            Hash::hash(SigningAlgorithm, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for SignResponse {
                                fn default() -> SignResponse {
                                    SignResponse::SignResponse {
                                        KeyId: Default::default(),
                                        Signature: Default::default(),
                                        SigningAlgorithm: Default::default()
                                    }
                                }
                            }

                            impl AsRef<SignResponse>
                                for SignResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(788,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Tag {
                                Tag {
                                    TagKey: Sequence<DafnyCharUTF16>,
                                    TagValue: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl Tag {
                                /// Returns a borrow of the field TagKey
                                pub fn TagKey(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Tag::Tag{TagKey, TagValue, } => TagKey,
                                    }
                                }
                                /// Returns a borrow of the field TagValue
                                pub fn TagValue(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Tag::Tag{TagKey, TagValue, } => TagValue,
                                    }
                                }
                            }

                            impl Debug
                                for Tag {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Tag {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Tag::Tag{TagKey, TagValue, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Tag.Tag(")?;
                                            DafnyPrint::fmt_print(TagKey, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TagValue, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Tag {}

                            impl Hash
                                for Tag {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Tag::Tag{TagKey, TagValue, } => {
                                            Hash::hash(TagKey, _state);
                                            Hash::hash(TagValue, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Tag {
                                fn default() -> Tag {
                                    Tag::Tag {
                                        TagKey: Default::default(),
                                        TagValue: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Tag>
                                for Tag {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(793,3)
                            pub type TagKeyType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(798,3)
                            #[derive(PartialEq, Clone)]
                            pub enum TagResourceRequest {
                                TagResourceRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    Tags: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Tag>>
                                }
                            }

                            impl TagResourceRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        TagResourceRequest::TagResourceRequest{KeyId, Tags, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Tags
                                pub fn Tags(&self) -> &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Tag>> {
                                    match self {
                                        TagResourceRequest::TagResourceRequest{KeyId, Tags, } => Tags,
                                    }
                                }
                            }

                            impl Debug
                                for TagResourceRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for TagResourceRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        TagResourceRequest::TagResourceRequest{KeyId, Tags, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.TagResourceRequest.TagResourceRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Tags, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for TagResourceRequest {}

                            impl Hash
                                for TagResourceRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        TagResourceRequest::TagResourceRequest{KeyId, Tags, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Tags, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for TagResourceRequest {
                                fn default() -> TagResourceRequest {
                                    TagResourceRequest::TagResourceRequest {
                                        KeyId: Default::default(),
                                        Tags: Default::default()
                                    }
                                }
                            }

                            impl AsRef<TagResourceRequest>
                                for TagResourceRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(802,3)
                            pub type TagValueType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(806,3)
                            pub struct IKMSClientCallHistory {}

                            impl IKMSClientCallHistory {
                                /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                                pub fn _allocate_object() -> Object<Self> {
                                    allocate_object::<Self>()
                                }
                            }

                            impl UpcastObject<DynAny>
                                for crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClientCallHistory {
                                UpcastObjectFn!(DynAny);
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(914,3)
                            pub trait IKMSClient: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(943,5)
                                fn CancelKeyDeletion(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CancelKeyDeletionRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CancelKeyDeletionResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(958,5)
                                fn ConnectCustomKeyStore(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ConnectCustomKeyStoreRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ConnectCustomKeyStoreResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(973,5)
                                fn CreateAlias(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CreateAliasRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(988,5)
                                fn CreateCustomKeyStore(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CreateCustomKeyStoreRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CreateCustomKeyStoreResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1003,5)
                                fn CreateGrant(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CreateGrantRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CreateGrantResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1018,5)
                                fn CreateKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CreateKeyRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CreateKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1033,5)
                                fn Decrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1048,5)
                                fn DeleteAlias(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DeleteAliasRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1063,5)
                                fn DeleteCustomKeyStore(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DeleteCustomKeyStoreRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DeleteCustomKeyStoreResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1078,5)
                                fn DeleteImportedKeyMaterial(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DeleteImportedKeyMaterialRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1093,5)
                                fn DeriveSharedSecret(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DeriveSharedSecretRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DeriveSharedSecretResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1108,5)
                                fn DescribeCustomKeyStores(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DescribeCustomKeyStoresRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DescribeCustomKeyStoresResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1123,5)
                                fn DescribeKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DescribeKeyRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DescribeKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1138,5)
                                fn DisableKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DisableKeyRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1153,5)
                                fn DisableKeyRotation(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DisableKeyRotationRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1168,5)
                                fn DisconnectCustomKeyStore(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DisconnectCustomKeyStoreRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DisconnectCustomKeyStoreResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1183,5)
                                fn EnableKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EnableKeyRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1198,5)
                                fn EnableKeyRotation(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EnableKeyRotationRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1213,5)
                                fn Encrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1228,5)
                                fn GenerateDataKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1243,5)
                                fn GenerateDataKeyPair(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyPairRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyPairResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1258,5)
                                fn GenerateDataKeyPairWithoutPlaintext(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyPairWithoutPlaintextRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyPairWithoutPlaintextResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1273,5)
                                fn GenerateDataKeyWithoutPlaintext(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyWithoutPlaintextRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyWithoutPlaintextResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1288,5)
                                fn GenerateMac(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateMacRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateMacResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1303,5)
                                fn GenerateRandom(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateRandomRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateRandomResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1318,5)
                                fn GetKeyPolicy(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GetKeyPolicyRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GetKeyPolicyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1333,5)
                                fn GetKeyRotationStatus(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GetKeyRotationStatusRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GetKeyRotationStatusResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1348,5)
                                fn GetParametersForImport(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GetParametersForImportRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GetParametersForImportResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1363,5)
                                fn GetPublicKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GetPublicKeyRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GetPublicKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1378,5)
                                fn ImportKeyMaterial(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ImportKeyMaterialRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ImportKeyMaterialResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1393,5)
                                fn ListAliases(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListAliasesRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListAliasesResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1408,5)
                                fn ListGrants(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListGrantsRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListGrantsResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1423,5)
                                fn ListKeyPolicies(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListKeyPoliciesRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListKeyPoliciesResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1438,5)
                                fn ListKeyRotations(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListKeyRotationsRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListKeyRotationsResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1453,5)
                                fn ListKeys(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListKeysRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListKeysResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1468,5)
                                fn ListResourceTags(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListResourceTagsRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ListResourceTagsResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1483,5)
                                fn PutKeyPolicy(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PutKeyPolicyRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1498,5)
                                fn ReEncrypt(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ReEncryptRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ReEncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1513,5)
                                fn ReplicateKey(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ReplicateKeyRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ReplicateKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1528,5)
                                fn RetireGrant(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RetireGrantRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1543,5)
                                fn RevokeGrant(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RevokeGrantRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1558,5)
                                fn RotateKeyOnDemand(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RotateKeyOnDemandRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RotateKeyOnDemandResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1573,5)
                                fn ScheduleKeyDeletion(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ScheduleKeyDeletionRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ScheduleKeyDeletionResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1588,5)
                                fn Sign(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SignRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SignResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1603,5)
                                fn TagResource(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::TagResourceRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1618,5)
                                fn UntagResource(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::UntagResourceRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1633,5)
                                fn UpdateAlias(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::UpdateAliasRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1648,5)
                                fn UpdateCustomKeyStore(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::UpdateCustomKeyStoreRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::UpdateCustomKeyStoreResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1663,5)
                                fn UpdateKeyDescription(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::UpdateKeyDescriptionRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1678,5)
                                fn UpdatePrimaryRegion(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::UpdatePrimaryRegionRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1693,5)
                                fn Verify(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::VerifyRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::VerifyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                                /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1708,5)
                                fn VerifyMac(&self, input: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::VerifyMacRequest>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::VerifyMacResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1722,3)
                            pub type TrustAnchorCertificateType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1726,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UntagResourceRequest {
                                UntagResourceRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    TagKeys: Sequence<Sequence<DafnyCharUTF16>>
                                }
                            }

                            impl UntagResourceRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UntagResourceRequest::UntagResourceRequest{KeyId, TagKeys, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field TagKeys
                                pub fn TagKeys(&self) -> &Sequence<Sequence<DafnyCharUTF16>> {
                                    match self {
                                        UntagResourceRequest::UntagResourceRequest{KeyId, TagKeys, } => TagKeys,
                                    }
                                }
                            }

                            impl Debug
                                for UntagResourceRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UntagResourceRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UntagResourceRequest::UntagResourceRequest{KeyId, TagKeys, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.UntagResourceRequest.UntagResourceRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TagKeys, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UntagResourceRequest {}

                            impl Hash
                                for UntagResourceRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UntagResourceRequest::UntagResourceRequest{KeyId, TagKeys, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(TagKeys, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UntagResourceRequest {
                                fn default() -> UntagResourceRequest {
                                    UntagResourceRequest::UntagResourceRequest {
                                        KeyId: Default::default(),
                                        TagKeys: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UntagResourceRequest>
                                for UntagResourceRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1730,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateAliasRequest {
                                UpdateAliasRequest {
                                    AliasName: Sequence<DafnyCharUTF16>,
                                    TargetKeyId: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl UpdateAliasRequest {
                                /// Returns a borrow of the field AliasName
                                pub fn AliasName(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateAliasRequest::UpdateAliasRequest{AliasName, TargetKeyId, } => AliasName,
                                    }
                                }
                                /// Returns a borrow of the field TargetKeyId
                                pub fn TargetKeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateAliasRequest::UpdateAliasRequest{AliasName, TargetKeyId, } => TargetKeyId,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateAliasRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateAliasRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateAliasRequest::UpdateAliasRequest{AliasName, TargetKeyId, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.UpdateAliasRequest.UpdateAliasRequest(")?;
                                            DafnyPrint::fmt_print(AliasName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(TargetKeyId, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateAliasRequest {}

                            impl Hash
                                for UpdateAliasRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateAliasRequest::UpdateAliasRequest{AliasName, TargetKeyId, } => {
                                            Hash::hash(AliasName, _state);
                                            Hash::hash(TargetKeyId, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateAliasRequest {
                                fn default() -> UpdateAliasRequest {
                                    UpdateAliasRequest::UpdateAliasRequest {
                                        AliasName: Default::default(),
                                        TargetKeyId: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateAliasRequest>
                                for UpdateAliasRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1734,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateCustomKeyStoreRequest {
                                UpdateCustomKeyStoreRequest {
                                    CustomKeyStoreId: Sequence<DafnyCharUTF16>,
                                    NewCustomKeyStoreName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    KeyStorePassword: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    CloudHsmClusterId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    XksProxyUriEndpoint: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    XksProxyUriPath: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    XksProxyVpcEndpointServiceName: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    XksProxyAuthenticationCredential: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyAuthenticationCredentialType>>>,
                                    XksProxyConnectivity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyConnectivityType>>>
                                }
                            }

                            impl UpdateCustomKeyStoreRequest {
                                /// Returns a borrow of the field CustomKeyStoreId
                                pub fn CustomKeyStoreId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => CustomKeyStoreId,
                                    }
                                }
                                /// Returns a borrow of the field NewCustomKeyStoreName
                                pub fn NewCustomKeyStoreName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => NewCustomKeyStoreName,
                                    }
                                }
                                /// Returns a borrow of the field KeyStorePassword
                                pub fn KeyStorePassword(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => KeyStorePassword,
                                    }
                                }
                                /// Returns a borrow of the field CloudHsmClusterId
                                pub fn CloudHsmClusterId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => CloudHsmClusterId,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyUriEndpoint
                                pub fn XksProxyUriEndpoint(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => XksProxyUriEndpoint,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyUriPath
                                pub fn XksProxyUriPath(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => XksProxyUriPath,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyVpcEndpointServiceName
                                pub fn XksProxyVpcEndpointServiceName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => XksProxyVpcEndpointServiceName,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyAuthenticationCredential
                                pub fn XksProxyAuthenticationCredential(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyAuthenticationCredentialType>>> {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => XksProxyAuthenticationCredential,
                                    }
                                }
                                /// Returns a borrow of the field XksProxyConnectivity
                                pub fn XksProxyConnectivity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyConnectivityType>>> {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => XksProxyConnectivity,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateCustomKeyStoreRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateCustomKeyStoreRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.UpdateCustomKeyStoreRequest.UpdateCustomKeyStoreRequest(")?;
                                            DafnyPrint::fmt_print(CustomKeyStoreId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(NewCustomKeyStoreName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyStorePassword, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(CloudHsmClusterId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyUriEndpoint, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyUriPath, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyVpcEndpointServiceName, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyAuthenticationCredential, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(XksProxyConnectivity, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateCustomKeyStoreRequest {}

                            impl Hash
                                for UpdateCustomKeyStoreRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest{CustomKeyStoreId, NewCustomKeyStoreName, KeyStorePassword, CloudHsmClusterId, XksProxyUriEndpoint, XksProxyUriPath, XksProxyVpcEndpointServiceName, XksProxyAuthenticationCredential, XksProxyConnectivity, } => {
                                            Hash::hash(CustomKeyStoreId, _state);
                                            Hash::hash(NewCustomKeyStoreName, _state);
                                            Hash::hash(KeyStorePassword, _state);
                                            Hash::hash(CloudHsmClusterId, _state);
                                            Hash::hash(XksProxyUriEndpoint, _state);
                                            Hash::hash(XksProxyUriPath, _state);
                                            Hash::hash(XksProxyVpcEndpointServiceName, _state);
                                            Hash::hash(XksProxyAuthenticationCredential, _state);
                                            Hash::hash(XksProxyConnectivity, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateCustomKeyStoreRequest {
                                fn default() -> UpdateCustomKeyStoreRequest {
                                    UpdateCustomKeyStoreRequest::UpdateCustomKeyStoreRequest {
                                        CustomKeyStoreId: Default::default(),
                                        NewCustomKeyStoreName: Default::default(),
                                        KeyStorePassword: Default::default(),
                                        CloudHsmClusterId: Default::default(),
                                        XksProxyUriEndpoint: Default::default(),
                                        XksProxyUriPath: Default::default(),
                                        XksProxyVpcEndpointServiceName: Default::default(),
                                        XksProxyAuthenticationCredential: Default::default(),
                                        XksProxyConnectivity: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateCustomKeyStoreRequest>
                                for UpdateCustomKeyStoreRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1745,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateCustomKeyStoreResponse {
                                UpdateCustomKeyStoreResponse {}
                            }

                            impl UpdateCustomKeyStoreResponse {}

                            impl Debug
                                for UpdateCustomKeyStoreResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateCustomKeyStoreResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateCustomKeyStoreResponse::UpdateCustomKeyStoreResponse{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.UpdateCustomKeyStoreResponse.UpdateCustomKeyStoreResponse")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl UpdateCustomKeyStoreResponse {
                                /// Enumerates all possible values of UpdateCustomKeyStoreResponse
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<UpdateCustomKeyStoreResponse>> {
                                    seq![Arc::new(UpdateCustomKeyStoreResponse::UpdateCustomKeyStoreResponse {})].iter()
                                }
                            }

                            impl Eq
                                for UpdateCustomKeyStoreResponse {}

                            impl Hash
                                for UpdateCustomKeyStoreResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateCustomKeyStoreResponse::UpdateCustomKeyStoreResponse{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateCustomKeyStoreResponse {
                                fn default() -> UpdateCustomKeyStoreResponse {
                                    UpdateCustomKeyStoreResponse::UpdateCustomKeyStoreResponse {}
                                }
                            }

                            impl AsRef<UpdateCustomKeyStoreResponse>
                                for UpdateCustomKeyStoreResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1748,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdateKeyDescriptionRequest {
                                UpdateKeyDescriptionRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    Description: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl UpdateKeyDescriptionRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateKeyDescriptionRequest::UpdateKeyDescriptionRequest{KeyId, Description, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Description
                                pub fn Description(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdateKeyDescriptionRequest::UpdateKeyDescriptionRequest{KeyId, Description, } => Description,
                                    }
                                }
                            }

                            impl Debug
                                for UpdateKeyDescriptionRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdateKeyDescriptionRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdateKeyDescriptionRequest::UpdateKeyDescriptionRequest{KeyId, Description, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.UpdateKeyDescriptionRequest.UpdateKeyDescriptionRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Description, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdateKeyDescriptionRequest {}

                            impl Hash
                                for UpdateKeyDescriptionRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdateKeyDescriptionRequest::UpdateKeyDescriptionRequest{KeyId, Description, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Description, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdateKeyDescriptionRequest {
                                fn default() -> UpdateKeyDescriptionRequest {
                                    UpdateKeyDescriptionRequest::UpdateKeyDescriptionRequest {
                                        KeyId: Default::default(),
                                        Description: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdateKeyDescriptionRequest>
                                for UpdateKeyDescriptionRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1752,3)
                            #[derive(PartialEq, Clone)]
                            pub enum UpdatePrimaryRegionRequest {
                                UpdatePrimaryRegionRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    PrimaryRegion: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl UpdatePrimaryRegionRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdatePrimaryRegionRequest::UpdatePrimaryRegionRequest{KeyId, PrimaryRegion, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field PrimaryRegion
                                pub fn PrimaryRegion(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        UpdatePrimaryRegionRequest::UpdatePrimaryRegionRequest{KeyId, PrimaryRegion, } => PrimaryRegion,
                                    }
                                }
                            }

                            impl Debug
                                for UpdatePrimaryRegionRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for UpdatePrimaryRegionRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        UpdatePrimaryRegionRequest::UpdatePrimaryRegionRequest{KeyId, PrimaryRegion, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.UpdatePrimaryRegionRequest.UpdatePrimaryRegionRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(PrimaryRegion, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for UpdatePrimaryRegionRequest {}

                            impl Hash
                                for UpdatePrimaryRegionRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        UpdatePrimaryRegionRequest::UpdatePrimaryRegionRequest{KeyId, PrimaryRegion, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(PrimaryRegion, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for UpdatePrimaryRegionRequest {
                                fn default() -> UpdatePrimaryRegionRequest {
                                    UpdatePrimaryRegionRequest::UpdatePrimaryRegionRequest {
                                        KeyId: Default::default(),
                                        PrimaryRegion: Default::default()
                                    }
                                }
                            }

                            impl AsRef<UpdatePrimaryRegionRequest>
                                for UpdatePrimaryRegionRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1756,3)
                            #[derive(PartialEq, Clone)]
                            pub enum VerifyMacRequest {
                                VerifyMacRequest {
                                    Message: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType,
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    MacAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MacAlgorithmSpec>,
                                    Mac: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl VerifyMacRequest {
                                /// Returns a borrow of the field Message
                                pub fn Message(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType {
                                    match self {
                                        VerifyMacRequest::VerifyMacRequest{Message, KeyId, MacAlgorithm, Mac, GrantTokens, DryRun, } => Message,
                                    }
                                }
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        VerifyMacRequest::VerifyMacRequest{Message, KeyId, MacAlgorithm, Mac, GrantTokens, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field MacAlgorithm
                                pub fn MacAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MacAlgorithmSpec> {
                                    match self {
                                        VerifyMacRequest::VerifyMacRequest{Message, KeyId, MacAlgorithm, Mac, GrantTokens, DryRun, } => MacAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field Mac
                                pub fn Mac(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType {
                                    match self {
                                        VerifyMacRequest::VerifyMacRequest{Message, KeyId, MacAlgorithm, Mac, GrantTokens, DryRun, } => Mac,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        VerifyMacRequest::VerifyMacRequest{Message, KeyId, MacAlgorithm, Mac, GrantTokens, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        VerifyMacRequest::VerifyMacRequest{Message, KeyId, MacAlgorithm, Mac, GrantTokens, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for VerifyMacRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for VerifyMacRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        VerifyMacRequest::VerifyMacRequest{Message, KeyId, MacAlgorithm, Mac, GrantTokens, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.VerifyMacRequest.VerifyMacRequest(")?;
                                            DafnyPrint::fmt_print(Message, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MacAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Mac, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for VerifyMacRequest {}

                            impl Hash
                                for VerifyMacRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        VerifyMacRequest::VerifyMacRequest{Message, KeyId, MacAlgorithm, Mac, GrantTokens, DryRun, } => {
                                            Hash::hash(Message, _state);
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(MacAlgorithm, _state);
                                            Hash::hash(Mac, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for VerifyMacRequest {
                                fn default() -> VerifyMacRequest {
                                    VerifyMacRequest::VerifyMacRequest {
                                        Message: Default::default(),
                                        KeyId: Default::default(),
                                        MacAlgorithm: Default::default(),
                                        Mac: Default::default(),
                                        GrantTokens: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<VerifyMacRequest>
                                for VerifyMacRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1764,3)
                            #[derive(PartialEq, Clone)]
                            pub enum VerifyMacResponse {
                                VerifyMacResponse {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    MacValid: Arc<Option<bool>>,
                                    MacAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MacAlgorithmSpec>>>
                                }
                            }

                            impl VerifyMacResponse {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        VerifyMacResponse::VerifyMacResponse{KeyId, MacValid, MacAlgorithm, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field MacValid
                                pub fn MacValid(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        VerifyMacResponse::VerifyMacResponse{KeyId, MacValid, MacAlgorithm, } => MacValid,
                                    }
                                }
                                /// Returns a borrow of the field MacAlgorithm
                                pub fn MacAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MacAlgorithmSpec>>> {
                                    match self {
                                        VerifyMacResponse::VerifyMacResponse{KeyId, MacValid, MacAlgorithm, } => MacAlgorithm,
                                    }
                                }
                            }

                            impl Debug
                                for VerifyMacResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for VerifyMacResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        VerifyMacResponse::VerifyMacResponse{KeyId, MacValid, MacAlgorithm, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.VerifyMacResponse.VerifyMacResponse(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MacValid, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MacAlgorithm, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for VerifyMacResponse {}

                            impl Hash
                                for VerifyMacResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        VerifyMacResponse::VerifyMacResponse{KeyId, MacValid, MacAlgorithm, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(MacValid, _state);
                                            Hash::hash(MacAlgorithm, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for VerifyMacResponse {
                                fn default() -> VerifyMacResponse {
                                    VerifyMacResponse::VerifyMacResponse {
                                        KeyId: Default::default(),
                                        MacValid: Default::default(),
                                        MacAlgorithm: Default::default()
                                    }
                                }
                            }

                            impl AsRef<VerifyMacResponse>
                                for VerifyMacResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1769,3)
                            #[derive(PartialEq, Clone)]
                            pub enum VerifyRequest {
                                VerifyRequest {
                                    KeyId: Sequence<DafnyCharUTF16>,
                                    Message: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType,
                                    MessageType: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MessageType>>>,
                                    Signature: crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType,
                                    SigningAlgorithm: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec>,
                                    GrantTokens: Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>>,
                                    DryRun: Arc<Option<bool>>
                                }
                            }

                            impl VerifyRequest {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        VerifyRequest::VerifyRequest{KeyId, Message, MessageType, Signature, SigningAlgorithm, GrantTokens, DryRun, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field Message
                                pub fn Message(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType {
                                    match self {
                                        VerifyRequest::VerifyRequest{KeyId, Message, MessageType, Signature, SigningAlgorithm, GrantTokens, DryRun, } => Message,
                                    }
                                }
                                /// Returns a borrow of the field MessageType
                                pub fn MessageType(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::MessageType>>> {
                                    match self {
                                        VerifyRequest::VerifyRequest{KeyId, Message, MessageType, Signature, SigningAlgorithm, GrantTokens, DryRun, } => MessageType,
                                    }
                                }
                                /// Returns a borrow of the field Signature
                                pub fn Signature(&self) -> &crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::CiphertextType {
                                    match self {
                                        VerifyRequest::VerifyRequest{KeyId, Message, MessageType, Signature, SigningAlgorithm, GrantTokens, DryRun, } => Signature,
                                    }
                                }
                                /// Returns a borrow of the field SigningAlgorithm
                                pub fn SigningAlgorithm(&self) -> &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec> {
                                    match self {
                                        VerifyRequest::VerifyRequest{KeyId, Message, MessageType, Signature, SigningAlgorithm, GrantTokens, DryRun, } => SigningAlgorithm,
                                    }
                                }
                                /// Returns a borrow of the field GrantTokens
                                pub fn GrantTokens(&self) -> &Arc<Option<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList>> {
                                    match self {
                                        VerifyRequest::VerifyRequest{KeyId, Message, MessageType, Signature, SigningAlgorithm, GrantTokens, DryRun, } => GrantTokens,
                                    }
                                }
                                /// Returns a borrow of the field DryRun
                                pub fn DryRun(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        VerifyRequest::VerifyRequest{KeyId, Message, MessageType, Signature, SigningAlgorithm, GrantTokens, DryRun, } => DryRun,
                                    }
                                }
                            }

                            impl Debug
                                for VerifyRequest {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for VerifyRequest {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        VerifyRequest::VerifyRequest{KeyId, Message, MessageType, Signature, SigningAlgorithm, GrantTokens, DryRun, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.VerifyRequest.VerifyRequest(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Message, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(MessageType, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(Signature, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SigningAlgorithm, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(GrantTokens, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(DryRun, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for VerifyRequest {}

                            impl Hash
                                for VerifyRequest {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        VerifyRequest::VerifyRequest{KeyId, Message, MessageType, Signature, SigningAlgorithm, GrantTokens, DryRun, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(Message, _state);
                                            Hash::hash(MessageType, _state);
                                            Hash::hash(Signature, _state);
                                            Hash::hash(SigningAlgorithm, _state);
                                            Hash::hash(GrantTokens, _state);
                                            Hash::hash(DryRun, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for VerifyRequest {
                                fn default() -> VerifyRequest {
                                    VerifyRequest::VerifyRequest {
                                        KeyId: Default::default(),
                                        Message: Default::default(),
                                        MessageType: Default::default(),
                                        Signature: Default::default(),
                                        SigningAlgorithm: Default::default(),
                                        GrantTokens: Default::default(),
                                        DryRun: Default::default()
                                    }
                                }
                            }

                            impl AsRef<VerifyRequest>
                                for VerifyRequest {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1778,3)
                            #[derive(PartialEq, Clone)]
                            pub enum VerifyResponse {
                                VerifyResponse {
                                    KeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    SignatureValid: Arc<Option<bool>>,
                                    SigningAlgorithm: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec>>>
                                }
                            }

                            impl VerifyResponse {
                                /// Returns a borrow of the field KeyId
                                pub fn KeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        VerifyResponse::VerifyResponse{KeyId, SignatureValid, SigningAlgorithm, } => KeyId,
                                    }
                                }
                                /// Returns a borrow of the field SignatureValid
                                pub fn SignatureValid(&self) -> &Arc<Option<bool>> {
                                    match self {
                                        VerifyResponse::VerifyResponse{KeyId, SignatureValid, SigningAlgorithm, } => SignatureValid,
                                    }
                                }
                                /// Returns a borrow of the field SigningAlgorithm
                                pub fn SigningAlgorithm(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::SigningAlgorithmSpec>>> {
                                    match self {
                                        VerifyResponse::VerifyResponse{KeyId, SignatureValid, SigningAlgorithm, } => SigningAlgorithm,
                                    }
                                }
                            }

                            impl Debug
                                for VerifyResponse {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for VerifyResponse {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        VerifyResponse::VerifyResponse{KeyId, SignatureValid, SigningAlgorithm, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.VerifyResponse.VerifyResponse(")?;
                                            DafnyPrint::fmt_print(KeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SignatureValid, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(SigningAlgorithm, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for VerifyResponse {}

                            impl Hash
                                for VerifyResponse {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        VerifyResponse::VerifyResponse{KeyId, SignatureValid, SigningAlgorithm, } => {
                                            Hash::hash(KeyId, _state);
                                            Hash::hash(SignatureValid, _state);
                                            Hash::hash(SigningAlgorithm, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for VerifyResponse {
                                fn default() -> VerifyResponse {
                                    VerifyResponse::VerifyResponse {
                                        KeyId: Default::default(),
                                        SignatureValid: Default::default(),
                                        SigningAlgorithm: Default::default()
                                    }
                                }
                            }

                            impl AsRef<VerifyResponse>
                                for VerifyResponse {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1783,3)
                            #[derive(PartialEq, Clone)]
                            pub enum WrappingKeySpec {
                                RSA_2048 {},
                                RSA_3072 {},
                                RSA_4096 {},
                                SM2 {}
                            }

                            impl WrappingKeySpec {}

                            impl Debug
                                for WrappingKeySpec {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for WrappingKeySpec {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        WrappingKeySpec::RSA_2048{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.WrappingKeySpec.RSA__2048")?;
                                            Ok(())
                                        },
                                        WrappingKeySpec::RSA_3072{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.WrappingKeySpec.RSA__3072")?;
                                            Ok(())
                                        },
                                        WrappingKeySpec::RSA_4096{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.WrappingKeySpec.RSA__4096")?;
                                            Ok(())
                                        },
                                        WrappingKeySpec::SM2{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.WrappingKeySpec.SM2")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl WrappingKeySpec {
                                /// Enumerates all possible values of WrappingKeySpec
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<WrappingKeySpec>> {
                                    seq![Arc::new(WrappingKeySpec::RSA_2048 {}), Arc::new(WrappingKeySpec::RSA_3072 {}), Arc::new(WrappingKeySpec::RSA_4096 {}), Arc::new(WrappingKeySpec::SM2 {})].iter()
                                }
                            }

                            impl Eq
                                for WrappingKeySpec {}

                            impl Hash
                                for WrappingKeySpec {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        WrappingKeySpec::RSA_2048{} => {

                                        },
                                        WrappingKeySpec::RSA_3072{} => {

                                        },
                                        WrappingKeySpec::RSA_4096{} => {

                                        },
                                        WrappingKeySpec::SM2{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for WrappingKeySpec {
                                fn default() -> WrappingKeySpec {
                                    WrappingKeySpec::RSA_2048 {}
                                }
                            }

                            impl AsRef<WrappingKeySpec>
                                for WrappingKeySpec {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1788,3)
                            #[derive(PartialEq, Clone)]
                            pub enum XksKeyConfigurationType {
                                XksKeyConfigurationType {
                                    Id: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl XksKeyConfigurationType {
                                /// Returns a borrow of the field Id
                                pub fn Id(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        XksKeyConfigurationType::XksKeyConfigurationType{Id, } => Id,
                                    }
                                }
                            }

                            impl Debug
                                for XksKeyConfigurationType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for XksKeyConfigurationType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        XksKeyConfigurationType::XksKeyConfigurationType{Id, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.XksKeyConfigurationType.XksKeyConfigurationType(")?;
                                            DafnyPrint::fmt_print(Id, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for XksKeyConfigurationType {}

                            impl Hash
                                for XksKeyConfigurationType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        XksKeyConfigurationType::XksKeyConfigurationType{Id, } => {
                                            Hash::hash(Id, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for XksKeyConfigurationType {
                                fn default() -> XksKeyConfigurationType {
                                    XksKeyConfigurationType::XksKeyConfigurationType {
                                        Id: Default::default()
                                    }
                                }
                            }

                            impl AsRef<XksKeyConfigurationType>
                                for XksKeyConfigurationType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1791,3)
                            pub type XksKeyIdType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1795,3)
                            pub type XksProxyAuthenticationAccessKeyIdType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1799,3)
                            #[derive(PartialEq, Clone)]
                            pub enum XksProxyAuthenticationCredentialType {
                                XksProxyAuthenticationCredentialType {
                                    AccessKeyId: Sequence<DafnyCharUTF16>,
                                    RawSecretAccessKey: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl XksProxyAuthenticationCredentialType {
                                /// Returns a borrow of the field AccessKeyId
                                pub fn AccessKeyId(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        XksProxyAuthenticationCredentialType::XksProxyAuthenticationCredentialType{AccessKeyId, RawSecretAccessKey, } => AccessKeyId,
                                    }
                                }
                                /// Returns a borrow of the field RawSecretAccessKey
                                pub fn RawSecretAccessKey(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        XksProxyAuthenticationCredentialType::XksProxyAuthenticationCredentialType{AccessKeyId, RawSecretAccessKey, } => RawSecretAccessKey,
                                    }
                                }
                            }

                            impl Debug
                                for XksProxyAuthenticationCredentialType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for XksProxyAuthenticationCredentialType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        XksProxyAuthenticationCredentialType::XksProxyAuthenticationCredentialType{AccessKeyId, RawSecretAccessKey, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.XksProxyAuthenticationCredentialType.XksProxyAuthenticationCredentialType(")?;
                                            DafnyPrint::fmt_print(AccessKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(RawSecretAccessKey, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for XksProxyAuthenticationCredentialType {}

                            impl Hash
                                for XksProxyAuthenticationCredentialType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        XksProxyAuthenticationCredentialType::XksProxyAuthenticationCredentialType{AccessKeyId, RawSecretAccessKey, } => {
                                            Hash::hash(AccessKeyId, _state);
                                            Hash::hash(RawSecretAccessKey, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for XksProxyAuthenticationCredentialType {
                                fn default() -> XksProxyAuthenticationCredentialType {
                                    XksProxyAuthenticationCredentialType::XksProxyAuthenticationCredentialType {
                                        AccessKeyId: Default::default(),
                                        RawSecretAccessKey: Default::default()
                                    }
                                }
                            }

                            impl AsRef<XksProxyAuthenticationCredentialType>
                                for XksProxyAuthenticationCredentialType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1803,3)
                            pub type XksProxyAuthenticationRawSecretAccessKeyType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1807,3)
                            #[derive(PartialEq, Clone)]
                            pub enum XksProxyConfigurationType {
                                XksProxyConfigurationType {
                                    Connectivity: Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyConnectivityType>>>,
                                    AccessKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    UriEndpoint: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    UriPath: Arc<Option<Sequence<DafnyCharUTF16>>>,
                                    VpcEndpointServiceName: Arc<Option<Sequence<DafnyCharUTF16>>>
                                }
                            }

                            impl XksProxyConfigurationType {
                                /// Returns a borrow of the field Connectivity
                                pub fn Connectivity(&self) -> &Arc<Option<Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::XksProxyConnectivityType>>> {
                                    match self {
                                        XksProxyConfigurationType::XksProxyConfigurationType{Connectivity, AccessKeyId, UriEndpoint, UriPath, VpcEndpointServiceName, } => Connectivity,
                                    }
                                }
                                /// Returns a borrow of the field AccessKeyId
                                pub fn AccessKeyId(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        XksProxyConfigurationType::XksProxyConfigurationType{Connectivity, AccessKeyId, UriEndpoint, UriPath, VpcEndpointServiceName, } => AccessKeyId,
                                    }
                                }
                                /// Returns a borrow of the field UriEndpoint
                                pub fn UriEndpoint(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        XksProxyConfigurationType::XksProxyConfigurationType{Connectivity, AccessKeyId, UriEndpoint, UriPath, VpcEndpointServiceName, } => UriEndpoint,
                                    }
                                }
                                /// Returns a borrow of the field UriPath
                                pub fn UriPath(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        XksProxyConfigurationType::XksProxyConfigurationType{Connectivity, AccessKeyId, UriEndpoint, UriPath, VpcEndpointServiceName, } => UriPath,
                                    }
                                }
                                /// Returns a borrow of the field VpcEndpointServiceName
                                pub fn VpcEndpointServiceName(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        XksProxyConfigurationType::XksProxyConfigurationType{Connectivity, AccessKeyId, UriEndpoint, UriPath, VpcEndpointServiceName, } => VpcEndpointServiceName,
                                    }
                                }
                            }

                            impl Debug
                                for XksProxyConfigurationType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for XksProxyConfigurationType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        XksProxyConfigurationType::XksProxyConfigurationType{Connectivity, AccessKeyId, UriEndpoint, UriPath, VpcEndpointServiceName, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.XksProxyConfigurationType.XksProxyConfigurationType(")?;
                                            DafnyPrint::fmt_print(Connectivity, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(AccessKeyId, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(UriEndpoint, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(UriPath, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(VpcEndpointServiceName, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for XksProxyConfigurationType {}

                            impl Hash
                                for XksProxyConfigurationType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        XksProxyConfigurationType::XksProxyConfigurationType{Connectivity, AccessKeyId, UriEndpoint, UriPath, VpcEndpointServiceName, } => {
                                            Hash::hash(Connectivity, _state);
                                            Hash::hash(AccessKeyId, _state);
                                            Hash::hash(UriEndpoint, _state);
                                            Hash::hash(UriPath, _state);
                                            Hash::hash(VpcEndpointServiceName, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for XksProxyConfigurationType {
                                fn default() -> XksProxyConfigurationType {
                                    XksProxyConfigurationType::XksProxyConfigurationType {
                                        Connectivity: Default::default(),
                                        AccessKeyId: Default::default(),
                                        UriEndpoint: Default::default(),
                                        UriPath: Default::default(),
                                        VpcEndpointServiceName: Default::default()
                                    }
                                }
                            }

                            impl AsRef<XksProxyConfigurationType>
                                for XksProxyConfigurationType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1814,3)
                            #[derive(PartialEq, Clone)]
                            pub enum XksProxyConnectivityType {
                                PUBLIC_ENDPOINT {},
                                VPC_ENDPOINT_SERVICE {}
                            }

                            impl XksProxyConnectivityType {}

                            impl Debug
                                for XksProxyConnectivityType {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for XksProxyConnectivityType {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        XksProxyConnectivityType::PUBLIC_ENDPOINT{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.XksProxyConnectivityType.PUBLIC__ENDPOINT")?;
                                            Ok(())
                                        },
                                        XksProxyConnectivityType::VPC_ENDPOINT_SERVICE{} => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.XksProxyConnectivityType.VPC__ENDPOINT__SERVICE")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl XksProxyConnectivityType {
                                /// Enumerates all possible values of XksProxyConnectivityType
                                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<XksProxyConnectivityType>> {
                                    seq![Arc::new(XksProxyConnectivityType::PUBLIC_ENDPOINT {}), Arc::new(XksProxyConnectivityType::VPC_ENDPOINT_SERVICE {})].iter()
                                }
                            }

                            impl Eq
                                for XksProxyConnectivityType {}

                            impl Hash
                                for XksProxyConnectivityType {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        XksProxyConnectivityType::PUBLIC_ENDPOINT{} => {

                                        },
                                        XksProxyConnectivityType::VPC_ENDPOINT_SERVICE{} => {

                                        },
                                    }
                                }
                            }

                            impl Default
                                for XksProxyConnectivityType {
                                fn default() -> XksProxyConnectivityType {
                                    XksProxyConnectivityType::PUBLIC_ENDPOINT {}
                                }
                            }

                            impl AsRef<XksProxyConnectivityType>
                                for XksProxyConnectivityType {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1817,3)
                            pub type XksProxyUriEndpointType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1821,3)
                            pub type XksProxyUriPathType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1825,3)
                            pub type XksProxyVpcEndpointServiceNameType = Sequence<DafnyCharUTF16>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1829,3)
                            #[derive(PartialEq, Clone)]
                            pub enum Error {
                                AlreadyExistsException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                CloudHsmClusterInUseException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                CloudHsmClusterInvalidConfigurationException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                CloudHsmClusterNotActiveException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                CloudHsmClusterNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                CloudHsmClusterNotRelatedException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ConflictException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                CustomKeyStoreHasCMKsException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                CustomKeyStoreInvalidStateException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                CustomKeyStoreNameInUseException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                CustomKeyStoreNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                DependencyTimeoutException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                DisabledException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                DryRunOperationException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                ExpiredImportTokenException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                IncorrectKeyException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                IncorrectKeyMaterialException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                IncorrectTrustAnchorException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidAliasNameException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidArnException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidCiphertextException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidGrantIdException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidGrantTokenException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidImportTokenException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidKeyUsageException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                InvalidMarkerException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                KeyUnavailableException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                KMSInternalException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                KMSInvalidMacException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                KMSInvalidSignatureException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                KMSInvalidStateException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                LimitExceededException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                MalformedPolicyDocumentException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                NotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                TagException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                UnsupportedOperationException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksKeyAlreadyInUseException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksKeyInvalidConfigurationException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksKeyNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksProxyIncorrectAuthenticationCredentialException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksProxyInvalidConfigurationException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksProxyInvalidResponseException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksProxyUriEndpointInUseException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksProxyUriInUseException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksProxyUriUnreachableException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksProxyVpcEndpointServiceInUseException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksProxyVpcEndpointServiceInvalidConfigurationException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                XksProxyVpcEndpointServiceNotFoundException {
                                    message: Arc<Option<Sequence<DafnyCharUTF16>>>
                                },
                                Opaque {
                                    obj: Object<dyn Any + Sync + Send>
                                },
                                OpaqueWithText {
                                    obj: Object<dyn Any + Sync + Send>,
                                    objMessage: Sequence<DafnyCharUTF16>
                                }
                            }

                            impl Error {
                                /// Gets the field message for all enum members which have it
                                pub fn message(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
                                    match self {
                                        Error::AlreadyExistsException{message, } => message,
                                        Error::CloudHsmClusterInUseException{message, } => message,
                                        Error::CloudHsmClusterInvalidConfigurationException{message, } => message,
                                        Error::CloudHsmClusterNotActiveException{message, } => message,
                                        Error::CloudHsmClusterNotFoundException{message, } => message,
                                        Error::CloudHsmClusterNotRelatedException{message, } => message,
                                        Error::ConflictException{message, } => message,
                                        Error::CustomKeyStoreHasCMKsException{message, } => message,
                                        Error::CustomKeyStoreInvalidStateException{message, } => message,
                                        Error::CustomKeyStoreNameInUseException{message, } => message,
                                        Error::CustomKeyStoreNotFoundException{message, } => message,
                                        Error::DependencyTimeoutException{message, } => message,
                                        Error::DisabledException{message, } => message,
                                        Error::DryRunOperationException{message, } => message,
                                        Error::ExpiredImportTokenException{message, } => message,
                                        Error::IncorrectKeyException{message, } => message,
                                        Error::IncorrectKeyMaterialException{message, } => message,
                                        Error::IncorrectTrustAnchorException{message, } => message,
                                        Error::InvalidAliasNameException{message, } => message,
                                        Error::InvalidArnException{message, } => message,
                                        Error::InvalidCiphertextException{message, } => message,
                                        Error::InvalidGrantIdException{message, } => message,
                                        Error::InvalidGrantTokenException{message, } => message,
                                        Error::InvalidImportTokenException{message, } => message,
                                        Error::InvalidKeyUsageException{message, } => message,
                                        Error::InvalidMarkerException{message, } => message,
                                        Error::KeyUnavailableException{message, } => message,
                                        Error::KMSInternalException{message, } => message,
                                        Error::KMSInvalidMacException{message, } => message,
                                        Error::KMSInvalidSignatureException{message, } => message,
                                        Error::KMSInvalidStateException{message, } => message,
                                        Error::LimitExceededException{message, } => message,
                                        Error::MalformedPolicyDocumentException{message, } => message,
                                        Error::NotFoundException{message, } => message,
                                        Error::TagException{message, } => message,
                                        Error::UnsupportedOperationException{message, } => message,
                                        Error::XksKeyAlreadyInUseException{message, } => message,
                                        Error::XksKeyInvalidConfigurationException{message, } => message,
                                        Error::XksKeyNotFoundException{message, } => message,
                                        Error::XksProxyIncorrectAuthenticationCredentialException{message, } => message,
                                        Error::XksProxyInvalidConfigurationException{message, } => message,
                                        Error::XksProxyInvalidResponseException{message, } => message,
                                        Error::XksProxyUriEndpointInUseException{message, } => message,
                                        Error::XksProxyUriInUseException{message, } => message,
                                        Error::XksProxyUriUnreachableException{message, } => message,
                                        Error::XksProxyVpcEndpointServiceInUseException{message, } => message,
                                        Error::XksProxyVpcEndpointServiceInvalidConfigurationException{message, } => message,
                                        Error::XksProxyVpcEndpointServiceNotFoundException{message, } => message,
                                        Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                        Error::OpaqueWithText{obj, objMessage, } => panic!("field does not exist on this variant"),
                                    }
                                }
                                /// Gets the field obj for all enum members which have it
                                pub fn obj(&self) -> &Object<dyn Any + Sync + Send> {
                                    match self {
                                        Error::AlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::CloudHsmClusterInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::CloudHsmClusterInvalidConfigurationException{message, } => panic!("field does not exist on this variant"),
                                        Error::CloudHsmClusterNotActiveException{message, } => panic!("field does not exist on this variant"),
                                        Error::CloudHsmClusterNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::CloudHsmClusterNotRelatedException{message, } => panic!("field does not exist on this variant"),
                                        Error::ConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::CustomKeyStoreHasCMKsException{message, } => panic!("field does not exist on this variant"),
                                        Error::CustomKeyStoreInvalidStateException{message, } => panic!("field does not exist on this variant"),
                                        Error::CustomKeyStoreNameInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::CustomKeyStoreNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::DependencyTimeoutException{message, } => panic!("field does not exist on this variant"),
                                        Error::DisabledException{message, } => panic!("field does not exist on this variant"),
                                        Error::DryRunOperationException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExpiredImportTokenException{message, } => panic!("field does not exist on this variant"),
                                        Error::IncorrectKeyException{message, } => panic!("field does not exist on this variant"),
                                        Error::IncorrectKeyMaterialException{message, } => panic!("field does not exist on this variant"),
                                        Error::IncorrectTrustAnchorException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidAliasNameException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidArnException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidCiphertextException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidGrantIdException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidGrantTokenException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidImportTokenException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidKeyUsageException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidMarkerException{message, } => panic!("field does not exist on this variant"),
                                        Error::KeyUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::KMSInternalException{message, } => panic!("field does not exist on this variant"),
                                        Error::KMSInvalidMacException{message, } => panic!("field does not exist on this variant"),
                                        Error::KMSInvalidSignatureException{message, } => panic!("field does not exist on this variant"),
                                        Error::KMSInvalidStateException{message, } => panic!("field does not exist on this variant"),
                                        Error::LimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::MalformedPolicyDocumentException{message, } => panic!("field does not exist on this variant"),
                                        Error::NotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TagException{message, } => panic!("field does not exist on this variant"),
                                        Error::UnsupportedOperationException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksKeyAlreadyInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksKeyInvalidConfigurationException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksKeyNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyIncorrectAuthenticationCredentialException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyInvalidConfigurationException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyInvalidResponseException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyUriEndpointInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyUriInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyUriUnreachableException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyVpcEndpointServiceInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyVpcEndpointServiceInvalidConfigurationException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyVpcEndpointServiceNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::Opaque{obj, } => obj,
                                        Error::OpaqueWithText{obj, objMessage, } => obj,
                                    }
                                }
                                /// Gets the field objMessage for all enum members which have it
                                pub fn objMessage(&self) -> &Sequence<DafnyCharUTF16> {
                                    match self {
                                        Error::AlreadyExistsException{message, } => panic!("field does not exist on this variant"),
                                        Error::CloudHsmClusterInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::CloudHsmClusterInvalidConfigurationException{message, } => panic!("field does not exist on this variant"),
                                        Error::CloudHsmClusterNotActiveException{message, } => panic!("field does not exist on this variant"),
                                        Error::CloudHsmClusterNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::CloudHsmClusterNotRelatedException{message, } => panic!("field does not exist on this variant"),
                                        Error::ConflictException{message, } => panic!("field does not exist on this variant"),
                                        Error::CustomKeyStoreHasCMKsException{message, } => panic!("field does not exist on this variant"),
                                        Error::CustomKeyStoreInvalidStateException{message, } => panic!("field does not exist on this variant"),
                                        Error::CustomKeyStoreNameInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::CustomKeyStoreNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::DependencyTimeoutException{message, } => panic!("field does not exist on this variant"),
                                        Error::DisabledException{message, } => panic!("field does not exist on this variant"),
                                        Error::DryRunOperationException{message, } => panic!("field does not exist on this variant"),
                                        Error::ExpiredImportTokenException{message, } => panic!("field does not exist on this variant"),
                                        Error::IncorrectKeyException{message, } => panic!("field does not exist on this variant"),
                                        Error::IncorrectKeyMaterialException{message, } => panic!("field does not exist on this variant"),
                                        Error::IncorrectTrustAnchorException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidAliasNameException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidArnException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidCiphertextException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidGrantIdException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidGrantTokenException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidImportTokenException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidKeyUsageException{message, } => panic!("field does not exist on this variant"),
                                        Error::InvalidMarkerException{message, } => panic!("field does not exist on this variant"),
                                        Error::KeyUnavailableException{message, } => panic!("field does not exist on this variant"),
                                        Error::KMSInternalException{message, } => panic!("field does not exist on this variant"),
                                        Error::KMSInvalidMacException{message, } => panic!("field does not exist on this variant"),
                                        Error::KMSInvalidSignatureException{message, } => panic!("field does not exist on this variant"),
                                        Error::KMSInvalidStateException{message, } => panic!("field does not exist on this variant"),
                                        Error::LimitExceededException{message, } => panic!("field does not exist on this variant"),
                                        Error::MalformedPolicyDocumentException{message, } => panic!("field does not exist on this variant"),
                                        Error::NotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::TagException{message, } => panic!("field does not exist on this variant"),
                                        Error::UnsupportedOperationException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksKeyAlreadyInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksKeyInvalidConfigurationException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksKeyNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyIncorrectAuthenticationCredentialException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyInvalidConfigurationException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyInvalidResponseException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyUriEndpointInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyUriInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyUriUnreachableException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyVpcEndpointServiceInUseException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyVpcEndpointServiceInvalidConfigurationException{message, } => panic!("field does not exist on this variant"),
                                        Error::XksProxyVpcEndpointServiceNotFoundException{message, } => panic!("field does not exist on this variant"),
                                        Error::Opaque{obj, } => panic!("field does not exist on this variant"),
                                        Error::OpaqueWithText{obj, objMessage, } => objMessage,
                                    }
                                }
                            }

                            impl Debug
                                for Error {
                                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                                    DafnyPrint::fmt_print(self, f, true)
                                }
                            }

                            impl DafnyPrint
                                for Error {
                                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                                    match self {
                                        Error::AlreadyExistsException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.AlreadyExistsException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::CloudHsmClusterInUseException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.CloudHsmClusterInUseException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::CloudHsmClusterInvalidConfigurationException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.CloudHsmClusterInvalidConfigurationException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::CloudHsmClusterNotActiveException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.CloudHsmClusterNotActiveException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::CloudHsmClusterNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.CloudHsmClusterNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::CloudHsmClusterNotRelatedException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.CloudHsmClusterNotRelatedException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ConflictException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.ConflictException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::CustomKeyStoreHasCMKsException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.CustomKeyStoreHasCMKsException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::CustomKeyStoreInvalidStateException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.CustomKeyStoreInvalidStateException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::CustomKeyStoreNameInUseException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.CustomKeyStoreNameInUseException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::CustomKeyStoreNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.CustomKeyStoreNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::DependencyTimeoutException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.DependencyTimeoutException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::DisabledException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.DisabledException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::DryRunOperationException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.DryRunOperationException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::ExpiredImportTokenException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.ExpiredImportTokenException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::IncorrectKeyException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.IncorrectKeyException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::IncorrectKeyMaterialException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.IncorrectKeyMaterialException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::IncorrectTrustAnchorException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.IncorrectTrustAnchorException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidAliasNameException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.InvalidAliasNameException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidArnException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.InvalidArnException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidCiphertextException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.InvalidCiphertextException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidGrantIdException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.InvalidGrantIdException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidGrantTokenException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.InvalidGrantTokenException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidImportTokenException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.InvalidImportTokenException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidKeyUsageException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.InvalidKeyUsageException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::InvalidMarkerException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.InvalidMarkerException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::KeyUnavailableException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.KeyUnavailableException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::KMSInternalException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.KMSInternalException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::KMSInvalidMacException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.KMSInvalidMacException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::KMSInvalidSignatureException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.KMSInvalidSignatureException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::KMSInvalidStateException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.KMSInvalidStateException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::LimitExceededException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.LimitExceededException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::MalformedPolicyDocumentException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.MalformedPolicyDocumentException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::NotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.NotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::TagException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.TagException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::UnsupportedOperationException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.UnsupportedOperationException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksKeyAlreadyInUseException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksKeyAlreadyInUseException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksKeyInvalidConfigurationException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksKeyInvalidConfigurationException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksKeyNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksKeyNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksProxyIncorrectAuthenticationCredentialException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksProxyIncorrectAuthenticationCredentialException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksProxyInvalidConfigurationException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksProxyInvalidConfigurationException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksProxyInvalidResponseException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksProxyInvalidResponseException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksProxyUriEndpointInUseException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksProxyUriEndpointInUseException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksProxyUriInUseException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksProxyUriInUseException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksProxyUriUnreachableException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksProxyUriUnreachableException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksProxyVpcEndpointServiceInUseException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksProxyVpcEndpointServiceInUseException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksProxyVpcEndpointServiceInvalidConfigurationException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksProxyVpcEndpointServiceInvalidConfigurationException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::XksProxyVpcEndpointServiceNotFoundException{message, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.XksProxyVpcEndpointServiceNotFoundException(")?;
                                            DafnyPrint::fmt_print(message, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::Opaque{obj, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.Opaque(")?;
                                            DafnyPrint::fmt_print(obj, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                        Error::OpaqueWithText{obj, objMessage, } => {
                                            write!(_formatter, "software.amazon.cryptography.services.kms.internaldafny.types.Error.OpaqueWithText(")?;
                                            DafnyPrint::fmt_print(obj, _formatter, false)?;
                                            write!(_formatter, ", ")?;
                                            DafnyPrint::fmt_print(objMessage, _formatter, false)?;
                                            write!(_formatter, ")")?;
                                            Ok(())
                                        },
                                    }
                                }
                            }

                            impl Eq
                                for Error {}

                            impl Hash
                                for Error {
                                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                                    match self {
                                        Error::AlreadyExistsException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::CloudHsmClusterInUseException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::CloudHsmClusterInvalidConfigurationException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::CloudHsmClusterNotActiveException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::CloudHsmClusterNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::CloudHsmClusterNotRelatedException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ConflictException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::CustomKeyStoreHasCMKsException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::CustomKeyStoreInvalidStateException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::CustomKeyStoreNameInUseException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::CustomKeyStoreNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::DependencyTimeoutException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::DisabledException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::DryRunOperationException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::ExpiredImportTokenException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::IncorrectKeyException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::IncorrectKeyMaterialException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::IncorrectTrustAnchorException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InvalidAliasNameException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InvalidArnException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InvalidCiphertextException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InvalidGrantIdException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InvalidGrantTokenException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InvalidImportTokenException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InvalidKeyUsageException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::InvalidMarkerException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::KeyUnavailableException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::KMSInternalException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::KMSInvalidMacException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::KMSInvalidSignatureException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::KMSInvalidStateException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::LimitExceededException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::MalformedPolicyDocumentException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::NotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::TagException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::UnsupportedOperationException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksKeyAlreadyInUseException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksKeyInvalidConfigurationException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksKeyNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksProxyIncorrectAuthenticationCredentialException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksProxyInvalidConfigurationException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksProxyInvalidResponseException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksProxyUriEndpointInUseException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksProxyUriInUseException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksProxyUriUnreachableException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksProxyVpcEndpointServiceInUseException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksProxyVpcEndpointServiceInvalidConfigurationException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::XksProxyVpcEndpointServiceNotFoundException{message, } => {
                                            Hash::hash(message, _state)
                                        },
                                        Error::Opaque{obj, } => {
                                            Hash::hash(obj, _state)
                                        },
                                        Error::OpaqueWithText{obj, objMessage, } => {
                                            Hash::hash(obj, _state);
                                            Hash::hash(objMessage, _state)
                                        },
                                    }
                                }
                            }

                            impl Default
                                for Error {
                                fn default() -> Error {
                                    Error::AlreadyExistsException {
                                        message: Default::default()
                                    }
                                }
                            }

                            impl AsRef<Error>
                                for Error {
                                fn as_ref(&self) -> &Self {
                                    self
                                }
                            }

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1982,3)
                            pub type OpaqueError = Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>;

                            /// ../mpl/ComAmazonawsKms/Model/ComAmazonawsKmsTypes.dfy(1985,3)
                            pub type DummySubsetType = DafnyInt;

                            /// An element of DummySubsetType
                            pub fn __init_DummySubsetType() -> DafnyInt {
                                int!(1)
                            }
                        }
                    }
                }
            }

            pub mod internaldafny {
                /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTrackingCMC.dfy(6,1)
                pub mod StormTrackingCMC {
                    pub use ::std::sync::Arc;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryOutput;
                    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
                    pub use crate::implementation_from_dafny::_dafny_externs::software::amazon::cryptography::internaldafny::StormTrackingCMC::*;

                    pub struct _default {}

                    impl _default {
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTrackingCMC.dfy(90,3)
                        pub fn CreateGetCacheEntrySuccess(output: &Arc<GetCacheEntryOutput>) -> Arc<Result<Arc<GetCacheEntryOutput>, Arc<Error>>> {
                            Arc::new(Result::<Arc<GetCacheEntryOutput>, Arc<Error>>::Success {
                                    value: output.clone()
                                })
                        }
                        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTrackingCMC.dfy(94,3)
                        pub fn CreateGetCacheEntryFailure(error: &Arc<Error>) -> Arc<Result<Arc<GetCacheEntryOutput>, Arc<Error>>> {
                            Arc::new(Result::<Arc<GetCacheEntryOutput>, Arc<Error>>::Failure {
                                    error: error.clone()
                                })
                        }
                    }
                }

                /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/SynchronizedLocalCMC.dfy(6,1)
                pub mod SynchronizedLocalCMC {
                    pub use crate::implementation_from_dafny::_dafny_externs::software::amazon::cryptography::internaldafny::SynchronizedLocalCMC::*;
                }
            }
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(7,1)
pub mod _AwsArnParsing_Compile {
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier::AwsKmsArnIdentifier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::seq;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(86,3)
        pub fn ValidAwsKmsResource(resource: &Arc<AwsResource>) -> bool {
            resource.Valid() && (resource.resourceType().clone() == string_utf16_of("key") || resource.resourceType().clone() == string_utf16_of("alias"))
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(95,3)
        pub fn ValidAwsKmsArn(arn: &Arc<AwsArn>) -> bool {
            arn.Valid() && arn.service().clone() == string_utf16_of("kms") && _default::ValidAwsKmsResource(arn.resource())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(121,3)
        pub fn ParseAwsKmsRawResources(identifier: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AwsKmsResource, Sequence<DafnyCharUTF16>>> {
            let mut info: Sequence<Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Split::<DafnyCharUTF16>(identifier, &DafnyCharUTF16(47 as u16));
            let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(info.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) != string_utf16_of("key"), &string_utf16_of("Malformed raw key id: ").concat(identifier));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<AwsKmsResource>()
            } else {
                if truncate!(info.cardinality(), u64) == 1 {
                    _default::ParseAwsKmsResources(&string_utf16_of("key/").concat(identifier))
                } else {
                    _default::ParseAwsKmsResources(identifier)
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(134,3)
        pub fn ParseAwsKmsResources(identifier: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AwsKmsResource, Sequence<DafnyCharUTF16>>> {
            let mut info: Sequence<Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Split::<DafnyCharUTF16>(identifier, &DafnyCharUTF16(47 as u16));
            let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(1 < truncate!(info.cardinality(), u64), &string_utf16_of("Malformed resource: ").concat(identifier));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<AwsResource>>()
            } else {
                let mut resourceType: Sequence<DafnyCharUTF16> = info.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()));
                let mut value: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Join::<DafnyCharUTF16>(&info.drop(&int!((&truncate!((&int!(1)).clone(), u32)).clone())), &string_utf16_of("/"));
                let mut resource: Arc<AwsResource> = Arc::new(AwsResource::AwsResource {
                            resourceType: resourceType.clone(),
                            value: value.clone()
                        });
                let mut valueOrError1: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(_default::ValidAwsKmsResource(&resource), &string_utf16_of("Malformed resource: ").concat(identifier));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<AwsResource>>()
                } else {
                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<AwsResource>, Sequence<DafnyCharUTF16>>::Success {
                            value: resource.clone()
                        })
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(151,3)
        pub fn ValidAmazonDynamodbResource(resource: &Arc<AwsResource>) -> bool {
            resource.Valid() && resource.resourceType().clone() == string_utf16_of("table")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(160,3)
        pub fn ValidAmazonDynamodbArn(arn: &Arc<AwsArn>) -> bool {
            arn.Valid() && arn.service().clone() == string_utf16_of("dynamodb") && _default::ValidAmazonDynamodbResource(arn.resource())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(183,3)
        pub fn ParseAmazonDynamodbResources(identifier: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AmazonDynamodbResource, Sequence<DafnyCharUTF16>>> {
            let mut info: Arc<Option<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>)>> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::_SplitOnce_q::<DafnyCharUTF16>(identifier, &DafnyCharUTF16(47 as u16));
            let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(matches!((&info).as_ref(), Some{ .. }), &string_utf16_of("Malformed resource: ").concat(identifier));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<AwsResource>>()
            } else {
                let mut resourceType: Sequence<DafnyCharUTF16> = info.value().0.clone();
                let mut value: Sequence<DafnyCharUTF16> = info.value().1.clone();
                let mut valueOrError1: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::_default::IsValid_TableName(&value), &string_utf16_of("Table Name invalid: ").concat(identifier));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<AwsResource>>()
                } else {
                    let mut resource: Arc<AwsResource> = Arc::new(AwsResource::AwsResource {
                                resourceType: resourceType.clone(),
                                value: value.clone()
                            });
                    let mut valueOrError2: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(_default::ValidAmazonDynamodbResource(&resource), &string_utf16_of("Malformed resource: ").concat(identifier));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<AwsResource>>()
                    } else {
                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<AwsResource>, Sequence<DafnyCharUTF16>>::Success {
                                value: resource.clone()
                            })
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(240,3)
        pub fn ParseAwsKmsArn(identifier: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AwsKmsArn, Sequence<DafnyCharUTF16>>> {
            let mut components: Sequence<Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Split::<DafnyCharUTF16>(identifier, &DafnyCharUTF16(58 as u16));
            let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(6 == truncate!(components.cardinality(), u64), &string_utf16_of("Malformed arn: ").concat(identifier));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<AwsArn>>()
            } else {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AwsKmsResource, Sequence<DafnyCharUTF16>>> = _default::ParseAwsKmsResources(&components.get(&int!((&truncate!((&int!(5)).clone(), u32)).clone())));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<AwsArn>>()
                } else {
                    let mut resource: AwsKmsResource = valueOrError1.Extract();
                    let mut arn: Arc<AwsArn> = Arc::new(AwsArn::AwsArn {
                                arnLiteral: components.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())),
                                partition: components.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())),
                                service: components.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())),
                                region: components.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())),
                                account: components.get(&int!((&truncate!((&int!(4)).clone(), u32)).clone())),
                                resource: resource.clone()
                            });
                    let mut valueOrError2: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(_default::ValidAwsKmsArn(&arn), &string_utf16_of("Malformed Arn:").concat(identifier));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<AwsArn>>()
                    } else {
                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<AwsArn>, Sequence<DafnyCharUTF16>>::Success {
                                value: arn.clone()
                            })
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(271,3)
        pub fn ParseAmazonDynamodbTableArn(identifier: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AmazonDynamodbTableArn, Sequence<DafnyCharUTF16>>> {
            let mut components: Sequence<Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Split::<DafnyCharUTF16>(identifier, &DafnyCharUTF16(58 as u16));
            let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(6 == truncate!(components.cardinality(), u64), &string_utf16_of("Malformed arn: ").concat(identifier));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<AwsArn>>()
            } else {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AmazonDynamodbResource, Sequence<DafnyCharUTF16>>> = _default::ParseAmazonDynamodbResources(&components.get(&int!((&truncate!((&int!(5)).clone(), u32)).clone())));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<AwsArn>>()
                } else {
                    let mut resource: AmazonDynamodbResource = valueOrError1.Extract();
                    let mut arn: Arc<AwsArn> = Arc::new(AwsArn::AwsArn {
                                arnLiteral: components.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())),
                                partition: components.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())),
                                service: components.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())),
                                region: components.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())),
                                account: components.get(&int!((&truncate!((&int!(4)).clone(), u32)).clone())),
                                resource: resource.clone()
                            });
                    let mut valueOrError2: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(_default::ValidAmazonDynamodbArn(&arn), &string_utf16_of("Malformed Arn:").concat(identifier));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<AwsArn>>()
                    } else {
                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<AwsArn>, Sequence<DafnyCharUTF16>>::Success {
                                value: arn.clone()
                            })
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(339,3)
        pub fn ParseAwsKmsIdentifier(identifier: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>> {
            if string_utf16_of("arn:") <= identifier.clone() {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AwsKmsArn, Sequence<DafnyCharUTF16>>> = _default::ParseAwsKmsArn(identifier);
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<AwsKmsIdentifier>>()
                } else {
                    let mut arn: AwsKmsArn = valueOrError0.Extract();
                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>::Success {
                            value: Arc::new(AwsKmsIdentifier::AwsKmsArnIdentifier {
                                        a: arn.clone()
                                    })
                        })
                }
            } else {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AwsKmsResource, Sequence<DafnyCharUTF16>>> = _default::ParseAwsKmsRawResources(identifier);
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<AwsKmsIdentifier>>()
                } else {
                    let mut r: AwsKmsResource = valueOrError1.Extract();
                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>::Success {
                            value: Arc::new(AwsKmsIdentifier::AwsKmsRawResourceIdentifier {
                                        r: r.clone()
                                    })
                        })
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(349,3)
        pub fn ParseAmazonDynamodbTableName(identifier: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AmazonDynamodbTableArn, Sequence<DafnyCharUTF16>>> = _default::ParseAmazonDynamodbTableArn(identifier);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Sequence<DafnyCharUTF16>>()
            } else {
                let mut arn: AmazonDynamodbTableArn = valueOrError0.Extract();
                let mut tableArn: Arc<AmazonDynamodbTableName> = Arc::new(AmazonDynamodbTableName::AmazonDynamodbTableArn {
                            a: arn.clone()
                        });
                let mut tableName: Sequence<DafnyCharUTF16> = tableArn.GetTableName();
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::Success {
                        value: tableName.clone()
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(361,3)
        pub fn IsMultiRegionAwsKmsArn(arn: &AwsKmsArn) -> bool {
            _default::IsMultiRegionAwsKmsResource(arn.resource())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(392,3)
        pub fn IsMultiRegionAwsKmsIdentifier(identifier: &Arc<AwsKmsIdentifier>) -> bool {
            let mut _source0: Arc<AwsKmsIdentifier> = identifier.clone();
            if matches!((&_source0).as_ref(), AwsKmsArnIdentifier{ .. }) {
                let mut ___mcc_h0: AwsKmsArn = _source0.a().clone();
                let mut arn: AwsKmsArn = ___mcc_h0.clone();
                _default::IsMultiRegionAwsKmsArn(&arn)
            } else {
                let mut ___mcc_h1: AwsKmsResource = _source0.r().clone();
                let mut r: AwsKmsResource = ___mcc_h1.clone();
                _default::IsMultiRegionAwsKmsResource(&r)
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(448,3)
        pub fn IsMultiRegionAwsKmsResource(resource: &AwsKmsResource) -> bool {
            resource.resourceType().clone() == string_utf16_of("key") && string_utf16_of("mrk-") <= resource.value().clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(453,3)
        pub fn GetRegion(identifier: &Arc<AwsKmsIdentifier>) -> Arc<Option<Sequence<DafnyCharUTF16>>> {
            let mut _source0: Arc<AwsKmsIdentifier> = identifier.clone();
            if matches!((&_source0).as_ref(), AwsKmsArnIdentifier{ .. }) {
                let mut ___mcc_h0: AwsKmsArn = _source0.a().clone();
                let mut a: AwsKmsArn = ___mcc_h0.clone();
                Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                        value: a.region().clone()
                    })
            } else {
                let mut ___mcc_h1: AwsKmsResource = _source0.r().clone();
                Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {})
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(463,3)
        pub fn IsAwsKmsIdentifierString(s: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>> {
            let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(crate::implementation_from_dafny::UTF8::_default::IsASCIIString(s), &string_utf16_of("Not a valid ASCII string."));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<AwsKmsIdentifier>>()
            } else {
                let mut valueOrError1: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(0 < truncate!(s.cardinality(), u64) && truncate!(s.cardinality(), u64) <= _default::MAX_AWS_KMS_IDENTIFIER_LENGTH(), &string_utf16_of("Identifier exceeds maximum length."));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<AwsKmsIdentifier>>()
                } else {
                    _default::ParseAwsKmsIdentifier(s)
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(477,3)
        pub fn Error(s: &Sequence<DafnyCharUTF16>) -> Arc<Error> {
            Arc::new(Error::AwsCryptographicMaterialProvidersException {
                    message: s.clone()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(481,3)
        pub fn ValidateDdbTableArn(tableArn: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = _default::ParseAmazonDynamodbTableName(tableArn).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| _default::Error(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<()>()
            } else {
                let mut _v1: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
                let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::UTF8::_default::IsASCIIString(tableArn), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Table Arn is not ASCII")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<()>()
                } else {
                    let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::_default::IsValid_TableName(_default::ParseAmazonDynamodbTableName(tableArn).value()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Table Name is too long")
                                }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<()>()
                    } else {
                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<Error>>::Success {
                                value: ()
                            })
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(17,3)
        pub fn MAX_AWS_KMS_IDENTIFIER_LENGTH() -> u64 {
            2048
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(19,3)
    #[derive(PartialEq, Clone)]
    pub enum AwsResource {
        AwsResource {
            resourceType: Sequence<DafnyCharUTF16>,
            value: Sequence<DafnyCharUTF16>
        }
    }

    impl AwsResource {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(23,5)
        pub fn Valid(self: &Arc<Self>) -> bool {
            true && 0 < truncate!(self.value().cardinality(), u64)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(29,5)
        pub fn ToString(self: &Arc<Self>) -> Sequence<DafnyCharUTF16> {
            self.resourceType().concat(&string_utf16_of("/")).concat(self.value())
        }
        /// Returns a borrow of the field resourceType
        pub fn resourceType(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                AwsResource::AwsResource{resourceType, value, } => resourceType,
            }
        }
        /// Returns a borrow of the field value
        pub fn value(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                AwsResource::AwsResource{resourceType, value, } => value,
            }
        }
    }

    impl Debug
        for AwsResource {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for AwsResource {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                AwsResource::AwsResource{resourceType, value, } => {
                    write!(_formatter, "AwsArnParsing_Compile.AwsResource.AwsResource(")?;
                    DafnyPrint::fmt_print(resourceType, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(value, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for AwsResource {}

    impl Hash
        for AwsResource {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                AwsResource::AwsResource{resourceType, value, } => {
                    Hash::hash(resourceType, _state);
                    Hash::hash(value, _state)
                },
            }
        }
    }

    impl Default
        for AwsResource {
        fn default() -> AwsResource {
            AwsResource::AwsResource {
                resourceType: Default::default(),
                value: Default::default()
            }
        }
    }

    impl AsRef<AwsResource>
        for AwsResource {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(38,3)
    #[derive(PartialEq, Clone)]
    pub enum AwsArn {
        AwsArn {
            arnLiteral: Sequence<DafnyCharUTF16>,
            partition: Sequence<DafnyCharUTF16>,
            service: Sequence<DafnyCharUTF16>,
            region: Sequence<DafnyCharUTF16>,
            account: Sequence<DafnyCharUTF16>,
            resource: Arc<AwsResource>
        }
    }

    impl AwsArn {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(46,5)
        pub fn Valid(self: &Arc<Self>) -> bool {
            self.arnLiteral().clone() == string_utf16_of("arn") && 0 < truncate!(self.partition().cardinality(), u64) && 0 < truncate!(self.service().cardinality(), u64) && 0 < truncate!(self.region().cardinality(), u64) && 0 < truncate!(self.account().cardinality(), u64) && self.resource().Valid()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(60,5)
        pub fn ToString(self: &Arc<Self>) -> Sequence<DafnyCharUTF16> {
            self.ToArnString(&Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {}))
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(66,5)
        pub fn ToArnString(self: &Arc<Self>, customRegion: &Arc<Option<Sequence<DafnyCharUTF16>>>) -> Sequence<DafnyCharUTF16> {
            let mut _this = self.clone();
            let mut _r0 = customRegion.clone();
            'TAIL_CALL_START: loop {
                let customRegion = _r0;
                let mut _source0: Arc<Option<Sequence<DafnyCharUTF16>>> = customRegion.clone();
                if matches!((&_source0).as_ref(), None{ .. }) {
                    let mut _in0: Arc<AwsArn> = _this.clone();
                    let mut _in1: Arc<Option<Sequence<DafnyCharUTF16>>> = Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                value: _this.region().clone()
                            });
                    _this = _in0.clone();
                    _r0 = _in1.clone();
                    continue 'TAIL_CALL_START;
                } else {
                    let mut ___mcc_h0: Sequence<DafnyCharUTF16> = _source0.value().clone();
                    let mut customRegion: Sequence<DafnyCharUTF16> = ___mcc_h0.clone();
                    return crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Join::<DafnyCharUTF16>(&seq![_this.arnLiteral().clone(), _this.partition().clone(), _this.service().clone(), customRegion.clone(), _this.account().clone(), _this.resource().ToString()], &string_utf16_of(":"));
                }
            }
        }
        /// Returns a borrow of the field arnLiteral
        pub fn arnLiteral(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                AwsArn::AwsArn{arnLiteral, partition, service, region, account, resource, } => arnLiteral,
            }
        }
        /// Returns a borrow of the field partition
        pub fn partition(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                AwsArn::AwsArn{arnLiteral, partition, service, region, account, resource, } => partition,
            }
        }
        /// Returns a borrow of the field service
        pub fn service(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                AwsArn::AwsArn{arnLiteral, partition, service, region, account, resource, } => service,
            }
        }
        /// Returns a borrow of the field region
        pub fn region(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                AwsArn::AwsArn{arnLiteral, partition, service, region, account, resource, } => region,
            }
        }
        /// Returns a borrow of the field account
        pub fn account(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                AwsArn::AwsArn{arnLiteral, partition, service, region, account, resource, } => account,
            }
        }
        /// Returns a borrow of the field resource
        pub fn resource(&self) -> &Arc<AwsResource> {
            match self {
                AwsArn::AwsArn{arnLiteral, partition, service, region, account, resource, } => resource,
            }
        }
    }

    impl Debug
        for AwsArn {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for AwsArn {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                AwsArn::AwsArn{arnLiteral, partition, service, region, account, resource, } => {
                    write!(_formatter, "AwsArnParsing_Compile.AwsArn.AwsArn(")?;
                    DafnyPrint::fmt_print(arnLiteral, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(partition, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(service, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(region, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(account, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(resource, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for AwsArn {}

    impl Hash
        for AwsArn {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                AwsArn::AwsArn{arnLiteral, partition, service, region, account, resource, } => {
                    Hash::hash(arnLiteral, _state);
                    Hash::hash(partition, _state);
                    Hash::hash(service, _state);
                    Hash::hash(region, _state);
                    Hash::hash(account, _state);
                    Hash::hash(resource, _state)
                },
            }
        }
    }

    impl Default
        for AwsArn {
        fn default() -> AwsArn {
            AwsArn::AwsArn {
                arnLiteral: Default::default(),
                partition: Default::default(),
                service: Default::default(),
                region: Default::default(),
                account: Default::default(),
                resource: Default::default()
            }
        }
    }

    impl AsRef<AwsArn>
        for AwsArn {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(102,3)
    pub type AwsKmsArn = Arc<AwsArn>;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(105,3)
    pub type AwsKmsResource = Arc<AwsResource>;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(108,3)
    #[derive(PartialEq, Clone)]
    pub enum AwsKmsIdentifier {
        AwsKmsArnIdentifier {
            a: AwsKmsArn
        },
        AwsKmsRawResourceIdentifier {
            r: AwsKmsResource
        }
    }

    impl AwsKmsIdentifier {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(112,5)
        pub fn ToString(self: &Arc<Self>) -> Sequence<DafnyCharUTF16> {
            let mut _source0: Arc<AwsKmsIdentifier> = self.clone();
            if matches!((&_source0).as_ref(), AwsKmsArnIdentifier{ .. }) {
                let mut ___mcc_h0: AwsKmsArn = _source0.a().clone();
                let mut a: AwsKmsArn = ___mcc_h0.clone();
                AwsArn::ToString(&a)
            } else {
                let mut ___mcc_h1: AwsKmsResource = _source0.r().clone();
                let mut r: AwsKmsResource = ___mcc_h1.clone();
                AwsResource::ToString(&r)
            }
        }
        /// Gets the field a for all enum members which have it
        pub fn a(&self) -> &AwsKmsArn {
            match self {
                AwsKmsIdentifier::AwsKmsArnIdentifier{a, } => a,
                AwsKmsIdentifier::AwsKmsRawResourceIdentifier{r, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field r for all enum members which have it
        pub fn r(&self) -> &AwsKmsResource {
            match self {
                AwsKmsIdentifier::AwsKmsArnIdentifier{a, } => panic!("field does not exist on this variant"),
                AwsKmsIdentifier::AwsKmsRawResourceIdentifier{r, } => r,
            }
        }
    }

    impl Debug
        for AwsKmsIdentifier {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for AwsKmsIdentifier {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                AwsKmsIdentifier::AwsKmsArnIdentifier{a, } => {
                    write!(_formatter, "AwsArnParsing_Compile.AwsKmsIdentifier.AwsKmsArnIdentifier(")?;
                    DafnyPrint::fmt_print(a, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
                AwsKmsIdentifier::AwsKmsRawResourceIdentifier{r, } => {
                    write!(_formatter, "AwsArnParsing_Compile.AwsKmsIdentifier.AwsKmsRawResourceIdentifier(")?;
                    DafnyPrint::fmt_print(r, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for AwsKmsIdentifier {}

    impl Hash
        for AwsKmsIdentifier {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                AwsKmsIdentifier::AwsKmsArnIdentifier{a, } => {
                    Hash::hash(a, _state)
                },
                AwsKmsIdentifier::AwsKmsRawResourceIdentifier{r, } => {
                    Hash::hash(r, _state)
                },
            }
        }
    }

    impl Default
        for AwsKmsIdentifier {
        fn default() -> AwsKmsIdentifier {
            AwsKmsIdentifier::AwsKmsArnIdentifier {
                a: Default::default()
            }
        }
    }

    impl AsRef<AwsKmsIdentifier>
        for AwsKmsIdentifier {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(167,3)
    pub type AmazonDynamodbTableArn = Arc<AwsArn>;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(170,3)
    pub type AmazonDynamodbResource = Arc<AwsResource>;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(173,3)
    #[derive(PartialEq, Clone)]
    pub enum AmazonDynamodbTableName {
        AmazonDynamodbTableArn {
            a: AmazonDynamodbTableArn
        }
    }

    impl AmazonDynamodbTableName {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(175,5)
        pub fn GetTableName(self: &Arc<Self>) -> Sequence<DafnyCharUTF16> {
            let mut _source0: Arc<AmazonDynamodbTableName> = self.clone();
            let mut ___mcc_h0: AmazonDynamodbTableArn = _source0.a().clone();
            let mut a: AmazonDynamodbTableArn = ___mcc_h0.clone();
            a.resource().value().clone()
        }
        /// Returns a borrow of the field a
        pub fn a(&self) -> &AmazonDynamodbTableArn {
            match self {
                AmazonDynamodbTableName::AmazonDynamodbTableArn{a, } => a,
            }
        }
    }

    impl Debug
        for AmazonDynamodbTableName {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for AmazonDynamodbTableName {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                AmazonDynamodbTableName::AmazonDynamodbTableArn{a, } => {
                    write!(_formatter, "AwsArnParsing_Compile.AmazonDynamodbTableName.AmazonDynamodbTableArn(")?;
                    DafnyPrint::fmt_print(a, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for AmazonDynamodbTableName {}

    impl Hash
        for AmazonDynamodbTableName {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                AmazonDynamodbTableName::AmazonDynamodbTableArn{a, } => {
                    Hash::hash(a, _state)
                },
            }
        }
    }

    impl Default
        for AmazonDynamodbTableName {
        fn default() -> AmazonDynamodbTableName {
            AmazonDynamodbTableName::AmazonDynamodbTableArn {
                a: Default::default()
            }
        }
    }

    impl AsRef<AmazonDynamodbTableName>
        for AmazonDynamodbTableName {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsArnParsing.dfy(473,3)
    pub type AwsKmsIdentifierString = Sequence<DafnyCharUTF16>;
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(13,1)
pub mod _AwsCryptographyKeyStoreOperations_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetKeyStoreInfoOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyStoreInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyStoreOutput;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyOutput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::dafny_runtime::map;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::SetBuilder;
    pub use ::dafny_runtime::MapBuilder;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::VersionKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::VersionKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBranchKeyVersionInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBranchKeyVersionOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBeaconKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBeaconKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// = aws-encryption-sdk-specification/framework/branch-key-store.md#getkeystoreinfo
        /// = type=implication
        /// # This operation MUST return the keystore information in this keystore configuration.
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(59,3)
        pub fn GetKeyStoreInfo(config: &Arc<Config>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetKeyStoreInfoOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetKeyStoreInfoOutput>, Arc<Error>>> = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GetKeyStoreInfoOutput>, Arc<Error>>::Success {
                        value: Arc::new(GetKeyStoreInfoOutput::GetKeyStoreInfoOutput {
                                    keyStoreId: config.id().clone(),
                                    keyStoreName: config.ddbTableName().clone(),
                                    logicalKeyStoreName: config.logicalKeyStoreName().clone(),
                                    grantTokens: config.grantTokens().clone(),
                                    kmsConfiguration: config.kmsConfiguration().clone()
                                })
                    });
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(88,3)
        pub fn CreateKeyStore(config: &Arc<Config>, input: &Arc<CreateKeyStoreInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CreateKeyStoreOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CreateKeyStoreOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::_CreateKeyStoreTable_Compile::_default::CreateKeyStoreTable(config.ddbTableName(), config.ddbClient());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<CreateKeyStoreOutput>>());
                return output.read();
            };
            let mut ddbTableArn: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
            let mut tableName: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAmazonDynamodbTableName(&ddbTableArn);
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!((&tableName).as_ref(), Success{ .. }) && tableName.value().clone() == config.ddbTableName().clone(), &Arc::new(Error::KeyStoreException {
                            message: string_utf16_of("Configured DDB Table Name does not match parsed Table Name from DDB Table Arn.")
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<CreateKeyStoreOutput>>());
                return output.read();
            };
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<CreateKeyStoreOutput>, Arc<Error>>::Success {
                            value: Arc::new(CreateKeyStoreOutput::CreateKeyStoreOutput {
                                        tableArn: ddbTableArn.clone()
                                    })
                        }));
            return output.read();
        }
        /// = aws-encryption-sdk-specification/framework/branch-key-store.md#createkey
        /// = type=implication
        /// # If an optional branch key id is provided
        /// # and no encryption context is provided this operation MUST fail.
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(108,3)
        pub fn CreateKey(config: &Arc<Config>, input: &Arc<CreateKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CreateKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CreateKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(!matches!(input.branchKeyIdentifier().as_ref(), Some{ .. }) || matches!(input.encryptionContext().as_ref(), Some{ .. }) && 0 < truncate!(input.encryptionContext().value().cardinality(), u64), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::CUSTOM_BRANCH_KEY_ID_NEED_EC()
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::HasKeyId(config.kmsConfiguration()), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::DISCOVERY_CREATE_KEY_NOT_SUPPORTED()
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut branchKeyIdentifier: Sequence<DafnyCharUTF16>;
            if matches!(input.branchKeyIdentifier().as_ref(), None{ .. }) {
                let mut maybeBranchKeyId: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UUID::_default::GenerateUUID();
                maybeBranchKeyId = _out0.clone();
                let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = maybeBranchKeyId.MapFailure::<Arc<Error>>(&({
                            Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                    Arc::new(Error::KeyStoreException {
                                            message: e.clone()
                                        })
                                })
                        }));
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<CreateKeyOutput>>());
                    return output.read();
                };
                branchKeyIdentifier = valueOrError2.Extract();
            } else {
                let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(0 < truncate!(input.branchKeyIdentifier().value().cardinality(), u64), &Arc::new(Error::KeyStoreException {
                                message: string_utf16_of("Custom branch key id can not be an empty string.")
                            }));
                if valueOrError3.IsFailure() {
                    output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<CreateKeyOutput>>());
                    return output.read();
                };
                branchKeyIdentifier = input.branchKeyIdentifier().value().clone();
            };
            let mut _timestamp_q: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::Time::_default::GetCurrentTimeStamp();
            _timestamp_q = _out1.clone();
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = _timestamp_q.MapFailure::<Arc<Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                Arc::new(Error::KeyStoreException {
                                        message: e.clone()
                                    })
                            })
                    }));
            if valueOrError4.IsFailure() {
                output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut timestamp: Sequence<DafnyCharUTF16> = valueOrError4.Extract();
            let mut maybeBranchKeyVersion: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UUID::_default::GenerateUUID();
            maybeBranchKeyVersion = _out2.clone();
            let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = maybeBranchKeyVersion.MapFailure::<Arc<Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                Arc::new(Error::KeyStoreException {
                                        message: e.clone()
                                    })
                            })
                    }));
            if valueOrError5.IsFailure() {
                output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut branchKeyVersion: Sequence<DafnyCharUTF16> = valueOrError5.Extract();
            let mut unwrapEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = input.encryptionContext().UnwrapOr(&map![]);
            let mut encodedEncryptionContext: Set<(Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, ValidUTF8Bytes)> = (&({
                    let mut unwrapEncryptionContext = unwrapEncryptionContext.clone();
                    Arc::new(move || -> Set<(Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, ValidUTF8Bytes)>{
                            let mut _coll0: SetBuilder<(Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, ValidUTF8Bytes)> = SetBuilder::<(Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, ValidUTF8Bytes)>::new();
                            for __compr_0 in (&unwrapEncryptionContext).keys().iter().cloned() {
                                let mut k: ValidUTF8Bytes = __compr_0.clone();
                                if {
                                        let i: Sequence<u8> = k.clone();
                                        crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                    } {
                                    if unwrapEncryptionContext.contains(&k) {
                                        _coll0.add(&((
                                                crate::implementation_from_dafny::UTF8::_default::Decode(&k),
                                                crate::implementation_from_dafny::UTF8::_default::Decode(&unwrapEncryptionContext.get(&k)),
                                                k.clone()
                                            )))
                                    }
                                }
                            }
                            _coll0.build()
                        })
                }))();
            let mut valueOrError6: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>((&encodedEncryptionContext).iter().all(({
                            let mut encodedEncryptionContext = encodedEncryptionContext.clone();
                            Arc::new(move |__forall_var_0: &(Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, ValidUTF8Bytes)| -> bool{
                                    let mut i: (Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, ValidUTF8Bytes) = __forall_var_0.clone();
                                    !encodedEncryptionContext.contains(&i) || matches!((&i.0.clone()).as_ref(), Success{ .. }) && matches!((&i.1.clone()).as_ref(), Success{ .. }) && crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::_default::IsValid_AttributeName(&crate::implementation_from_dafny::_Structure_Compile::_default::ENCRYPTION_CONTEXT_PREFIX().concat(i.0.clone().value())) && ({
                                            let __pat_let0_0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(i.0.clone().value());
                                            {
                                                let encoded: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = __pat_let0_0.clone();
                                                matches!((&encoded).as_ref(), Success{ .. }) && i.2.clone() == encoded.value().clone()
                                            }
                                        })
                                })
                        }).as_ref()), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::UTF8_ENCODING_ENCRYPTION_CONTEXT_ERROR()
                        }));
            if valueOrError6.IsFailure() {
                output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CreateKeyOutput>, Arc<Error>>> = crate::implementation_from_dafny::_CreateKeys_Compile::_default::CreateBranchAndBeaconKeys(&branchKeyIdentifier, &(&({
                        let mut encodedEncryptionContext = encodedEncryptionContext.clone();
                        Arc::new(move || -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>{
                                let mut _coll1: MapBuilder<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = MapBuilder::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::new();
                                for __compr_1 in (&encodedEncryptionContext).iter().cloned() {
                                    let mut i: (Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>, ValidUTF8Bytes) = __compr_1.clone();
                                    if encodedEncryptionContext.contains(&i) {
                                        _coll1.add(i.0.clone().value(), i.1.clone().value())
                                    }
                                }
                                _coll1.build()
                            })
                    }))(), &timestamp, &branchKeyVersion, config.ddbTableName(), config.logicalKeyStoreName(), config.kmsConfiguration(), config.grantTokens(), config.kmsClient(), config.ddbClient());
            output = MaybePlacebo::from(_out3.clone());
            return output.read();
        }
        /// = aws-encryption-sdk-specification/framework/branch-key-store.md#versionkey
        /// = type=implication
        /// # If the Keystore's KMS Configuration is `Discovery` or `MRDiscovery`,
        /// # this operation MUST immediately fail.
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(211,3)
        pub fn VersionKey(config: &Arc<Config>, input: &Arc<VersionKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<VersionKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<VersionKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::HasKeyId(config.kmsConfiguration()), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::DISCOVERY_VERSION_KEY_NOT_SUPPORTED()
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<VersionKeyOutput>>());
                return output.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(0 < truncate!(input.branchKeyIdentifier().cardinality(), u64), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::BRANCH_KEY_ID_NEEDED()
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<VersionKeyOutput>>());
                return output.read();
            };
            let mut _timestamp_q: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::Time::_default::GetCurrentTimeStamp();
            _timestamp_q = _out0.clone();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = _timestamp_q.MapFailure::<Arc<Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                Arc::new(Error::KeyStoreException {
                                        message: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<VersionKeyOutput>>());
                return output.read();
            };
            let mut timestamp: Sequence<DafnyCharUTF16> = valueOrError2.Extract();
            let mut maybeBranchKeyVersion: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UUID::_default::GenerateUUID();
            maybeBranchKeyVersion = _out1.clone();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = maybeBranchKeyVersion.MapFailure::<Arc<Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                Arc::new(Error::KeyStoreException {
                                        message: e.clone()
                                    })
                            })
                    }));
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<VersionKeyOutput>>());
                return output.read();
            };
            let mut branchKeyVersion: Sequence<DafnyCharUTF16> = valueOrError3.Extract();
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<VersionKeyOutput>, Arc<Error>>> = crate::implementation_from_dafny::_CreateKeys_Compile::_default::VersionActiveBranchKey(input, &timestamp, &branchKeyVersion, config.ddbTableName(), config.logicalKeyStoreName(), config.kmsConfiguration(), config.grantTokens(), config.kmsClient(), config.ddbClient());
            output = MaybePlacebo::from(_out2.clone());
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(256,3)
        pub fn GetActiveBranchKey(config: &Arc<Config>, input: &Arc<GetActiveBranchKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetActiveBranchKeyOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetActiveBranchKeyOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetActiveBranchKeyOutput>, Arc<Error>>> = crate::implementation_from_dafny::_GetKeys_Compile::_default::GetActiveKeyAndUnwrap(input, config.ddbTableName(), config.logicalKeyStoreName(), config.kmsConfiguration(), config.grantTokens(), config.kmsClient(), config.ddbClient());
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(273,3)
        pub fn GetBranchKeyVersion(config: &Arc<Config>, input: &Arc<GetBranchKeyVersionInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBranchKeyVersionOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBranchKeyVersionOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBranchKeyVersionOutput>, Arc<Error>>> = crate::implementation_from_dafny::_GetKeys_Compile::_default::GetBranchKeyVersion(input, config.ddbTableName(), config.logicalKeyStoreName(), config.kmsConfiguration(), config.grantTokens(), config.kmsClient(), config.ddbClient());
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(290,3)
        pub fn GetBeaconKey(config: &Arc<Config>, input: &Arc<GetBeaconKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBeaconKeyOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBeaconKeyOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBeaconKeyOutput>, Arc<Error>>> = crate::implementation_from_dafny::_GetKeys_Compile::_default::GetBeaconKeyAndUnwrap(input, config.ddbTableName(), config.logicalKeyStoreName(), config.kmsConfiguration(), config.grantTokens(), config.kmsClient(), config.ddbClient());
            output = _out0.clone();
            return output.clone();
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/AwsCryptographyKeyStoreOperations.dfy(29,3)
    #[derive(PartialEq, Clone)]
    pub enum Config {
        Config {
            id: Sequence<DafnyCharUTF16>,
            ddbTableName: Sequence<DafnyCharUTF16>,
            logicalKeyStoreName: Sequence<DafnyCharUTF16>,
            kmsConfiguration: Arc<KMSConfiguration>,
            grantTokens: GrantTokenList,
            kmsClient: Object<dyn IKMSClient>,
            ddbClient: Object<dyn IDynamoDBClient>
        }
    }

    impl Config {
        /// Returns a borrow of the field id
        pub fn id(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Config::Config{id, ddbTableName, logicalKeyStoreName, kmsConfiguration, grantTokens, kmsClient, ddbClient, } => id,
            }
        }
        /// Returns a borrow of the field ddbTableName
        pub fn ddbTableName(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Config::Config{id, ddbTableName, logicalKeyStoreName, kmsConfiguration, grantTokens, kmsClient, ddbClient, } => ddbTableName,
            }
        }
        /// Returns a borrow of the field logicalKeyStoreName
        pub fn logicalKeyStoreName(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Config::Config{id, ddbTableName, logicalKeyStoreName, kmsConfiguration, grantTokens, kmsClient, ddbClient, } => logicalKeyStoreName,
            }
        }
        /// Returns a borrow of the field kmsConfiguration
        pub fn kmsConfiguration(&self) -> &Arc<KMSConfiguration> {
            match self {
                Config::Config{id, ddbTableName, logicalKeyStoreName, kmsConfiguration, grantTokens, kmsClient, ddbClient, } => kmsConfiguration,
            }
        }
        /// Returns a borrow of the field grantTokens
        pub fn grantTokens(&self) -> &GrantTokenList {
            match self {
                Config::Config{id, ddbTableName, logicalKeyStoreName, kmsConfiguration, grantTokens, kmsClient, ddbClient, } => grantTokens,
            }
        }
        /// Returns a borrow of the field kmsClient
        pub fn kmsClient(&self) -> &Object<dyn IKMSClient> {
            match self {
                Config::Config{id, ddbTableName, logicalKeyStoreName, kmsConfiguration, grantTokens, kmsClient, ddbClient, } => kmsClient,
            }
        }
        /// Returns a borrow of the field ddbClient
        pub fn ddbClient(&self) -> &Object<dyn IDynamoDBClient> {
            match self {
                Config::Config{id, ddbTableName, logicalKeyStoreName, kmsConfiguration, grantTokens, kmsClient, ddbClient, } => ddbClient,
            }
        }
    }

    impl Debug
        for Config {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Config {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Config::Config{id, ddbTableName, logicalKeyStoreName, kmsConfiguration, grantTokens, kmsClient, ddbClient, } => {
                    write!(_formatter, "AwsCryptographyKeyStoreOperations_Compile.Config.Config(")?;
                    DafnyPrint::fmt_print(id, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(ddbTableName, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(logicalKeyStoreName, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(kmsConfiguration, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(grantTokens, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(kmsClient, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(ddbClient, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for Config {}

    impl Hash
        for Config {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Config::Config{id, ddbTableName, logicalKeyStoreName, kmsConfiguration, grantTokens, kmsClient, ddbClient, } => {
                    Hash::hash(id, _state);
                    Hash::hash(ddbTableName, _state);
                    Hash::hash(logicalKeyStoreName, _state);
                    Hash::hash(kmsConfiguration, _state);
                    Hash::hash(grantTokens, _state);
                    Hash::hash(kmsClient, _state);
                    Hash::hash(ddbClient, _state)
                },
            }
        }
    }

    impl Default
        for Config {
        fn default() -> Config {
            Config::Config {
                id: Default::default(),
                ddbTableName: Default::default(),
                logicalKeyStoreName: Default::default(),
                kmsConfiguration: Default::default(),
                grantTokens: Default::default(),
                kmsClient: Default::default(),
                ddbClient: Default::default()
            }
        }
    }

    impl AsRef<Config>
        for Config {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(35,1)
pub mod _AwsCryptographyMaterialProvidersOperations_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsKeyringInput;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::AwsKmsKeyring;
    pub use ::dafny_runtime::rc_coerce;
    pub use ::dafny_runtime::upcast_object;
    pub use ::dafny_runtime::upcast_id;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsDiscoveryKeyringInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::_AwsKmsDiscoveryKeyring_Compile::AwsKmsDiscoveryKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMultiKeyringInput;
    pub use crate::implementation_from_dafny::_MultiKeyring_Compile::MultiKeyring;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultClientSupplierInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsDiscoveryMultiKeyringInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkKeyringInput;
    pub use crate::implementation_from_dafny::_AwsKmsMrkKeyring_Compile::AwsKmsMrkKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkMultiKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkDiscoveryKeyringInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_AwsKmsMrkDiscoveryKeyring_Compile::AwsKmsMrkDiscoveryKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsMrkDiscoveryMultiKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType::StormTracking;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::TimeUnits;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::TimeUnits::Seconds;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::euclidian_division;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::StormTrackingCache;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsHierarchicalKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DefaultCache;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateCryptographicMaterialsCacheInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType::No;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::NoCache;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType::SingleThreaded;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SingleThreadedCache;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType::MultiThreaded;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::MultiThreadedCache;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetKeyStoreInfoOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::IKeyStoreClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::_AwsKmsHierarchicalKeyring_Compile::AwsKmsHierarchicalKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsEcdhKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsEcdhStaticConfigurations;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsEcdhStaticConfigurations::KmsPublicKeyDiscovery;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsPublicKeyDiscoveryInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsPrivateKeyToStaticPublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey;
    pub use crate::implementation_from_dafny::_AwsKmsEcdhKeyring_Compile::AwsKmsEcdhKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateMultiKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawAesKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AesWrappingAlg;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AesWrappingAlg::ALG_AES128_GCM_IV12_TAG16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AesWrappingAlg::ALG_AES192_GCM_IV12_TAG16;
    pub use crate::implementation_from_dafny::_RawAESKeyring_Compile::RawAESKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawRsaKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPaddingMode;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PaddingScheme;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PaddingScheme::PKCS1;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PaddingScheme::OAEP_SHA1_MGF1;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PaddingScheme::OAEP_SHA256_MGF1;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PaddingScheme::OAEP_SHA384_MGF1;
    pub use crate::implementation_from_dafny::_RawRSAKeyring_Compile::RawRSAKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawEcdhKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations::PublicKeyDiscovery;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PublicKeyDiscoveryInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations::RawPrivateKeyToStaticPublicKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawPrivateKeyToStaticPublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EphemeralPrivateKeyToStaticPublicKeyInput;
    pub use crate::implementation_from_dafny::_RawECDHKeyring_Compile::RawEcdhKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsRsaKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec::RSAES_OAEP_SHA_1;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec::RSAES_OAEP_SHA_256;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetRSAKeyModulusLengthOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetRSAKeyModulusLengthInput;
    pub use crate::implementation_from_dafny::_AwsKmsRsaKeyring_Compile::AwsKmsRsaKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultCryptographicMaterialsManagerInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
    pub use crate::implementation_from_dafny::_DefaultCMM_Compile::DefaultCMM;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRequiredEncryptionContextCMMInput;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::SetBuilder;
    pub use crate::implementation_from_dafny::_RequiredEncryptionContextCMM_Compile::RequiredEncryptionContextCMM;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber;
    pub use crate::implementation_from_dafny::_StormTracker_Compile::StormTracker;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::internaldafny::StormTrackingCMC::StormTrackingCMC;
    pub use crate::implementation_from_dafny::_LocalCMC_Compile::LocalCMC;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::internaldafny::SynchronizedLocalCMC::SynchronizedLocalCMC;
    pub use crate::implementation_from_dafny::_DefaultClientSupplier_Compile::DefaultClientSupplier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeEncryptionMaterialsInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeDecryptionMaterialsInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidEncryptionMaterialsTransitionInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidDecryptionMaterialsTransitionInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(92,3)
        pub fn CreateAwsKmsKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(input.kmsKeyId());
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut _v0: () = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens());
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut grantTokens: Sequence<Sequence<DafnyCharUTF16>> = valueOrError1.Extract();
            let mut keyring: Object<AwsKmsKeyring>;
            let mut _nw0: Object<AwsKmsKeyring> = AwsKmsKeyring::_allocate_object();
            AwsKmsKeyring::_ctor(&_nw0, input.kmsClient(), input.kmsKeyId(), &grantTokens);
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<AwsKmsKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(104,3)
        pub fn CreateAwsKmsDiscoveryKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsDiscoveryKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            if matches!(input.discoveryFilter().as_ref(), Some{ .. }) {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateDiscoveryFilter(input.discoveryFilter().value());
                if valueOrError0.IsFailure() {
                    output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut _v1: () = valueOrError0.Extract();
            };
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens());
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut grantTokens: Sequence<Sequence<DafnyCharUTF16>> = valueOrError1.Extract();
            let mut keyring: Object<AwsKmsDiscoveryKeyring>;
            let mut _nw0: Object<AwsKmsDiscoveryKeyring> = AwsKmsDiscoveryKeyring::_allocate_object();
            AwsKmsDiscoveryKeyring::_ctor(&_nw0, input.kmsClient(), input.discoveryFilter(), &grantTokens);
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsDiscoveryKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<AwsKmsDiscoveryKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsDiscoveryKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(118,3)
        pub fn CreateAwsKmsMultiKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsMultiKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens());
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut grantTokens: Sequence<Sequence<DafnyCharUTF16>> = valueOrError0.Extract();
            if matches!(input.clientSupplier().as_ref(), Some{ .. }) {
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_StrictMultiKeyring_Compile::_default::StrictMultiKeyring(input.generator(), input.kmsKeyIds(), input.clientSupplier().value(), &Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::Some {
                                value: grantTokens.clone()
                            }));
                output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<MultiKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(_out0.clone()));
            } else {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CreateDefaultClientSupplier(config, &Arc::new(CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput {}));
                valueOrError1 = _out1.clone();
                if valueOrError1.IsFailure() {
                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut clientSupplier: Object<dyn IClientSupplier> = valueOrError1.Extract();
                let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_StrictMultiKeyring_Compile::_default::StrictMultiKeyring(input.generator(), input.kmsKeyIds(), &clientSupplier, &Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::Some {
                                value: grantTokens.clone()
                            }));
                output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<MultiKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(_out2.clone()));
            };
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(148,3)
        pub fn CreateAwsKmsDiscoveryMultiKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsDiscoveryMultiKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens());
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut grantTokens: Sequence<Sequence<DafnyCharUTF16>> = valueOrError0.Extract();
            let mut clientSupplier: Object<dyn IClientSupplier>;
            if matches!(input.clientSupplier().as_ref(), None{ .. }) {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CreateDefaultClientSupplier(config, &Arc::new(CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput {}));
                valueOrError1 = _out0.clone();
                if valueOrError1.IsFailure() {
                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                clientSupplier = valueOrError1.Extract();
            } else {
                clientSupplier = input.clientSupplier().value().clone();
            };
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_DiscoveryMultiKeyring_Compile::_default::DiscoveryMultiKeyring(input.regions(), input.discoveryFilter(), &clientSupplier, &Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::Some {
                            value: grantTokens.clone()
                        }));
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<MultiKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(_out1.clone()));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(173,3)
        pub fn CreateAwsKmsMrkKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsMrkKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(input.kmsKeyId());
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut _v2: () = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens());
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut grantTokens: Sequence<Sequence<DafnyCharUTF16>> = valueOrError1.Extract();
            let mut keyring: Object<AwsKmsMrkKeyring>;
            let mut _nw0: Object<AwsKmsMrkKeyring> = AwsKmsMrkKeyring::_allocate_object();
            AwsKmsMrkKeyring::_ctor(&_nw0, input.kmsClient(), input.kmsKeyId(), &grantTokens);
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsMrkKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<AwsKmsMrkKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsMrkKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(186,3)
        pub fn CreateAwsKmsMrkMultiKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsMrkMultiKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens());
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut grantTokens: Sequence<Sequence<DafnyCharUTF16>> = valueOrError0.Extract();
            let mut clientSupplier: Object<dyn IClientSupplier>;
            if matches!(input.clientSupplier().as_ref(), None{ .. }) {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CreateDefaultClientSupplier(config, &Arc::new(CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput {}));
                valueOrError1 = _out0.clone();
                if valueOrError1.IsFailure() {
                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                clientSupplier = valueOrError1.Extract();
            } else {
                clientSupplier = input.clientSupplier().value().clone();
            };
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_MrkAwareStrictMultiKeyring_Compile::_default::MrkAwareStrictMultiKeyring(input.generator(), input.kmsKeyIds(), &clientSupplier, &Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::Some {
                            value: grantTokens.clone()
                        }));
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<MultiKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(_out1.clone()));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(211,3)
        pub fn CreateAwsKmsMrkDiscoveryKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsMrkDiscoveryKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            if matches!(input.discoveryFilter().as_ref(), Some{ .. }) {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateDiscoveryFilter(input.discoveryFilter().value());
                if valueOrError0.IsFailure() {
                    output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut _v3: () = valueOrError0.Extract();
            };
            let mut regionMatch: Arc<Option<bool>> = crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::_default::RegionMatch(input.kmsClient(), input.region());
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(regionMatch.clone() != Arc::new(Option::<bool>::Some {
                            value: false
                        }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Provided client and region do not match")
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens());
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut grantTokens: Sequence<Sequence<DafnyCharUTF16>> = valueOrError2.Extract();
            let mut keyring: Object<AwsKmsMrkDiscoveryKeyring>;
            let mut _nw0: Object<AwsKmsMrkDiscoveryKeyring> = AwsKmsMrkDiscoveryKeyring::_allocate_object();
            AwsKmsMrkDiscoveryKeyring::_ctor(&_nw0, input.kmsClient(), input.region(), input.discoveryFilter(), &grantTokens);
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsMrkDiscoveryKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<AwsKmsMrkDiscoveryKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsMrkDiscoveryKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(236,3)
        pub fn CreateAwsKmsMrkDiscoveryMultiKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsMrkDiscoveryMultiKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens());
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut grantTokens: Sequence<Sequence<DafnyCharUTF16>> = valueOrError0.Extract();
            let mut clientSupplier: Object<dyn IClientSupplier>;
            if matches!(input.clientSupplier().as_ref(), None{ .. }) {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CreateDefaultClientSupplier(config, &Arc::new(CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput {}));
                valueOrError1 = _out0.clone();
                if valueOrError1.IsFailure() {
                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                clientSupplier = valueOrError1.Extract();
            } else {
                clientSupplier = input.clientSupplier().value().clone();
            };
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_MrkAwareDiscoveryMultiKeyring_Compile::_default::MrkAwareDiscoveryMultiKeyring(input.regions(), input.discoveryFilter(), &clientSupplier, &Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::Some {
                            value: grantTokens.clone()
                        }));
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<MultiKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(_out1.clone()));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(263,3)
        pub fn N(n: PositiveLong) -> Sequence<DafnyCharUTF16> {
            crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&n).clone()))
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(270,3)
        pub fn CheckCache(cache: &Arc<CacheType>, ttlSeconds: PositiveLong) -> Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            if matches!(cache.as_ref(), StormTracking{ .. }) {
                let mut gracePeriod: i64;
                if matches!((&cache.StormTracking().timeUnits().UnwrapOr(&Arc::new(TimeUnits::Seconds {}))).as_ref(), Seconds{ .. }) {
                    gracePeriod = cache.StormTracking().gracePeriod().clone() as i64;
                } else {
                    gracePeriod = truncate!(euclidian_division(int!(cache.StormTracking().gracePeriod().clone() as i64), int!(1000)), i64);
                };
                let mut storm: Arc<StormTrackingCache> = cache.StormTracking().clone();
                if ttlSeconds <= gracePeriod {
                    let mut msg: Sequence<DafnyCharUTF16> = string_utf16_of("When creating an AwsKmsHierarchicalKeyring with a StormCache, ").concat(&string_utf16_of("the ttlSeconds of the KeyRing must be greater than the gracePeriod of the StormCache ")).concat(&string_utf16_of("yet the ttlSeconds is ")).concat(&_default::N(ttlSeconds)).concat(&string_utf16_of(" and the gracePeriod is ")).concat(&_default::N(gracePeriod)).concat(&string_utf16_of("."));
                    output = MaybePlacebo::from(Arc::new(Outcome::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Fail {
                                    error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                                message: msg.clone()
                                            })
                                }));
                    return output.read();
                };
                output = MaybePlacebo::from(Arc::new(Outcome::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Pass {}));
                return output.read();
            } else {
                output = MaybePlacebo::from(Arc::new(Outcome::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Pass {}));
                return output.read();
            };
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(290,3)
        pub fn CreateAwsKmsHierarchicalKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsHierarchicalKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut cmc: Object<dyn ICryptographicMaterialsCache>;
            if matches!(input.cache().as_ref(), Some{ .. }) {
                let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CheckCache(input.cache().value(), input.ttlSeconds().clone());
                valueOrError0 = _out0.clone();
                if valueOrError0.IsFailure() {
                    output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut _source0: Arc<CacheType> = input.cache().value().clone();
                if matches!((&_source0).as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType::Default{ .. }) {
                    let mut ___mcc_h0: Arc<DefaultCache> = _source0.Default().clone();
                    let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                    let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CreateCryptographicMaterialsCache(config, &Arc::new(CreateCryptographicMaterialsCacheInput::CreateCryptographicMaterialsCacheInput {
                                    cache: input.cache().value().clone()
                                }));
                    valueOrError1 = _out1.clone();
                    if valueOrError1.IsFailure() {
                        output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                        return output.read();
                    };
                    cmc = valueOrError1.Extract();
                } else {
                    if matches!((&_source0).as_ref(), No{ .. }) {
                        let mut ___mcc_h2: Arc<NoCache> = _source0.No().clone();
                        let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                        let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CreateCryptographicMaterialsCache(config, &Arc::new(CreateCryptographicMaterialsCacheInput::CreateCryptographicMaterialsCacheInput {
                                        cache: input.cache().value().clone()
                                    }));
                        valueOrError1 = _out2.clone();
                        if valueOrError1.IsFailure() {
                            output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                            return output.read();
                        };
                        cmc = valueOrError1.Extract();
                    } else {
                        if matches!((&_source0).as_ref(), SingleThreaded{ .. }) {
                            let mut ___mcc_h4: Arc<SingleThreadedCache> = _source0.SingleThreaded().clone();
                            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                            let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CreateCryptographicMaterialsCache(config, &Arc::new(CreateCryptographicMaterialsCacheInput::CreateCryptographicMaterialsCacheInput {
                                            cache: input.cache().value().clone()
                                        }));
                            valueOrError1 = _out3.clone();
                            if valueOrError1.IsFailure() {
                                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                                return output.read();
                            };
                            cmc = valueOrError1.Extract();
                        } else {
                            if matches!((&_source0).as_ref(), MultiThreaded{ .. }) {
                                let mut ___mcc_h6: Arc<MultiThreadedCache> = _source0.MultiThreaded().clone();
                                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                let mut _out4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CreateCryptographicMaterialsCache(config, &Arc::new(CreateCryptographicMaterialsCacheInput::CreateCryptographicMaterialsCacheInput {
                                                cache: input.cache().value().clone()
                                            }));
                                valueOrError1 = _out4.clone();
                                if valueOrError1.IsFailure() {
                                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                                    return output.read();
                                };
                                cmc = valueOrError1.Extract();
                            } else {
                                if matches!((&_source0).as_ref(), StormTracking{ .. }) {
                                    let mut ___mcc_h8: Arc<StormTrackingCache> = _source0.StormTracking().clone();
                                    let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                                    let mut _out5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CreateCryptographicMaterialsCache(config, &Arc::new(CreateCryptographicMaterialsCacheInput::CreateCryptographicMaterialsCacheInput {
                                                    cache: input.cache().value().clone()
                                                }));
                                    valueOrError1 = _out5.clone();
                                    if valueOrError1.IsFailure() {
                                        output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                                        return output.read();
                                    };
                                    cmc = valueOrError1.Extract();
                                } else {
                                    let mut ___mcc_h10: Object<dyn ICryptographicMaterialsCache> = _source0.Shared().clone();
                                    let mut c: Object<dyn ICryptographicMaterialsCache> = ___mcc_h10.clone();
                                    cmc = c.clone();
                                }
                            }
                        }
                    }
                }
            } else {
                let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out6: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CheckCache(&Arc::new(CacheType::StormTracking {
                                StormTracking: crate::implementation_from_dafny::_StormTracker_Compile::_default::DefaultStorm()
                            }), input.ttlSeconds().clone());
                valueOrError2 = _out6.clone();
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CreateCryptographicMaterialsCache(config, &Arc::new(CreateCryptographicMaterialsCacheInput::CreateCryptographicMaterialsCacheInput {
                                cache: Arc::new(CacheType::Default {
                                            Default: Arc::new(DefaultCache::DefaultCache {
                                                        entryCapacity: 1000
                                                    })
                                        })
                            }));
                valueOrError3 = _out7.clone();
                if valueOrError3.IsFailure() {
                    output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                cmc = valueOrError3.Extract();
            };
            let mut partitionIdBytes: Sequence<u8>;
            if matches!(input.partitionId().as_ref(), Some{ .. }) {
                let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(input.partitionId().value()).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: string_utf16_of("Could not UTF-8 Encode Partition ID: ").concat(e)
                                        })
                                })
                        }));
                if valueOrError4.IsFailure() {
                    output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                partitionIdBytes = valueOrError4.Extract();
            } else {
                let mut _uuid_q: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>;
                let mut _out8: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UUID::_default::GenerateUUID();
                _uuid_q = _out8.clone();
                let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _uuid_q.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: e.clone()
                                        })
                                })
                        }));
                if valueOrError5.IsFailure() {
                    output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut uuid: Sequence<DafnyCharUTF16> = valueOrError5.Extract();
                let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UUID::_default::ToByteArray(&uuid).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: e.clone()
                                        })
                                })
                        }));
                if valueOrError6.IsFailure() {
                    output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                partitionIdBytes = valueOrError6.Extract();
            };
            let mut _getKeyStoreInfoOutput_q: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetKeyStoreInfoOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
            let mut _out9: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetKeyStoreInfoOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = IKeyStoreClient::GetKeyStoreInfo(rd!(input.keyStore().clone()));
            _getKeyStoreInfoOutput_q = _out9.clone();
            let mut valueOrError7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetKeyStoreInfoOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _getKeyStoreInfoOutput_q.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyKeyStore {
                                        AwsCryptographyKeyStore: e.clone()
                                    })
                            })
                    }));
            if valueOrError7.IsFailure() {
                output = MaybePlacebo::from(valueOrError7.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut getKeyStoreInfoOutput: Arc<GetKeyStoreInfoOutput> = valueOrError7.Extract();
            let mut logicalKeyStoreName: Sequence<DafnyCharUTF16> = getKeyStoreInfoOutput.logicalKeyStoreName().clone();
            let mut valueOrError8: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&logicalKeyStoreName).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                        message: string_utf16_of("Could not UTF-8 Encode Logical Key Store Name: ").concat(e)
                                    })
                            })
                    }));
            if valueOrError8.IsFailure() {
                output = MaybePlacebo::from(valueOrError8.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut logicalKeyStoreNameBytes: Sequence<u8> = valueOrError8.Extract();
            let mut valueOrError9: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(input.branchKeyId().as_ref(), None{ .. }) || matches!(input.branchKeyIdSupplier().as_ref(), None{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Cannot initialize keyring with both a branchKeyId and BranchKeyIdSupplier.")
                        }));
            if valueOrError9.IsFailure() {
                output = MaybePlacebo::from(valueOrError9.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut valueOrError10: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(input.branchKeyId().as_ref(), Some{ .. }) || matches!(input.branchKeyIdSupplier().as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Must initialize keyring with either branchKeyId or BranchKeyIdSupplier.")
                        }));
            if valueOrError10.IsFailure() {
                output = MaybePlacebo::from(valueOrError10.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut keyring: Object<AwsKmsHierarchicalKeyring>;
            let mut _nw0: Object<AwsKmsHierarchicalKeyring> = AwsKmsHierarchicalKeyring::_allocate_object();
            AwsKmsHierarchicalKeyring::_ctor(&_nw0, input.keyStore(), input.branchKeyId(), input.branchKeyIdSupplier(), input.ttlSeconds().clone(), &cmc, &partitionIdBytes, &logicalKeyStoreNameBytes, config.crypto());
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsHierarchicalKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<AwsKmsHierarchicalKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsHierarchicalKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(390,3)
        pub fn CreateAwsKmsEcdhKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsEcdhKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens());
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut grantTokens: Sequence<Sequence<DafnyCharUTF16>> = valueOrError0.Extract();
            let mut recipientPublicKey: PublicKeyType;
            let mut senderPublicKey: Arc<Option<PublicKeyType>>;
            let mut compressedSenderPublicKey: Arc<Option<Sequence<u8>>>;
            let mut _source0: Arc<KmsEcdhStaticConfigurations> = input.KeyAgreementScheme().clone();
            if matches!((&_source0).as_ref(), KmsPublicKeyDiscovery{ .. }) {
                let mut ___mcc_h0: Arc<KmsPublicKeyDiscoveryInput> = _source0.KmsPublicKeyDiscovery().clone();
                let mut kmsPublicKeyDiscovery: Arc<KmsPublicKeyDiscoveryInput> = ___mcc_h0.clone();
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(kmsPublicKeyDiscovery.recipientKmsIdentifier());
                if valueOrError1.IsFailure() {
                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut _v5: () = valueOrError1.Extract();
                let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<PublicKeyType, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<PublicKeyType, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetEcdhPublicKey(input.kmsClient(), kmsPublicKeyDiscovery.recipientKmsIdentifier());
                valueOrError2 = _out0.clone();
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                recipientPublicKey = valueOrError2.Extract();
                senderPublicKey = Arc::new(Option::<PublicKeyType>::None {});
                compressedSenderPublicKey = Arc::new(Option::<Sequence<u8>>::None {});
            } else {
                let mut ___mcc_h1: Arc<KmsPrivateKeyToStaticPublicKeyInput> = _source0.KmsPrivateKeyToStaticPublicKey().clone();
                let mut kmsPrivateKeyToStaticPublicKey: Arc<KmsPrivateKeyToStaticPublicKeyInput> = ___mcc_h1.clone();
                if matches!(kmsPrivateKeyToStaticPublicKey.senderPublicKey().as_ref(), Some{ .. }) {
                    let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(kmsPrivateKeyToStaticPublicKey.senderPublicKey().value()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Invalid SenderPublicKey length.")
                                }));
                    if valueOrError3.IsFailure() {
                        output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Object<dyn IKeyring>>());
                        return output.read();
                    };
                    senderPublicKey = Arc::new(Option::<Sequence<u8>>::Some {
                                value: kmsPrivateKeyToStaticPublicKey.senderPublicKey().value().clone()
                            });
                    let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                    let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::CompressPublicKey(&Arc::new(ECCPublicKey::ECCPublicKey {
                                    der: senderPublicKey.value().clone()
                                }), input.curveSpec(), config.crypto());
                    valueOrError4 = _out1.clone();
                    if valueOrError4.IsFailure() {
                        output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Object<dyn IKeyring>>());
                        return output.read();
                    };
                    let mut compressedPKU: Sequence<u8> = valueOrError4.Extract();
                    compressedSenderPublicKey = Arc::new(Option::<Sequence<u8>>::Some {
                                value: compressedPKU.clone()
                            });
                } else {
                    let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(kmsPrivateKeyToStaticPublicKey.senderKmsIdentifier());
                    if valueOrError5.IsFailure() {
                        output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Object<dyn IKeyring>>());
                        return output.read();
                    };
                    let mut _v6: () = valueOrError5.Extract();
                    let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<PublicKeyType, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                    let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<PublicKeyType, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetEcdhPublicKey(input.kmsClient(), kmsPrivateKeyToStaticPublicKey.senderKmsIdentifier());
                    valueOrError6 = _out2.clone();
                    if valueOrError6.IsFailure() {
                        output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Object<dyn IKeyring>>());
                        return output.read();
                    };
                    let mut senderPublicKeyResponse: PublicKeyType = valueOrError6.Extract();
                    let mut valueOrError7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                    let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::CompressPublicKey(&Arc::new(ECCPublicKey::ECCPublicKey {
                                    der: senderPublicKeyResponse.clone()
                                }), input.curveSpec(), config.crypto());
                    valueOrError7 = _out3.clone();
                    if valueOrError7.IsFailure() {
                        output = MaybePlacebo::from(valueOrError7.PropagateFailure::<Object<dyn IKeyring>>());
                        return output.read();
                    };
                    let mut compressedPKU: Sequence<u8> = valueOrError7.Extract();
                    senderPublicKey = Arc::new(Option::<PublicKeyType>::Some {
                                value: senderPublicKeyResponse.clone()
                            });
                    compressedSenderPublicKey = Arc::new(Option::<Sequence<u8>>::Some {
                                value: compressedPKU.clone()
                            });
                };
                let mut valueOrError8: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(kmsPrivateKeyToStaticPublicKey.recipientPublicKey()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Invalid RecipientPublicKey length.")
                            }));
                if valueOrError8.IsFailure() {
                    output = MaybePlacebo::from(valueOrError8.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                recipientPublicKey = kmsPrivateKeyToStaticPublicKey.recipientPublicKey().clone();
            };
            let mut valueOrError9: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(config.crypto(), input.curveSpec(), &recipientPublicKey);
            valueOrError9 = _out4.clone();
            if valueOrError9.IsFailure() {
                output = MaybePlacebo::from(valueOrError9.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut _v7: bool = valueOrError9.Extract();
            let mut valueOrError10: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::CompressPublicKey(&Arc::new(ECCPublicKey::ECCPublicKey {
                            der: recipientPublicKey.clone()
                        }), input.curveSpec(), config.crypto());
            valueOrError10 = _out5.clone();
            if valueOrError10.IsFailure() {
                output = MaybePlacebo::from(valueOrError10.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut compressedRecipientPublicKey: Sequence<u8> = valueOrError10.Extract();
            let mut senderKmsKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>;
            if matches!(input.KeyAgreementScheme().as_ref(), KmsPublicKeyDiscovery{ .. }) {
                senderKmsKeyId = Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {});
            } else {
                senderKmsKeyId = Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                            value: input.KeyAgreementScheme().KmsPrivateKeyToStaticPublicKey().senderKmsIdentifier().clone()
                        });
            };
            if matches!((&senderKmsKeyId).as_ref(), Some{ .. }) {
                let mut valueOrError11: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(senderKmsKeyId.value());
                if valueOrError11.IsFailure() {
                    output = MaybePlacebo::from(valueOrError11.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut _v8: () = valueOrError11.Extract();
            };
            if matches!((&senderPublicKey).as_ref(), Some{ .. }) {
                let mut valueOrError12: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(config.crypto(), input.curveSpec(), senderPublicKey.value());
                valueOrError12 = _out6.clone();
                if valueOrError12.IsFailure() {
                    output = MaybePlacebo::from(valueOrError12.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut _v9: bool = valueOrError12.Extract();
            };
            let mut keyring: Object<AwsKmsEcdhKeyring>;
            let mut _nw0: Object<AwsKmsEcdhKeyring> = AwsKmsEcdhKeyring::_allocate_object();
            AwsKmsEcdhKeyring::_ctor(&_nw0, input.KeyAgreementScheme(), input.curveSpec(), input.kmsClient(), &grantTokens, &senderKmsKeyId, &senderPublicKey, &recipientPublicKey, &compressedSenderPublicKey, &compressedRecipientPublicKey, config.crypto());
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsEcdhKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<AwsKmsEcdhKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsEcdhKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(494,3)
        pub fn CreateMultiKeyring(config: &Arc<Config>, input: &Arc<CreateMultiKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(input.generator().as_ref(), Some{ .. }) || 0 < truncate!(input.childKeyrings().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Must include a generator keyring and/or at least one child keyring")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut keyring: Object<MultiKeyring>;
            let mut _nw0: Object<MultiKeyring> = MultiKeyring::_allocate_object();
            MultiKeyring::_ctor(&_nw0, input.generator(), input.childKeyrings());
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<MultiKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<MultiKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(517,3)
        pub fn CreateRawAesKeyring(config: &Arc<Config>, input: &Arc<CreateRawAesKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(input.keyNamespace().clone() != string_utf16_of("aws-kms"), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("keyNamespace must not be `aws-kms`")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut wrappingAlg: Arc<AES_GCM>;
            let mut _source0: Arc<AesWrappingAlg> = input.wrappingAlg().clone();
            if matches!((&_source0).as_ref(), ALG_AES128_GCM_IV12_TAG16{ .. }) {
                wrappingAlg = Arc::new(AES_GCM::AES_GCM {
                            keyLength: 16,
                            tagLength: 16,
                            ivLength: 12
                        });
            } else {
                if matches!((&_source0).as_ref(), ALG_AES192_GCM_IV12_TAG16{ .. }) {
                    wrappingAlg = Arc::new(AES_GCM::AES_GCM {
                                keyLength: 24,
                                tagLength: 16,
                                ivLength: 12
                            });
                } else {
                    wrappingAlg = Arc::new(AES_GCM::AES_GCM {
                                keyLength: 32,
                                tagLength: 16,
                                ivLength: 12
                            });
                }
            };
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(ValidUTF8Bytes, ValidUTF8Bytes), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ParseKeyNamespaceAndName(input.keyNamespace(), input.keyName());
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut namespaceAndName: (ValidUTF8Bytes, ValidUTF8Bytes) = valueOrError1.Extract();
            let mut __let_tmp_rhs0: (ValidUTF8Bytes, ValidUTF8Bytes) = namespaceAndName.clone();
            let mut namespace: ValidUTF8Bytes = __let_tmp_rhs0.0.clone();
            let mut name: ValidUTF8Bytes = __let_tmp_rhs0.1.clone();
            let mut wrapping_key_size: u64 = truncate!(input.wrappingKey().cardinality(), u64);
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(wrapping_key_size == 16 || wrapping_key_size == 24 || wrapping_key_size == 32, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid wrapping key length")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(wrapping_key_size == wrappingAlg.keyLength().clone() as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Wrapping key length does not match specified wrapping algorithm")
                        }));
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut keyring: Object<RawAESKeyring>;
            let mut _nw0: Object<RawAESKeyring> = RawAESKeyring::_allocate_object();
            RawAESKeyring::_ctor(&_nw0, &namespace, &name, input.wrappingKey(), &wrappingAlg, config.crypto());
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<RawAESKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<RawAESKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<RawAESKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(578,3)
        pub fn CreateRawRsaKeyring(config: &Arc<Config>, input: &Arc<CreateRawRsaKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(input.keyNamespace().clone() != string_utf16_of("aws-kms"), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("keyNamespace must not be `aws-kms`")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(input.publicKey().as_ref(), Some{ .. }) || matches!(input.privateKey().as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("A publicKey or a privateKey is required")
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut padding: Arc<RSAPaddingMode>;
            let mut _source0: Arc<PaddingScheme> = input.paddingScheme().clone();
            if matches!((&_source0).as_ref(), PKCS1{ .. }) {
                padding = Arc::new(RSAPaddingMode::PKCS1 {});
            } else {
                if matches!((&_source0).as_ref(), OAEP_SHA1_MGF1{ .. }) {
                    padding = Arc::new(RSAPaddingMode::OAEP_SHA1 {});
                } else {
                    if matches!((&_source0).as_ref(), OAEP_SHA256_MGF1{ .. }) {
                        padding = Arc::new(RSAPaddingMode::OAEP_SHA256 {});
                    } else {
                        if matches!((&_source0).as_ref(), OAEP_SHA384_MGF1{ .. }) {
                            padding = Arc::new(RSAPaddingMode::OAEP_SHA384 {});
                        } else {
                            padding = Arc::new(RSAPaddingMode::OAEP_SHA512 {});
                        }
                    }
                }
            };
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(ValidUTF8Bytes, ValidUTF8Bytes), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ParseKeyNamespaceAndName(input.keyNamespace(), input.keyName());
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut namespaceAndName: (ValidUTF8Bytes, ValidUTF8Bytes) = valueOrError2.Extract();
            let mut __let_tmp_rhs0: (ValidUTF8Bytes, ValidUTF8Bytes) = namespaceAndName.clone();
            let mut namespace: ValidUTF8Bytes = __let_tmp_rhs0.0.clone();
            let mut name: ValidUTF8Bytes = __let_tmp_rhs0.1.clone();
            let mut keyring: Object<RawRSAKeyring>;
            let mut _nw0: Object<RawRSAKeyring> = RawRSAKeyring::_allocate_object();
            RawRSAKeyring::_ctor(&_nw0, &namespace, &name, input.publicKey(), input.privateKey(), &padding, config.crypto());
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<RawRSAKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<RawRSAKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<RawRSAKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(613,3)
        pub fn CreateRawEcdhKeyring(config: &Arc<Config>, input: &Arc<CreateRawEcdhKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut recipientPublicKey: Sequence<u8>;
            let mut senderPrivateKey: Arc<Option<Sequence<u8>>>;
            let mut senderPublicKey: Arc<Option<Sequence<u8>>>;
            let mut compressedSenderPublicKey: Arc<Option<Sequence<u8>>>;
            let mut _source0: Arc<RawEcdhStaticConfigurations> = input.KeyAgreementScheme().clone();
            if matches!((&_source0).as_ref(), PublicKeyDiscovery{ .. }) {
                let mut ___mcc_h0: Arc<PublicKeyDiscoveryInput> = _source0.PublicKeyDiscovery().clone();
                let mut publicKeyDiscovery: Arc<PublicKeyDiscoveryInput> = ___mcc_h0.clone();
                let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Utils_Compile::_default::GetPublicKey(input.curveSpec(), &Arc::new(ECCPrivateKey::ECCPrivateKey {
                                pem: publicKeyDiscovery.recipientStaticPrivateKey().clone()
                            }), config.crypto());
                valueOrError3 = _out0.clone();
                if valueOrError3.IsFailure() {
                    output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut reproducedPublicKey: Sequence<u8> = valueOrError3.Extract();
                recipientPublicKey = reproducedPublicKey.clone();
                senderPrivateKey = Arc::new(Option::<Sequence<u8>>::None {});
                senderPublicKey = Arc::new(Option::<Sequence<u8>>::None {});
                compressedSenderPublicKey = Arc::new(Option::<Sequence<u8>>::None {});
            } else {
                if matches!((&_source0).as_ref(), RawPrivateKeyToStaticPublicKey{ .. }) {
                    let mut ___mcc_h1: Arc<RawPrivateKeyToStaticPublicKeyInput> = _source0.RawPrivateKeyToStaticPublicKey().clone();
                    let mut rawPrivateKeyToStaticPublicKey: Arc<RawPrivateKeyToStaticPublicKeyInput> = ___mcc_h1.clone();
                    recipientPublicKey = rawPrivateKeyToStaticPublicKey.recipientPublicKey().clone();
                    senderPrivateKey = Arc::new(Option::<Sequence<u8>>::Some {
                                value: rawPrivateKeyToStaticPublicKey.senderStaticPrivateKey().clone()
                            });
                    let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                    let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Utils_Compile::_default::GetPublicKey(input.curveSpec(), &Arc::new(ECCPrivateKey::ECCPrivateKey {
                                    pem: senderPrivateKey.value().clone()
                                }), config.crypto());
                    valueOrError0 = _out1.clone();
                    if valueOrError0.IsFailure() {
                        output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                        return output.read();
                    };
                    let mut reproducedPublicKey: Sequence<u8> = valueOrError0.Extract();
                    let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                    let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(config.crypto(), input.curveSpec(), &reproducedPublicKey);
                    valueOrError1 = _out2.clone();
                    if valueOrError1.IsFailure() {
                        output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                        return output.read();
                    };
                    let mut _v10: bool = valueOrError1.Extract();
                    senderPublicKey = Arc::new(Option::<Sequence<u8>>::Some {
                                value: reproducedPublicKey.clone()
                            });
                    let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                    let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::CompressPublicKey(&Arc::new(ECCPublicKey::ECCPublicKey {
                                    der: reproducedPublicKey.clone()
                                }), input.curveSpec(), config.crypto());
                    valueOrError2 = _out3.clone();
                    if valueOrError2.IsFailure() {
                        output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<dyn IKeyring>>());
                        return output.read();
                    };
                    let mut _compressedSenderPublicKey_q: Sequence<u8> = valueOrError2.Extract();
                    compressedSenderPublicKey = Arc::new(Option::<Sequence<u8>>::Some {
                                value: _compressedSenderPublicKey_q.clone()
                            });
                } else {
                    let mut ___mcc_h2: Arc<EphemeralPrivateKeyToStaticPublicKeyInput> = _source0.EphemeralPrivateKeyToStaticPublicKey().clone();
                    let mut ephemeralPrivateKeyToStaticPublicKey: Arc<EphemeralPrivateKeyToStaticPublicKeyInput> = ___mcc_h2.clone();
                    recipientPublicKey = ephemeralPrivateKeyToStaticPublicKey.recipientPublicKey().clone();
                    senderPrivateKey = Arc::new(Option::<Sequence<u8>>::None {});
                    senderPublicKey = Arc::new(Option::<Sequence<u8>>::None {});
                    compressedSenderPublicKey = Arc::new(Option::<Sequence<u8>>::None {});
                }
            };
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::CompressPublicKey(&Arc::new(ECCPublicKey::ECCPublicKey {
                            der: recipientPublicKey.clone()
                        }), input.curveSpec(), config.crypto());
            valueOrError4 = _out4.clone();
            if valueOrError4.IsFailure() {
                output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut compressedRecipientPublicKey: Sequence<u8> = valueOrError4.Extract();
            let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(config.crypto(), input.curveSpec(), &recipientPublicKey);
            valueOrError5 = _out5.clone();
            if valueOrError5.IsFailure() {
                output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut _v11: bool = valueOrError5.Extract();
            if matches!((&senderPublicKey).as_ref(), Some{ .. }) {
                let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(config.crypto(), input.curveSpec(), senderPublicKey.value());
                valueOrError6 = _out6.clone();
                if valueOrError6.IsFailure() {
                    output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut _v12: bool = valueOrError6.Extract();
                let mut valueOrError7: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidPublicKeyLength(senderPublicKey.value()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Invalid sender public key length")
                            }));
                if valueOrError7.IsFailure() {
                    output = MaybePlacebo::from(valueOrError7.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                }
            };
            let mut valueOrError8: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidPublicKeyLength(&recipientPublicKey), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid recipient public key length")
                        }));
            if valueOrError8.IsFailure() {
                output = MaybePlacebo::from(valueOrError8.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut keyring: Object<RawEcdhKeyring>;
            let mut _nw0: Object<RawEcdhKeyring> = RawEcdhKeyring::_allocate_object();
            RawEcdhKeyring::_ctor(&_nw0, input.KeyAgreementScheme(), input.curveSpec(), &senderPrivateKey, &senderPublicKey, &recipientPublicKey, &compressedSenderPublicKey, &compressedRecipientPublicKey, config.crypto());
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<RawEcdhKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<RawEcdhKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<RawEcdhKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(712,3)
        pub fn CreateAwsKmsRsaKeyring(config: &Arc<Config>, input: &Arc<CreateAwsKmsRsaKeyringInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(input.publicKey().as_ref(), Some{ .. }) || matches!(input.kmsClient().as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("A publicKey or a kmsClient is required")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(input.encryptionAlgorithm().as_ref(), RSAES_OAEP_SHA_1{ .. }) || matches!(input.encryptionAlgorithm().as_ref(), RSAES_OAEP_SHA_256{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Unsupported EncryptionAlgorithmSpec")
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(input.kmsKeyId()) && matches!((&crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(input.kmsKeyId())).as_ref(), Success{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Kms Key ID must be a KMS Key ARN")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            if matches!(input.publicKey().as_ref(), Some{ .. }) {
                let mut lengthOutputRes: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetRSAKeyModulusLengthOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GetRSAKeyModulusLength(rd!(config.crypto().clone()), &Arc::new(GetRSAKeyModulusLengthInput::GetRSAKeyModulusLengthInput {
                                publicKey: input.publicKey().value().clone()
                            }));
                let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetRSAKeyModulusLengthOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = lengthOutputRes.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                            AwsCryptographyPrimitives: e.clone()
                                        })
                                })
                        }));
                if valueOrError3.IsFailure() {
                    output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                };
                let mut lengthOutput: Arc<GetRSAKeyModulusLengthOutput> = valueOrError3.Extract();
                let mut valueOrError4: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(lengthOutput.length().clone() >= crate::implementation_from_dafny::_AwsKmsRsaKeyring_Compile::_default::MIN_KMS_RSA_KEY_LEN(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Invalid public key length")
                            }));
                if valueOrError4.IsFailure() {
                    output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Object<dyn IKeyring>>());
                    return output.read();
                }
            };
            let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(input.kmsKeyId());
            if valueOrError5.IsFailure() {
                output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut _v13: () = valueOrError5.Extract();
            let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::GetValidGrantTokens(input.grantTokens());
            if valueOrError6.IsFailure() {
                output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Object<dyn IKeyring>>());
                return output.read();
            };
            let mut grantTokens: Sequence<Sequence<DafnyCharUTF16>> = valueOrError6.Extract();
            let mut keyring: Object<AwsKmsRsaKeyring>;
            let mut _nw0: Object<AwsKmsRsaKeyring> = AwsKmsRsaKeyring::_allocate_object();
            AwsKmsRsaKeyring::_ctor(&_nw0, input.publicKey(), input.kmsKeyId(), input.encryptionAlgorithm(), input.kmsClient(), config.crypto(), &grantTokens);
            keyring = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsRsaKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<AwsKmsRsaKeyring, dyn IKeyring>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<AwsKmsRsaKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: keyring.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(769,3)
        pub fn CreateDefaultCryptographicMaterialsManager(config: &Arc<Config>, input: &Arc<CreateDefaultCryptographicMaterialsManagerInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut cmm: Object<DefaultCMM>;
            let mut _nw0: Object<DefaultCMM> = DefaultCMM::_allocate_object();
            DefaultCMM::OfKeyring(&_nw0, input.keyring(), config.crypto());
            cmm = _nw0.clone();
            output = rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<DefaultCMM>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<DefaultCMM, dyn ICryptographicMaterialsManager>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<DefaultCMM>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: cmm.clone()
                        }));
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(776,3)
        pub fn CmpError(s: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error> {
            Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                    message: s.clone()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(784,3)
        pub fn CreateRequiredEncryptionContextCMM(config: &Arc<Config>, input: &Arc<CreateRequiredEncryptionContextCMMInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(input.underlyingCMM().as_ref(), Some{ .. }) && matches!(input.keyring().as_ref(), None{ .. }), &_default::CmpError(&string_utf16_of("CreateRequiredEncryptionContextCMM currently only supports cmm.")));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn ICryptographicMaterialsManager>>());
                return output.read();
            };
            let mut keySet: Set<ValidUTF8Bytes> = (&({
                    let mut input = input.clone();
                    Arc::new(move || -> Set<ValidUTF8Bytes>{
                            let mut _coll0: SetBuilder<ValidUTF8Bytes> = SetBuilder::<ValidUTF8Bytes>::new();
                            for __compr_0 in input.requiredEncryptionContextKeys().iter() {
                                let mut k: ValidUTF8Bytes = __compr_0.clone();
                                if {
                                        let i: Sequence<u8> = k.clone();
                                        crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                    } {
                                    if input.requiredEncryptionContextKeys().contains(&k) {
                                        _coll0.add(&k)
                                    }
                                }
                            }
                            _coll0.build()
                        })
                }))();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(0 < truncate!(keySet.cardinality(), u64), &_default::CmpError(&string_utf16_of("RequiredEncryptionContextCMM needs at least one requiredEncryptionContextKey.")));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn ICryptographicMaterialsManager>>());
                return output.read();
            };
            let mut cmm: Object<RequiredEncryptionContextCMM>;
            let mut _nw0: Object<RequiredEncryptionContextCMM> = RequiredEncryptionContextCMM::_allocate_object();
            RequiredEncryptionContextCMM::_ctor(&_nw0, input.underlyingCMM().value(), &keySet);
            cmm = _nw0.clone();
            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<RequiredEncryptionContextCMM>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<RequiredEncryptionContextCMM, dyn ICryptographicMaterialsManager>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<RequiredEncryptionContextCMM>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: cmm.clone()
                            })));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(802,3)
        pub fn CreateCryptographicMaterialsCache(config: &Arc<Config>, input: &Arc<CreateCryptographicMaterialsCacheInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut _source0: Arc<CacheType> = input.cache().clone();
            if matches!((&_source0).as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType::Default{ .. }) {
                let mut ___mcc_h0: Arc<DefaultCache> = _source0.Default().clone();
                let mut c: Arc<DefaultCache> = ___mcc_h0.clone();
                let mut cache: Arc<StormTrackingCache>;
                let mut _dt__update__tmp_h0: Arc<StormTrackingCache> = crate::implementation_from_dafny::_StormTracker_Compile::_default::DefaultStorm();
                let mut _dt__update_hentryCapacity_h0: CountingNumber = c.entryCapacity().clone();
                cache = Arc::new(StormTrackingCache::StormTrackingCache {
                            entryCapacity: _dt__update_hentryCapacity_h0,
                            entryPruningTailSize: _dt__update__tmp_h0.entryPruningTailSize().clone(),
                            gracePeriod: _dt__update__tmp_h0.gracePeriod().clone(),
                            graceInterval: _dt__update__tmp_h0.graceInterval().clone(),
                            fanOut: _dt__update__tmp_h0.fanOut().clone(),
                            inFlightTTL: _dt__update__tmp_h0.inFlightTTL().clone(),
                            sleepMilli: _dt__update__tmp_h0.sleepMilli().clone(),
                            timeUnits: _dt__update__tmp_h0.timeUnits().clone()
                        });
                let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_StormTracker_Compile::_default::CheckSettings(&cache);
                if valueOrError0.IsFailure() {
                    output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn ICryptographicMaterialsCache>>());
                    return output.read();
                };
                let mut cmc: Object<StormTracker>;
                let mut _nw0: Object<StormTracker> = StormTracker::_allocate_object();
                StormTracker::_ctor(&_nw0, &cache);
                cmc = _nw0.clone();
                let mut synCmc: Object<StormTrackingCMC>;
                let mut _nw1: Object<StormTrackingCMC> = StormTrackingCMC::_allocate_object(cmc.clone());
                synCmc = _nw1.clone();
                output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<StormTrackingCMC>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<StormTrackingCMC, dyn ICryptographicMaterialsCache>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<StormTrackingCMC>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                    value: synCmc.clone()
                                })));
                return output.read();
            } else {
                if matches!((&_source0).as_ref(), No{ .. }) {
                    let mut ___mcc_h1: Arc<NoCache> = _source0.No().clone();
                    let mut cmc: Object<LocalCMC>;
                    let mut _nw2: Object<LocalCMC> = LocalCMC::_allocate_object();
                    LocalCMC::_ctor(&_nw2, 0, 1);
                    cmc = _nw2.clone();
                    output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<LocalCMC>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<LocalCMC, dyn ICryptographicMaterialsCache>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<LocalCMC>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                        value: cmc.clone()
                                    })));
                    return output.read();
                } else {
                    if matches!((&_source0).as_ref(), SingleThreaded{ .. }) {
                        let mut ___mcc_h2: Arc<SingleThreadedCache> = _source0.SingleThreaded().clone();
                        let mut c: Arc<SingleThreadedCache> = ___mcc_h2.clone();
                        let mut cmc: Object<LocalCMC>;
                        let mut _nw3: Object<LocalCMC> = LocalCMC::_allocate_object();
                        LocalCMC::_ctor(&_nw3, c.entryCapacity().clone() as u64, _default::OptionalCountingNumber(c.entryPruningTailSize()).UnwrapOr(&truncate!((&int!(1)).clone(), i32)) as u64);
                        cmc = _nw3.clone();
                        output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<LocalCMC>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<LocalCMC, dyn ICryptographicMaterialsCache>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<LocalCMC>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                            value: cmc.clone()
                                        })));
                        return output.read();
                    } else {
                        if matches!((&_source0).as_ref(), MultiThreaded{ .. }) {
                            let mut ___mcc_h3: Arc<MultiThreadedCache> = _source0.MultiThreaded().clone();
                            let mut c: Arc<MultiThreadedCache> = ___mcc_h3.clone();
                            let mut cmc: Object<LocalCMC>;
                            let mut _nw4: Object<LocalCMC> = LocalCMC::_allocate_object();
                            LocalCMC::_ctor(&_nw4, c.entryCapacity().clone() as u64, _default::OptionalCountingNumber(c.entryPruningTailSize()).UnwrapOr(&truncate!((&int!(1)).clone(), i32)) as u64);
                            cmc = _nw4.clone();
                            let mut synCmc: Object<SynchronizedLocalCMC>;
                            let mut _nw5: Object<SynchronizedLocalCMC> = SynchronizedLocalCMC::_allocate_object(cmc.clone());
                            synCmc = _nw5.clone();
                            output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<SynchronizedLocalCMC>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<SynchronizedLocalCMC, dyn ICryptographicMaterialsCache>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<SynchronizedLocalCMC>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                                value: synCmc.clone()
                                            })));
                            return output.read();
                        } else {
                            if matches!((&_source0).as_ref(), StormTracking{ .. }) {
                                let mut ___mcc_h4: Arc<StormTrackingCache> = _source0.StormTracking().clone();
                                let mut c: Arc<StormTrackingCache> = ___mcc_h4.clone();
                                let mut cache: Arc<StormTrackingCache>;
                                let mut _dt__update__tmp_h1: Arc<StormTrackingCache> = c.clone();
                                let mut _dt__update_hentryPruningTailSize_h0: Arc<Option<CountingNumber>> = _default::OptionalCountingNumber(c.entryPruningTailSize());
                                cache = Arc::new(StormTrackingCache::StormTrackingCache {
                                            entryCapacity: _dt__update__tmp_h1.entryCapacity().clone(),
                                            entryPruningTailSize: _dt__update_hentryPruningTailSize_h0.clone(),
                                            gracePeriod: _dt__update__tmp_h1.gracePeriod().clone(),
                                            graceInterval: _dt__update__tmp_h1.graceInterval().clone(),
                                            fanOut: _dt__update__tmp_h1.fanOut().clone(),
                                            inFlightTTL: _dt__update__tmp_h1.inFlightTTL().clone(),
                                            sleepMilli: _dt__update__tmp_h1.sleepMilli().clone(),
                                            timeUnits: _dt__update__tmp_h1.timeUnits().clone()
                                        });
                                let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_StormTracker_Compile::_default::CheckSettings(&cache);
                                if valueOrError1.IsFailure() {
                                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn ICryptographicMaterialsCache>>());
                                    return output.read();
                                };
                                let mut cmc: Object<StormTracker>;
                                let mut _nw6: Object<StormTracker> = StormTracker::_allocate_object();
                                StormTracker::_ctor(&_nw6, &cache);
                                cmc = _nw6.clone();
                                let mut synCmc: Object<StormTrackingCMC>;
                                let mut _nw7: Object<StormTrackingCMC> = StormTrackingCMC::_allocate_object(cmc.clone());
                                synCmc = _nw7.clone();
                                output = MaybePlacebo::from(rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<StormTrackingCMC>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<StormTrackingCMC, dyn ICryptographicMaterialsCache>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<StormTrackingCMC>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                                    value: synCmc.clone()
                                                })));
                                return output.read();
                            } else {
                                let mut ___mcc_h5: Object<dyn ICryptographicMaterialsCache> = _source0.Shared().clone();
                                let mut c: Object<dyn ICryptographicMaterialsCache> = ___mcc_h5.clone();
                                let mut exception: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error> = Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: string_utf16_of("CreateCryptographicMaterialsCache should never be called with Shared CacheType.")
                                        });
                                output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<dyn ICryptographicMaterialsCache>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                                error: exception.clone()
                                            }));
                                return output.read();
                            }
                        }
                    }
                }
            };
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(850,3)
        pub fn OptionalCountingNumber(c: &Arc<Option<i32>>) -> Arc<Option<CountingNumber>> {
            if matches!(c.as_ref(), Some{ .. }) && c.value().clone() <= 0 {
                Arc::new(Option::<i32>::None {})
            } else {
                c.clone()
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(867,3)
        pub fn CreateDefaultClientSupplier(config: &Arc<Config>, input: &Arc<CreateDefaultClientSupplierInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut clientSupplier: Object<DefaultClientSupplier>;
            let mut _nw0: Object<DefaultClientSupplier> = DefaultClientSupplier::_allocate_object();
            DefaultClientSupplier::_ctor(&_nw0);
            clientSupplier = _nw0.clone();
            output = rc_coerce(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<DefaultClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::coerce(upcast_object::<DefaultClientSupplier, dyn IClientSupplier>(), upcast_id::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>()))(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Object<DefaultClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: clientSupplier.clone()
                        }));
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(874,3)
        pub fn InitializeEncryptionMaterials(config: &Arc<Config>, input: &Arc<InitializeEncryptionMaterialsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            crate::implementation_from_dafny::_Materials_Compile::_default::InitializeEncryptionMaterials(input)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(880,3)
        pub fn InitializeDecryptionMaterials(config: &Arc<Config>, input: &Arc<InitializeDecryptionMaterialsInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            crate::implementation_from_dafny::_Materials_Compile::_default::InitializeDecryptionMaterials(input)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(886,3)
        pub fn ValidEncryptionMaterialsTransition(config: &Arc<Config>, input: &Arc<ValidEncryptionMaterialsTransitionInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(input.start(), input.stop()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InvalidEncryptionMaterialsTransition {
                            message: string_utf16_of("Invalid Encryption Materials Transition")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<()>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                        value: ()
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(897,3)
        pub fn ValidDecryptionMaterialsTransition(config: &Arc<Config>, input: &Arc<ValidDecryptionMaterialsTransitionInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsTransitionIsValid(input.start(), input.stop()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InvalidDecryptionMaterialsTransition {
                            message: string_utf16_of("Invalid Decryption Materials Transition")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<()>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                        value: ()
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(908,3)
        pub fn EncryptionMaterialsHasPlaintextDataKey(config: &Arc<Config>, input: &Arc<EncryptionMaterials>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(input), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InvalidDecryptionMaterials {
                            message: string_utf16_of("Invalid Encryption Materials")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<()>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                        value: ()
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(918,3)
        pub fn DecryptionMaterialsWithPlaintextDataKey(config: &Arc<Config>, input: &Arc<DecryptionMaterials>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithPlaintextDataKey(input), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InvalidDecryptionMaterials {
                            message: string_utf16_of("Invalid Decryption Materials")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<()>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                        value: ()
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(929,3)
        pub fn GetAlgorithmSuiteInfo(config: &Arc<Config>, input: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AlgorithmSuiteInfo>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetAlgorithmSuiteInfo(input)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(935,3)
        pub fn ValidAlgorithmSuiteInfo(config: &Arc<Config>, input: &Arc<AlgorithmSuiteInfo>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::_AlgorithmSuite_q(input), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::InvalidAlgorithmSuiteInfo {
                            message: string_utf16_of("Invalid AlgorithmSuiteInfo")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<()>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                        value: ()
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(945,3)
        pub fn ValidateCommitmentPolicyOnEncrypt(config: &Arc<Config>, input: &Arc<ValidateCommitmentPolicyOnEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Commitment_Compile::_default::ValidateCommitmentPolicyOnEncrypt(input.algorithm(), input.commitmentPolicy());
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<()>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                        value: ()
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(953,3)
        pub fn ValidateCommitmentPolicyOnDecrypt(config: &Arc<Config>, input: &Arc<ValidateCommitmentPolicyOnDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Commitment_Compile::_default::ValidateCommitmentPolicyOnDecrypt(input.algorithm(), input.commitmentPolicy());
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<()>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                        value: ()
                    })
            }
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/AwsCryptographyMaterialProvidersOperations.dfy(73,3)
    #[derive(PartialEq, Clone)]
    pub enum Config {
        Config {
            crypto: Object<AtomicPrimitivesClient>
        }
    }

    impl Config {
        /// Returns a borrow of the field crypto
        pub fn crypto(&self) -> &Object<AtomicPrimitivesClient> {
            match self {
                Config::Config{crypto, } => crypto,
            }
        }
    }

    impl Debug
        for Config {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Config {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Config::Config{crypto, } => {
                    write!(_formatter, "AwsCryptographyMaterialProvidersOperations_Compile.Config.Config(")?;
                    DafnyPrint::fmt_print(crypto, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for Config {}

    impl Hash
        for Config {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Config::Config{crypto, } => {
                    Hash::hash(crypto, _state)
                },
            }
        }
    }

    impl ::std::default::Default
        for Config {
        fn default() -> Config {
            Config::Config {
                crypto: ::std::default::Default::default()
            }
        }
    }

    impl AsRef<Config>
        for Config {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(16,1)
pub mod _AwsCryptographyPrimitivesOperations_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HMacInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExtractInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExpandInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::KdfCtrInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AesKdfCtrInput;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRSAKeyPairInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRSAKeyPairOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPublicKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPrivateKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetRSAKeyModulusLengthInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetRSAKeyModulusLengthOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBits;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSADecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignInput;
    pub use crate::implementation_from_dafny::_dafny_externs::Signature::ECDSA;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSAVerifyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetPublicKeyFromPrivateKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetPublicKeyFromPrivateKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DeriveSharedSecretInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DeriveSharedSecretOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ParsePublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ParsePublicKeyOutput;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::dafny_runtime::seq;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(39,3)
        pub fn GenerateRandomBytes(config: &Arc<Config>, input: &Arc<GenerateRandomBytesInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::_Random_Compile::_default::GenerateBytes(input.length().clone());
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(50,3)
        pub fn Digest(config: &Arc<Config>, input: &Arc<DigestInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::_Digest_Compile::_default::Digest(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(59,3)
        pub fn HMac(config: &Arc<Config>, input: &Arc<HMacInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            crate::implementation_from_dafny::_WrappedHMAC_Compile::_default::Digest(input)
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(68,3)
        pub fn HkdfExtract(config: &Arc<Config>, input: &Arc<HkdfExtractInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::_WrappedHKDF_Compile::_default::Extract(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(81,3)
        pub fn HkdfExpand(config: &Arc<Config>, input: &Arc<HkdfExpandInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::_WrappedHKDF_Compile::_default::Expand(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(94,3)
        pub fn Hkdf(config: &Arc<Config>, input: &Arc<HkdfInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::_WrappedHKDF_Compile::_default::Hkdf(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(107,3)
        pub fn KdfCounterMode(config: &Arc<Config>, input: &Arc<KdfCtrInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::_KdfCtr_Compile::_default::KdfCounterMode(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(120,3)
        pub fn AesKdfCounterMode(config: &Arc<Config>, input: &Arc<AesKdfCtrInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Failure {
                        error: Arc::new(Error::AwsCryptographicPrimitivesError {
                                    message: string_utf16_of("Implement")
                                })
                    });
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(134,3)
        pub fn AESEncrypt(config: &Arc<Config>, input: &Arc<AESEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<Error>>> = crate::implementation_from_dafny::AESEncryption::_default::AESEncrypt(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(147,3)
        pub fn AESDecrypt(config: &Arc<Config>, input: &Arc<AESDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::AESEncryption::_default::AESDecrypt(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(156,3)
        pub fn GenerateRSAKeyPair(config: &Arc<Config>, input: &Arc<GenerateRSAKeyPairInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateRSAKeyPairOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateRSAKeyPairOutput>, Arc<Error>>>;
            let mut publicKey: Arc<RSAPublicKey>;
            let mut privateKey: Arc<RSAPrivateKey>;
            let mut _out0: Arc<RSAPublicKey>;
            let mut _out1: Arc<RSAPrivateKey>;
            let _x = crate::implementation_from_dafny::RSAEncryption::_default::GenerateKeyPair(input.lengthBits().clone());
            _out0 = _x.0;
            _out1 = _x.1;
            publicKey = _out0.clone();
            privateKey = _out1.clone();
            output = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GenerateRSAKeyPairOutput>, Arc<Error>>::Success {
                        value: Arc::new(GenerateRSAKeyPairOutput::GenerateRSAKeyPairOutput {
                                    publicKey: publicKey.clone(),
                                    privateKey: privateKey.clone()
                                })
                    });
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(166,3)
        pub fn GetRSAKeyModulusLength(config: &Arc<Config>, input: &Arc<GetRSAKeyModulusLengthInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetRSAKeyModulusLengthOutput>, Arc<Error>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<RSAModulusLengthBits, Arc<Error>>> = crate::implementation_from_dafny::RSAEncryption::_default::GetRSAKeyModulusLength(input.publicKey());
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<GetRSAKeyModulusLengthOutput>>()
            } else {
                let mut length: RSAModulusLengthBits = valueOrError0.Extract();
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GetRSAKeyModulusLengthOutput>, Arc<Error>>::Success {
                        value: Arc::new(GetRSAKeyModulusLengthOutput::GetRSAKeyModulusLengthOutput {
                                    length: length
                                })
                    })
            }
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(176,3)
        pub fn RSADecrypt(config: &Arc<Config>, input: &Arc<RSADecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::RSAEncryption::_default::Decrypt(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(185,3)
        pub fn RSAEncrypt(config: &Arc<Config>, input: &Arc<RSAEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::RSAEncryption::_default::Encrypt(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(194,3)
        pub fn GenerateECDSASignatureKey(config: &Arc<Config>, input: &Arc<GenerateECDSASignatureKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<Error>>> = crate::implementation_from_dafny::Signature::_default::KeyGen(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(203,3)
        pub fn ECDSASign(config: &Arc<Config>, input: &Arc<ECDSASignInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = ECDSA::Sign(input.signatureAlgorithm(), input.signingKey(), input.message());
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(212,3)
        pub fn ECDSAVerify(config: &Arc<Config>, input: &Arc<ECDSAVerifyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<Error>>> = ECDSA::Verify(input.signatureAlgorithm(), input.verificationKey(), input.message(), input.signature());
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(226,3)
        pub fn GenerateECCKeyPair(config: &Arc<Config>, input: &Arc<GenerateECCKeyPairInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateECCKeyPairOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateECCKeyPairOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateECCKeyPairOutput>, Arc<Error>>> = crate::implementation_from_dafny::ECDH::_default::GenerateEccKeyPair(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(235,3)
        pub fn GetPublicKeyFromPrivateKey(config: &Arc<Config>, input: &Arc<GetPublicKeyFromPrivateKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<Error>>> = crate::implementation_from_dafny::ECDH::_default::GetPublicKeyFromPrivate(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(244,3)
        pub fn ValidatePublicKey(config: &Arc<Config>, input: &Arc<ValidatePublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ValidatePublicKeyOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ValidatePublicKeyOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ValidatePublicKeyOutput>, Arc<Error>>> = crate::implementation_from_dafny::ECDH::_default::ValidatePublicKey(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(253,3)
        pub fn DeriveSharedSecret(config: &Arc<Config>, input: &Arc<DeriveSharedSecretInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DeriveSharedSecretOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DeriveSharedSecretOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DeriveSharedSecretOutput>, Arc<Error>>> = crate::implementation_from_dafny::ECDH::_default::DeriveSharedSecret(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(262,3)
        pub fn CompressPublicKey(config: &Arc<Config>, input: &Arc<CompressPublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CompressPublicKeyOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CompressPublicKeyOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CompressPublicKeyOutput>, Arc<Error>>> = crate::implementation_from_dafny::ECDH::_default::CompressPublicKey(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(271,3)
        pub fn DecompressPublicKey(config: &Arc<Config>, input: &Arc<DecompressPublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecompressPublicKeyOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecompressPublicKeyOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecompressPublicKeyOutput>, Arc<Error>>> = crate::implementation_from_dafny::ECDH::_default::DecompressPublicKey(input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(280,3)
        pub fn ParsePublicKey(config: &Arc<Config>, input: &Arc<ParsePublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ParsePublicKeyOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ParsePublicKeyOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ParsePublicKeyOutput>, Arc<Error>>> = crate::implementation_from_dafny::ECDH::_default::ParsePublicKey(input);
            output = _out0.clone();
            return output.clone();
        }
    }

    /// ../mpl/AwsCryptographyPrimitives/src/AwsCryptographyPrimitivesOperations.dfy(27,3)
    #[derive(PartialEq, Clone)]
    pub enum Config {
        Config {}
    }

    impl Config {}

    impl Debug
        for Config {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Config {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Config::Config{} => {
                    write!(_formatter, "AwsCryptographyPrimitivesOperations_Compile.Config.Config")?;
                    Ok(())
                },
            }
        }
    }

    impl Config {
        /// Enumerates all possible values of Config
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<Config>> {
            seq![Arc::new(Config::Config {})].iter()
        }
    }

    impl Eq
        for Config {}

    impl Hash
        for Config {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Config::Config{} => {

                },
            }
        }
    }

    impl Default
        for Config {
        fn default() -> Config {
            Config::Config {}
        }
    }

    impl AsRef<Config>
        for Config {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(18,1)
pub mod _AwsEncryptionSdkOperations_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptOutput;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::dafny_runtime::map;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IAwsCryptographicMaterialProvidersClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId::ESDK;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16;
    pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageId;
    pub use crate::implementation_from_dafny::_KeyDerivation_Compile::ExpandedKeyMaterial;
    pub use crate::implementation_from_dafny::_Header_Compile::HeaderInfo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::_MessageBody_Compile::FramedMessage;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptOutput;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::_HeaderAuth_Compile::AESMac;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF;
    pub use crate::implementation_from_dafny::_EncryptionContext_Compile::ESDKCanonicalEncryptionContext;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::NetV4_0_0_RetryPolicy;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType::NonFramed;
    pub use ::dafny_runtime::MapBuilder;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// = compliance/client-apis/encrypt.txt#2.6.1
        /// = type=implication
        /// # If an input algorithm suite (Section 2.4.5) is provided that is not
        /// # supported by the commitment policy (client.md#commitment-policy)
        /// # configured in the client (client.md) encrypt MUST yield an error.
        ///
        /// = compliance/client-apis/client.txt#2.4.2.1
        /// = type=implication
        /// # *  encrypt (encrypt.md) MUST only support algorithm suites that have
        /// # a Key Commitment (../framework/algorithm-suites.md#algorithm-
        /// # suites-encryption-key-derivation-settings) value of False
        ///
        /// = compliance/client-apis/client.txt#2.4.2.2
        /// = type=implication
        /// # *  encrypt (encrypt.md) MUST only support algorithm suites that have
        /// # a Key Commitment (../framework/algorithm-suites.md#algorithm-
        /// # suites-encryption-key-derivation-settings) value of True
        ///
        /// = compliance/client-apis/client.txt#2.4.2.3
        /// = type=implication
        /// # *  encrypt (encrypt.md) MUST only support algorithm suites that have
        /// # a Key Commitment (../framework/algorithm-suites.md#algorithm-
        /// # suites-encryption-key-derivation-settings) value of True
        /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(67,3)
        pub fn Encrypt(config: &Arc<Config>, input: &Arc<EncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<i64, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            if matches!(input.frameLength().as_ref(), Some{ .. }) {
                let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(0 < input.frameLength().value().clone() && input.frameLength().value().clone() <= 4294967295, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                message: string_utf16_of("FrameLength must be greater than 0 and less than 2^32")
                            }));
                if valueOrError0.IsFailure() {
                    valueOrError1 = valueOrError0.PropagateFailure::<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::FrameLength>();
                } else {
                    valueOrError1 = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::FrameLength, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                                value: input.frameLength().value().clone()
                            });
                }
            } else {
                valueOrError1 = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::FrameLength, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::DEFAULT_FRAME_LENGTH()
                        });
            };
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut frameLength: crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::FrameLength = valueOrError1.Extract();
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::ValidateEncryptionContext(input.encryptionContext());
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            if matches!(input.encryptionContext().as_ref(), Some{ .. }) {
                encryptionContext = input.encryptionContext().value().clone();
            } else {
                encryptionContext = map![];
            };
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::CreateCmmFromInput(input.materialsManager(), input.keyring());
            valueOrError3 = _out0.clone();
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut cmm: Object<dyn ICryptographicMaterialsManager> = valueOrError3.Extract();
            let mut algorithmSuiteId: Arc<Option<Arc<AlgorithmSuiteId>>>;
            if matches!(input.algorithmSuiteId().as_ref(), Some{ .. }) {
                algorithmSuiteId = Arc::new(Option::<Arc<AlgorithmSuiteId>>::Some {
                            value: Arc::new(AlgorithmSuiteId::ESDK {
                                        ESDK: input.algorithmSuiteId().value().clone()
                                    })
                        });
            } else {
                algorithmSuiteId = Arc::new(Option::<Arc<AlgorithmSuiteId>>::None {});
            };
            if matches!((&algorithmSuiteId).as_ref(), Some{ .. }) {
                let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::ValidateCommitmentPolicyOnEncrypt(rd!(config.mpl().clone()), &Arc::new(ValidateCommitmentPolicyOnEncryptInput::ValidateCommitmentPolicyOnEncryptInput {
                                algorithm: algorithmSuiteId.value().clone(),
                                commitmentPolicy: Arc::new(CommitmentPolicy::ESDK {
                                            ESDK: config.commitmentPolicy().clone()
                                        })
                            })).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                            AwsCryptographyMaterialProviders: e.clone()
                                        })
                                })
                        }));
                if valueOrError4.IsFailure() {
                    output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<EncryptOutput>>());
                    return output.read();
                };
                let mut _v0: () = valueOrError4.Extract();
            };
            let mut valueOrError5: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(truncate!(input.plaintext().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT64_MAX_LIMIT(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Plaintext exceeds maximum allowed size")
                        }));
            if valueOrError5.IsFailure() {
                output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::GetEncryptionMaterials(&cmm, &algorithmSuiteId, &encryptionContext, truncate!(input.plaintext().cardinality(), i64), config.commitmentPolicy(), config.mpl());
            valueOrError6 = _out1.clone();
            if valueOrError6.IsFailure() {
                output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut materials: Arc<EncryptionMaterials> = valueOrError6.Extract();
            let mut valueOrError7: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(matches!(materials.algorithmSuite().id().as_ref(), ESDK{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Encryption materials contain incompatible algorithm suite for the AWS Encryption SDK.")
                        }));
            if valueOrError7.IsFailure() {
                output = MaybePlacebo::from(valueOrError7.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut valueOrError8: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::ValidateMaxEncryptedDataKeys(config.maxEncryptedDataKeys(), materials.encryptedDataKeys());
            if valueOrError8.IsFailure() {
                output = MaybePlacebo::from(valueOrError8.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut encryptedDataKeys: seq16<ESDKEncryptedDataKey> = materials.encryptedDataKeys().clone();
            let mut valueOrError9: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<MessageId, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<MessageId, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::GenerateMessageId(materials.algorithmSuite(), config.crypto());
            valueOrError9 = _out2.clone();
            if valueOrError9.IsFailure() {
                output = MaybePlacebo::from(valueOrError9.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut messageId: MessageId = valueOrError9.Extract();
            let mut maybeDerivedDataKeys: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_KeyDerivation_Compile::_default::DeriveKeys(&messageId, materials.plaintextDataKey().value(), materials.algorithmSuite(), config.crypto(), config.netV4_0_0_RetryPolicy(), false);
            maybeDerivedDataKeys = _out3.clone();
            let mut valueOrError10: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeDerivedDataKeys.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                        message: string_utf16_of("Failed to derive data keys")
                                    })
                            })
                    }));
            if valueOrError10.IsFailure() {
                output = MaybePlacebo::from(valueOrError10.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut derivedDataKeys: Arc<ExpandedKeyMaterial> = valueOrError10.Extract();
            let mut maybeHeader: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<HeaderInfo>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<HeaderInfo>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::BuildHeaderForEncrypt(&messageId, materials.algorithmSuite(), materials.encryptionContext(), materials.requiredEncryptionContextKeys(), &encryptedDataKeys, frameLength as u32, &derivedDataKeys, config.crypto());
            maybeHeader = _out4.clone();
            let mut valueOrError11: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(matches!((&maybeHeader).as_ref(), Success{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Failed to build header body")
                        }));
            if valueOrError11.IsFailure() {
                output = MaybePlacebo::from(valueOrError11.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut header: Arc<HeaderInfo> = maybeHeader.value().clone();
            let mut valueOrError12: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<FramedMessage, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<FramedMessage, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_MessageBody_Compile::_default::EncryptMessageBody(input.plaintext(), &header, derivedDataKeys.dataKey(), config.crypto());
            valueOrError12 = _out5.clone();
            if valueOrError12.IsFailure() {
                output = MaybePlacebo::from(valueOrError12.PropagateFailure::<Arc<EncryptOutput>>());
                return output.read();
            };
            let mut framedMessage: FramedMessage = valueOrError12.Extract();
            let mut maybeSignedMessage: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::SignAndSerializeMessage(config, &header, &framedMessage, &materials);
            maybeSignedMessage = _out6.clone();
            output = MaybePlacebo::from(maybeSignedMessage.clone());
            return output.read();
        }
        /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(240,3)
        pub fn SignAndSerializeMessage(config: &Arc<Config>, header: &Arc<HeaderInfo>, framedMessage: &FramedMessage, materials: &Arc<EncryptionMaterials>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            if matches!(framedMessage.finalFrame().header().suite().signature().as_ref(), ECDSA{ .. }) {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::SerializeMessageWithoutSignature(framedMessage, materials.algorithmSuite());
                if valueOrError0.IsFailure() {
                    output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<EncryptOutput>>());
                    return output.read();
                };
                let mut msg: Sequence<u8> = valueOrError0.Extract();
                let mut ecdsaParams: Arc<ECDSASignatureAlgorithm> = framedMessage.finalFrame().header().suite().signature().ECDSA().curve().clone();
                let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(matches!(materials.signingKey().as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                message: string_utf16_of("Missing signing key.")
                            }));
                if valueOrError1.IsFailure() {
                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<EncryptOutput>>());
                    return output.read();
                };
                let mut maybeBytes: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::ECDSASign(rd!(config.crypto().clone()), &Arc::new(ECDSASignInput::ECDSASignInput {
                                signatureAlgorithm: ecdsaParams.clone(),
                                signingKey: materials.signingKey().value().clone(),
                                message: msg.clone()
                            }));
                maybeBytes = _out0.clone();
                let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeBytes.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                            AwsCryptographyPrimitives: e.clone()
                                        })
                                })
                        }));
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<EncryptOutput>>());
                    return output.read();
                };
                let mut bytes: Sequence<u8> = valueOrError2.Extract();
                let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(truncate!(bytes.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                message: string_utf16_of("Length of signature bytes is larger than the uint16 limit.")
                            }));
                if valueOrError3.IsFailure() {
                    output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<EncryptOutput>>());
                    return output.read();
                };
                let mut signature: Sequence<u8> = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt16ToSeq(truncate!(bytes.cardinality(), u16)).concat(&bytes);
                msg = msg.concat(&signature);
                output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                                value: Arc::new(EncryptOutput::EncryptOutput {
                                            ciphertext: msg.clone(),
                                            encryptionContext: header.encryptionContext().clone(),
                                            algorithmSuiteId: header.suite().id().ESDK().clone()
                                        })
                            }));
                return output.read();
            } else {
                let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::SerializeMessageWithoutSignature(framedMessage, materials.algorithmSuite());
                if valueOrError4.IsFailure() {
                    output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<EncryptOutput>>());
                    return output.read();
                };
                let mut msg: Sequence<u8> = valueOrError4.Extract();
                output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                                value: Arc::new(EncryptOutput::EncryptOutput {
                                            ciphertext: msg.clone(),
                                            encryptionContext: header.encryptionContext().clone(),
                                            algorithmSuiteId: header.suite().id().ESDK().clone()
                                        })
                            }));
                return output.read();
            };
            return output.read();
        }
        /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(382,3)
        pub fn Decrypt(config: &Arc<Config>, input: &Arc<DecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::CreateCmmFromInput(input.materialsManager(), input.keyring());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            let mut cmm: Object<dyn ICryptographicMaterialsManager> = valueOrError0.Extract();
            let mut buffer: Arc<ReadableBuffer> = Arc::new(ReadableBuffer::ReadableBuffer {
                        bytes: input.ciphertext().clone(),
                        start: 0
                    });
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::InternalDecrypt(config, &cmm, &buffer, input.encryptionContext());
            output = MaybePlacebo::from(_out1.clone());
            return output.read();
        }
        /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(438,3)
        pub fn InternalDecrypt(config: &Arc<Config>, cmm: &Object<dyn ICryptographicMaterialsManager>, buffer: &Arc<ReadableBuffer>, inputEncryptionContext: &Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut v4Retry: bool = false;
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Arc<HeaderBody>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Header_Compile::_default::ReadHeaderBody(buffer, config.maxEncryptedDataKeys(), config.mpl()).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::MapSerializeFailure(&string_utf16_of(": ReadHeaderBody")));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            let mut headerBody: Arc<SuccessfulRead<Arc<HeaderBody>>> = valueOrError0.Extract();
            let mut rawHeader: Sequence<u8> = buffer.bytes().slice(&int!(buffer.start().clone()), &int!(headerBody.tail().start().clone()));
            let mut algorithmSuite: Arc<AlgorithmSuiteInfo> = headerBody.data().algorithmSuite().clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::ValidateCommitmentPolicyOnDecrypt(rd!(config.mpl().clone()), &Arc::new(ValidateCommitmentPolicyOnDecryptInput::ValidateCommitmentPolicyOnDecryptInput {
                            algorithm: algorithmSuite.id().clone(),
                            commitmentPolicy: Arc::new(CommitmentPolicy::ESDK {
                                        ESDK: config.commitmentPolicy().clone()
                                    })
                        })).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                        AwsCryptographyMaterialProviders: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            let mut _v1: () = valueOrError1.Extract();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::GetDecryptionMaterials(cmm, algorithmSuite.id(), headerBody.data(), inputEncryptionContext, config.commitmentPolicy(), config.mpl());
            valueOrError2 = _out0.clone();
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            let mut decMat: Arc<DecryptionMaterials> = valueOrError2.Extract();
            let mut suite: Arc<AlgorithmSuiteInfo> = decMat.algorithmSuite().clone();
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(suite.clone() == algorithmSuite.clone(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Stored header algorithm suite does not match decryption algorithm suite.")
                        }));
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<AESMac>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_HeaderAuth_Compile::_default::ReadHeaderAuthTag(headerBody.tail(), &suite).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::MapSerializeFailure(&string_utf16_of(": ReadHeaderAuthTag")));
            if valueOrError4.IsFailure() {
                output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            let mut headerAuth: Arc<SuccessfulRead<AESMac>> = valueOrError4.Extract();
            let mut maybeDerivedDataKeys: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_KeyDerivation_Compile::_default::DeriveKeys(headerBody.data().messageId(), decMat.plaintextDataKey().value(), &suite, config.crypto(), config.netV4_0_0_RetryPolicy(), false);
            maybeDerivedDataKeys = _out1.clone();
            let mut valueOrError5: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(matches!((&maybeDerivedDataKeys).as_ref(), Success{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Failed to derive data keys")
                        }));
            if valueOrError5.IsFailure() {
                output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            let mut derivedDataKeys: Arc<ExpandedKeyMaterial> = maybeDerivedDataKeys.value().clone();
            let mut valueOrError6: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(crate::implementation_from_dafny::_Header_Compile::_default::_HeaderVersionSupportsCommitment_q(&suite, headerBody.data()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Invalid commitment values found in header body")
                        }));
            if valueOrError6.IsFailure() {
                output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            if matches!(suite.commitment().as_ref(), HKDF{ .. }) {
                let mut valueOrError7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::ValidateSuiteData(&suite, headerBody.data(), derivedDataKeys.commitmentKey().value());
                valueOrError7 = _out2.clone();
                if valueOrError7.IsFailure() {
                    output = MaybePlacebo::from(valueOrError7.PropagateFailure::<Arc<DecryptOutput>>());
                    return output.read();
                };
                let mut _v2: () = valueOrError7.Extract();
            };
            let mut headerEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::GetEncryptionContext(headerBody.data().encryptionContext());
            let mut encryptionContextToOnlyAuthenticate: Map<ValidUTF8Bytes, ValidUTF8Bytes> = _default::buildEncryptionContextToOnlyAuthenticate(&decMat);
            let mut canonicalReqEncryptionContext: ESDKCanonicalEncryptionContext = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::GetCanonicalEncryptionContext(&encryptionContextToOnlyAuthenticate);
            let mut serializedReqEncryptionContext: Sequence<u8> = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::WriteEmptyEcOrWriteAAD(&canonicalReqEncryptionContext);
            let mut maybeHeaderAuth: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESDecrypt(rd!(config.crypto().clone()), &Arc::new(AESDecryptInput::AESDecryptInput {
                            encAlg: suite.encrypt().AES_GCM().clone(),
                            key: derivedDataKeys.dataKey().clone(),
                            cipherTxt: seq![] as Sequence<u8>,
                            authTag: headerAuth.data().headerAuthTag().clone(),
                            iv: headerAuth.data().headerIv().clone(),
                            aad: rawHeader.concat(&serializedReqEncryptionContext)
                        }));
            maybeHeaderAuth = _out3.clone();
            if matches!((&maybeHeaderAuth).as_ref(), Failure{ .. }) && config.netV4_0_0_RetryPolicy().clone() == Arc::new(NetV4_0_0_RetryPolicy::ALLOW_RETRY {}) && v4Retry == false {
                v4Retry = true;
                let mut _out4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_KeyDerivation_Compile::_default::DeriveKeys(headerBody.data().messageId(), decMat.plaintextDataKey().value(), &suite, config.crypto(), config.netV4_0_0_RetryPolicy(), true);
                maybeDerivedDataKeys = _out4.clone();
                let mut valueOrError8: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(matches!((&maybeDerivedDataKeys).as_ref(), Success{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                message: string_utf16_of("Failed to derive data keys")
                            }));
                if valueOrError8.IsFailure() {
                    output = MaybePlacebo::from(valueOrError8.PropagateFailure::<Arc<DecryptOutput>>());
                    return output.read();
                };
                derivedDataKeys = maybeDerivedDataKeys.value().clone();
                serializedReqEncryptionContext = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::WriteAAD(&canonicalReqEncryptionContext);
                let mut _out5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESDecrypt(rd!(config.crypto().clone()), &Arc::new(AESDecryptInput::AESDecryptInput {
                                encAlg: suite.encrypt().AES_GCM().clone(),
                                key: derivedDataKeys.dataKey().clone(),
                                cipherTxt: seq![] as Sequence<u8>,
                                authTag: headerAuth.data().headerAuthTag().clone(),
                                iv: headerAuth.data().headerIv().clone(),
                                aad: rawHeader.concat(&serializedReqEncryptionContext)
                            }));
                maybeHeaderAuth = _out5.clone();
            };
            let mut valueOrError9: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeHeaderAuth.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError9.IsFailure() {
                output = MaybePlacebo::from(valueOrError9.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            let mut _v3: Sequence<u8> = valueOrError9.Extract();
            let mut header: Arc<HeaderInfo> = Arc::new(HeaderInfo::HeaderInfo {
                        body: headerBody.data().clone(),
                        rawHeader: rawHeader.clone(),
                        encryptionContext: headerEncryptionContext.clone(),
                        suite: suite.clone(),
                        headerAuth: headerAuth.data().clone()
                    });
            let mut key: Sequence<u8> = derivedDataKeys.dataKey().clone();
            let mut plaintext: Sequence<u8>;
            let mut messageBodyTail: Arc<ReadableBuffer>;
            let mut _source0: Arc<ContentType> = header.body().contentType().clone();
            if matches!((&_source0).as_ref(), NonFramed{ .. }) {
                let mut valueOrError10: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Sequence<u8>, Arc<ReadableBuffer>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                let mut _out6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Sequence<u8>, Arc<ReadableBuffer>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::ReadAndDecryptNonFramedMessageBody(headerAuth.tail(), &header, &key, config.crypto());
                valueOrError10 = _out6.clone();
                if valueOrError10.IsFailure() {
                    output = MaybePlacebo::from(valueOrError10.PropagateFailure::<Arc<DecryptOutput>>());
                    return output.read();
                };
                let mut decryptRes: (Sequence<u8>, Arc<ReadableBuffer>) = valueOrError10.Extract();
                plaintext = decryptRes.0.clone();
                messageBodyTail = decryptRes.1.clone();
            } else {
                let mut valueOrError11: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Sequence<u8>, Arc<ReadableBuffer>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                let mut _out7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Sequence<u8>, Arc<ReadableBuffer>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::ReadAndDecryptFramedMessageBody(headerAuth.tail(), &header, &key, config.crypto());
                valueOrError11 = _out7.clone();
                if valueOrError11.IsFailure() {
                    output = MaybePlacebo::from(valueOrError11.PropagateFailure::<Arc<DecryptOutput>>());
                    return output.read();
                };
                let mut decryptRes: (Sequence<u8>, Arc<ReadableBuffer>) = valueOrError11.Extract();
                plaintext = decryptRes.0.clone();
                messageBodyTail = decryptRes.1.clone();
            };
            let mut valueOrError12: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ReadableBuffer>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out8: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ReadableBuffer>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EncryptDecryptHelpers_Compile::_default::VerifySignature(&messageBodyTail, &messageBodyTail.bytes().slice(&int!(buffer.start().clone()), &int!(messageBodyTail.start().clone())), &decMat, config.crypto());
            valueOrError12 = _out8.clone();
            if valueOrError12.IsFailure() {
                output = MaybePlacebo::from(valueOrError12.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            let mut signature: Arc<ReadableBuffer> = valueOrError12.Extract();
            let mut valueOrError13: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(signature.start().clone() == truncate!(signature.bytes().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Data after message footer.")
                        }));
            if valueOrError13.IsFailure() {
                output = MaybePlacebo::from(valueOrError13.PropagateFailure::<Arc<DecryptOutput>>());
                return output.read();
            };
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: Arc::new(DecryptOutput::DecryptOutput {
                                        plaintext: plaintext.clone(),
                                        encryptionContext: header.encryptionContext().merge(&encryptionContextToOnlyAuthenticate),
                                        algorithmSuiteId: header.suite().id().ESDK().clone()
                                    })
                        }));
            return output.read();
        }
        /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(807,3)
        pub fn buildEncryptionContextToOnlyAuthenticate(decMat: &Arc<DecryptionMaterials>) -> Map<ValidUTF8Bytes, ValidUTF8Bytes> {
            (&({
                let mut decMat = decMat.clone();
                Arc::new(move || -> Map<ValidUTF8Bytes, ValidUTF8Bytes>{
                        let mut _coll0: MapBuilder<ValidUTF8Bytes, ValidUTF8Bytes> = MapBuilder::<ValidUTF8Bytes, ValidUTF8Bytes>::new();
                        for __compr_0 in decMat.encryptionContext().keys().iter().cloned() {
                            let mut k: ValidUTF8Bytes = __compr_0.clone();
                            if {
                                    let i: Sequence<u8> = k.clone();
                                    crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                } {
                                if decMat.encryptionContext().contains(&k) && decMat.requiredEncryptionContextKeys().contains(&k) {
                                    _coll0.add(&k, &decMat.encryptionContext().get(&k))
                                }
                            }
                        }
                        _coll0.build()
                    })
            }))()
        }
    }

    /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(41,3)
    #[derive(PartialEq, Clone)]
    pub enum Config {
        Config {
            crypto: Object<AtomicPrimitivesClient>,
            mpl: Object<MaterialProvidersClient>,
            commitmentPolicy: Arc<ESDKCommitmentPolicy>,
            maxEncryptedDataKeys: Arc<Option<CountingNumbers>>,
            netV4_0_0_RetryPolicy: Arc<NetV4_0_0_RetryPolicy>
        }
    }

    impl Config {
        /// Returns a borrow of the field crypto
        pub fn crypto(&self) -> &Object<AtomicPrimitivesClient> {
            match self {
                Config::Config{crypto, mpl, commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => crypto,
            }
        }
        /// Returns a borrow of the field mpl
        pub fn mpl(&self) -> &Object<MaterialProvidersClient> {
            match self {
                Config::Config{crypto, mpl, commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => mpl,
            }
        }
        /// Returns a borrow of the field commitmentPolicy
        pub fn commitmentPolicy(&self) -> &Arc<ESDKCommitmentPolicy> {
            match self {
                Config::Config{crypto, mpl, commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => commitmentPolicy,
            }
        }
        /// Returns a borrow of the field maxEncryptedDataKeys
        pub fn maxEncryptedDataKeys(&self) -> &Arc<Option<CountingNumbers>> {
            match self {
                Config::Config{crypto, mpl, commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => maxEncryptedDataKeys,
            }
        }
        /// Returns a borrow of the field netV4_0_0_RetryPolicy
        pub fn netV4_0_0_RetryPolicy(&self) -> &Arc<NetV4_0_0_RetryPolicy> {
            match self {
                Config::Config{crypto, mpl, commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => netV4_0_0_RetryPolicy,
            }
        }
    }

    impl Debug
        for Config {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Config {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Config::Config{crypto, mpl, commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => {
                    write!(_formatter, "AwsEncryptionSdkOperations_Compile.Config.Config(")?;
                    DafnyPrint::fmt_print(crypto, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(mpl, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(commitmentPolicy, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(maxEncryptedDataKeys, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(netV4_0_0_RetryPolicy, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for Config {}

    impl Hash
        for Config {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Config::Config{crypto, mpl, commitmentPolicy, maxEncryptedDataKeys, netV4_0_0_RetryPolicy, } => {
                    Hash::hash(crypto, _state);
                    Hash::hash(mpl, _state);
                    Hash::hash(commitmentPolicy, _state);
                    Hash::hash(maxEncryptedDataKeys, _state);
                    Hash::hash(netV4_0_0_RetryPolicy, _state)
                },
            }
        }
    }

    impl Default
        for Config {
        fn default() -> Config {
            Config::Config {
                crypto: Default::default(),
                mpl: Default::default(),
                commitmentPolicy: Default::default(),
                maxEncryptedDataKeys: Default::default(),
                netV4_0_0_RetryPolicy: Default::default()
            }
        }
    }

    impl AsRef<Config>
        for Config {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/AwsEncryptionSdkOperations.dfy(51,3)
    pub type FrameLength = i64;
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(15,1)
pub mod _AwsKmsDiscoveryKeyring_Compile {
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult;
    pub use crate::implementation_from_dafny::_Constants_Compile::AwsKmsEdkHelper;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicAction;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsArn;
    pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::KmsUnwrapKeyMaterial;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::KmsUnwrapInfo;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(574,3)
        pub fn DiscoveryMatch(arn: &AwsKmsArn, discoveryFilter: &Arc<Option<Arc<DiscoveryFilter>>>) -> bool {
            true && (&({
                let mut arn = arn.clone();
                Arc::new(move |_source0: &Arc<Option<Arc<DiscoveryFilter>>>| -> bool{
                        if matches!(_source0.as_ref(), None{ .. }) {
                            true
                        } else {
                            let mut ___mcc_h0: Arc<DiscoveryFilter> = _source0.value().clone();
                            let mut filter: Arc<DiscoveryFilter> = ___mcc_h0.clone();
                            filter.partition().clone() == arn.partition().clone() && filter.accountIds().clone() <= seq![arn.account().clone()]
                        }
                    })
            }))(discoveryFilter)
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(35,3)
    pub struct AwsKmsDiscoveryKeyring {
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_discoveryFilter: Arc<Option<Arc<DiscoveryFilter>>>,
        pub __i_grantTokens: GrantTokenList
    }

    impl AwsKmsDiscoveryKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(57,5)
        pub fn _ctor(this: &Object<AwsKmsDiscoveryKeyring>, client: &Object<dyn IKMSClient>, discoveryFilter: &Arc<Option<Arc<DiscoveryFilter>>>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_client: bool = false;
            let mut _set___i_discoveryFilter: bool = false;
            let mut _set___i_grantTokens: bool = false;
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_discoveryFilter, _set___i_discoveryFilter, discoveryFilter.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(41,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(42,5)
        pub fn discoveryFilter(&self) -> Arc<Option<Arc<DiscoveryFilter>>> {
            self.__i_discoveryFilter.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(43,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsDiscoveryKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for AwsKmsDiscoveryKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for AwsKmsDiscoveryKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for AwsKmsDiscoveryKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(105,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>> {
            let mut output: Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>> = Arc::new(Result::<Arc<OnEncryptOutput>, Arc<Error>>::Failure {
                        error: Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Encryption is not supported with a Discovery Keyring.")
                                })
                    });
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(147,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>>>::new();
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut encryptedDataKeys: Sequence<Arc<EncryptedDataKey>> = input.encryptedDataKeys().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(&materials), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut edkFilter: Object<AwsKmsEncryptedDataKeyFilter>;
            let mut _nw0: Object<AwsKmsEncryptedDataKeyFilter> = AwsKmsEncryptedDataKeyFilter::_allocate_object();
            AwsKmsEncryptedDataKeyFilter::_ctor(&_nw0, &self.discoveryFilter().clone());
            edkFilter = _nw0.clone();
            let mut valueOrError1: Arc<Result<Sequence<Arc<EncryptedDataKey>>, Arc<Error>>>;
            let mut _out0: Arc<Result<Sequence<Arc<EncryptedDataKey>>, Arc<Error>>> = crate::implementation_from_dafny::_Actions_Compile::_default::FilterWithResult::<Arc<EncryptedDataKey>, Arc<Error>>(&upcast_object::<AwsKmsEncryptedDataKeyFilter, dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<Error>>>()(edkFilter.clone()), &encryptedDataKeys);
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut matchingEdks: Sequence<Arc<EncryptedDataKey>> = valueOrError1.Extract();
            let mut edkTransform: Object<AwsKmsEncryptedDataKeyTransformer>;
            let mut _nw1: Object<AwsKmsEncryptedDataKeyTransformer> = AwsKmsEncryptedDataKeyTransformer::_allocate_object();
            AwsKmsEncryptedDataKeyTransformer::_ctor(&_nw1);
            edkTransform = _nw1.clone();
            let mut valueOrError2: Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>;
            let mut _out1: Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>> = crate::implementation_from_dafny::_Actions_Compile::_default::DeterministicFlatMapWithResult::<Arc<EncryptedDataKey>, Arc<AwsKmsEdkHelper>, Arc<Error>>(&upcast_object::<AwsKmsEncryptedDataKeyTransformer, dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>()(edkTransform.clone()), &matchingEdks);
            valueOrError2 = _out1.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut edksToAttempt: Sequence<Arc<AwsKmsEdkHelper>> = valueOrError2.Extract();
            if 0 == truncate!(edksToAttempt.cardinality(), u64) {
                let mut valueOrError3: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of(""));
                if valueOrError3.IsFailure() {
                    res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnDecryptOutput>>());
                    return res.read();
                };
                let mut errorMessage: Sequence<DafnyCharUTF16> = valueOrError3.Extract();
                res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Failure {
                                error: Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                            message: errorMessage.clone()
                                        })
                            }));
                return res.read();
            };
            let mut decryptAction: Object<AwsKmsEncryptedDataKeyDecryptor>;
            let mut _nw2: Object<AwsKmsEncryptedDataKeyDecryptor> = AwsKmsEncryptedDataKeyDecryptor::_allocate_object();
            AwsKmsEncryptedDataKeyDecryptor::_ctor(&_nw2, &materials, &self.client().clone(), &self.grantTokens().clone());
            decryptAction = _nw2.clone();
            let mut outcome: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<Error>>>>;
            let mut _out2: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<Error>>>> = crate::implementation_from_dafny::_Actions_Compile::_default::ReduceToSuccess::<Arc<AwsKmsEdkHelper>, SealedDecryptionMaterials, Arc<Error>>(&upcast_object::<AwsKmsEncryptedDataKeyDecryptor, dyn ActionWithResult<Arc<AwsKmsEdkHelper>, SealedDecryptionMaterials, Arc<Error>>>()(decryptAction.clone()), &edksToAttempt);
            outcome = _out2.clone();
            let mut _source0: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<Error>>>> = outcome.clone();
            if matches!((&_source0).as_ref(), Success{ .. }) {
                let mut ___mcc_h0: SealedDecryptionMaterials = _source0.value().clone();
                let mut mat: SealedDecryptionMaterials = ___mcc_h0.clone();
                res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Success {
                                value: Arc::new(OnDecryptOutput::OnDecryptOutput {
                                            materials: mat.clone()
                                        })
                            }));
            } else {
                let mut ___mcc_h1: Sequence<Arc<Error>> = _source0.error().clone();
                let mut errors: Sequence<Arc<Error>> = ___mcc_h1.clone();
                res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Failure {
                                error: Arc::new(Error::CollectionOfErrors {
                                            list: errors.clone(),
                                            message: string_utf16_of("No Configured KMS Key was able to decrypt the Data Key. The list of encountered Exceptions is available via `list`.")
                                        })
                            }));
            };
            return res.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for AwsKmsDiscoveryKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(311,3)
    pub struct AwsKmsEncryptedDataKeyFilter {
        pub __i_discoveryFilter: Arc<Option<Arc<DiscoveryFilter>>>
    }

    impl AwsKmsEncryptedDataKeyFilter {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(319,5)
        pub fn _ctor(this: &Object<AwsKmsEncryptedDataKeyFilter>, discoveryFilter: &Arc<Option<Arc<DiscoveryFilter>>>) -> () {
            let mut _set___i_discoveryFilter: bool = false;
            update_field_uninit_object!(this.clone(), __i_discoveryFilter, _set___i_discoveryFilter, discoveryFilter.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(318,5)
        pub fn discoveryFilter(&self) -> Arc<Option<Arc<DiscoveryFilter>>> {
            self.__i_discoveryFilter.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsEncryptedDataKeyFilter {
        UpcastObjectFn!(DynAny);
    }

    impl DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<Error>>
        for AwsKmsEncryptedDataKeyFilter {}

    impl UpcastObject<dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<Error>>>
        for AwsKmsEncryptedDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<Error>>);
    }

    impl DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<Error>>>>
        for AwsKmsEncryptedDataKeyFilter {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(348,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<Result<bool, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<bool, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderInfo()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid AWS KMS encoding, provider info is not UTF8.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<bool>());
                return output.read();
            };
            let mut valueOrError1: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(edk.keyProviderInfo()).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<bool>());
                return output.read();
            };
            let mut keyId: Sequence<DafnyCharUTF16> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<AwsKmsArn, Arc<Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(&keyId).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<bool>());
                return output.read();
            };
            let mut arn: Arc<AwsArn> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(arn.resource().resourceType().clone() == string_utf16_of("key"), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Only AWS KMS Keys supported")
                        }));
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<bool>());
                return output.read();
            };
            if edk.keyProviderId().clone() != crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID() {
                output = MaybePlacebo::from(Arc::new(Result::<bool, Arc<Error>>::Success {
                                value: false
                            }));
                return output.read();
            };
            if !_default::DiscoveryMatch(&arn, &self.discoveryFilter().clone()) {
                output = MaybePlacebo::from(Arc::new(Result::<bool, Arc<Error>>::Success {
                                value: false
                            }));
                return output.read();
            };
            output = MaybePlacebo::from(Arc::new(Result::<bool, Arc<Error>>::Success {
                            value: true
                        }));
            return output.read();
        }
    }

    impl UpcastObject<dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<Error>>>>>
        for AwsKmsEncryptedDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(399,3)
    pub struct AwsKmsEncryptedDataKeyTransformer {}

    impl AwsKmsEncryptedDataKeyTransformer {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(406,5)
        pub fn _ctor(this: &Object<AwsKmsEncryptedDataKeyTransformer>) -> () {
            return ();
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsEncryptedDataKeyTransformer {
        UpcastObjectFn!(DynAny);
    }

    impl DeterministicActionWithResult<Arc<EncryptedDataKey>, Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>
        for AwsKmsEncryptedDataKeyTransformer {}

    impl UpcastObject<dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>
        for AwsKmsEncryptedDataKeyTransformer {
        UpcastObjectFn!(dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>);
    }

    impl DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>>
        for AwsKmsEncryptedDataKeyTransformer {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(427,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(edk.keyProviderId().clone() == crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID(), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Encrypted data key was not generated by KMS")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<Arc<AwsKmsEdkHelper>>>());
                return res.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderInfo()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid AWS KMS encoding, provider info is not UTF8.")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<Arc<AwsKmsEdkHelper>>>());
                return res.read();
            };
            let mut valueOrError2: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(edk.keyProviderInfo()).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Sequence<Arc<AwsKmsEdkHelper>>>());
                return res.read();
            };
            let mut keyId: Sequence<DafnyCharUTF16> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Result<AwsKmsArn, Arc<Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(&keyId).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Sequence<Arc<AwsKmsEdkHelper>>>());
                return res.read();
            };
            let mut arn: AwsKmsArn = valueOrError3.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>::Success {
                            value: seq![Arc::new(AwsKmsEdkHelper::AwsKmsEdkHelper {
                                            edk: edk.clone(),
                                            arn: arn.clone()
                                        })]
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>>>
        for AwsKmsEncryptedDataKeyTransformer {
        UpcastObjectFn!(dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(454,3)
    pub struct AwsKmsEncryptedDataKeyDecryptor {
        pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey,
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_grantTokens: GrantTokenList
    }

    impl AwsKmsEncryptedDataKeyDecryptor {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(464,5)
        pub fn _ctor(this: &Object<AwsKmsEncryptedDataKeyDecryptor>, materials: &DecryptionMaterialsPendingPlaintextDataKey, client: &Object<dyn IKMSClient>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_materials: bool = false;
            let mut _set___i_client: bool = false;
            let mut _set___i_grantTokens: bool = false;
            update_field_uninit_object!(this.clone(), __i_materials, _set___i_materials, materials.clone());
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(460,5)
        pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey {
            self.__i_materials.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(461,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(462,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsEncryptedDataKeyDecryptor {
        UpcastObjectFn!(DynAny);
    }

    impl ActionWithResult<Arc<AwsKmsEdkHelper>, SealedDecryptionMaterials, Arc<Error>>
        for AwsKmsEncryptedDataKeyDecryptor {}

    impl UpcastObject<dyn ActionWithResult<Arc<AwsKmsEdkHelper>, SealedDecryptionMaterials, Arc<Error>>>
        for AwsKmsEncryptedDataKeyDecryptor {
        UpcastObjectFn!(dyn ActionWithResult<Arc<AwsKmsEdkHelper>, SealedDecryptionMaterials, Arc<Error>>);
    }

    impl Action<Arc<AwsKmsEdkHelper>, Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>
        for AwsKmsEncryptedDataKeyDecryptor {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsDiscoveryKeyring.dfy(539,5)
        fn Invoke(&self, helper: &Arc<AwsKmsEdkHelper>) -> Arc<Result<SealedDecryptionMaterials, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>::new();
            let mut awsKmsKey: Sequence<DafnyCharUTF16> = AwsArn::ToString(helper.arn());
            let mut valueOrError0: Arc<Result<(), Arc<Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(&AwsArn::ToString(helper.arn()));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut _v0: () = valueOrError0.Extract();
            let mut kmsUnwrap: Object<KmsUnwrapKeyMaterial>;
            let mut _nw0: Object<KmsUnwrapKeyMaterial> = KmsUnwrapKeyMaterial::_allocate_object();
            KmsUnwrapKeyMaterial::_ctor(&_nw0, &self.client().clone(), &awsKmsKey, &self.grantTokens().clone());
            kmsUnwrap = _nw0.clone();
            let mut unwrapOutputRes: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<Error>>>;
            let mut _out0: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::<Arc<KmsUnwrapInfo>>(helper.edk().ciphertext(), &self.materials().clone(), &upcast_object::<KmsUnwrapKeyMaterial, dyn UnwrapMaterial<Arc<KmsUnwrapInfo>>>()(kmsUnwrap.clone()));
            unwrapOutputRes = _out0.clone();
            let mut valueOrError1: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<Error>>> = unwrapOutputRes.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut unwrapOutput: Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<Arc<DecryptionMaterials>, Arc<Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey());
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut result: Arc<DecryptionMaterials> = valueOrError2.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Arc<DecryptionMaterials>, Arc<Error>>::Success {
                            value: result.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<AwsKmsEdkHelper>, Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>>
        for AwsKmsEncryptedDataKeyDecryptor {
        UpcastObjectFn!(dyn Action<Arc<AwsKmsEdkHelper>, Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(18,1)
pub mod _AwsKmsEcdhKeyring_Compile {
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DeriveSharedSecretRequest;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyAgreementAlgorithmSpec;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DeriveSharedSecretResponse;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PlaintextType;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsEcdhStaticConfigurations;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsEcdhStaticConfigurations::KmsPublicKeyDiscovery;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhGenerateAndWrapKeyMaterial;
    pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhWrapKeyMaterial;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhWrapInfo;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials;
    pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsPublicKeyDiscoveryInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::KmsPrivateKeyToStaticPublicKeyInput;
    pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhUnwrap;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhUnwrapInfo;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;
    pub use ::dafny_runtime::update_field_if_uninit_object;
    pub use ::std::default::Default;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicAction;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(404,3)
        pub fn DeriveSharedSecret(client: &Object<dyn IKMSClient>, senderAwsKmsKey: &Sequence<DafnyCharUTF16>, recipientPublicKey: &Sequence<u8>, grantTokens: &GrantTokenList) -> Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut deriveSharedSecretRequest: Arc<DeriveSharedSecretRequest> = Arc::new(DeriveSharedSecretRequest::DeriveSharedSecretRequest {
                        KeyId: senderAwsKmsKey.clone(),
                        KeyAgreementAlgorithm: Arc::new(KeyAgreementAlgorithmSpec::ECDH {}),
                        PublicKey: recipientPublicKey.clone(),
                        GrantTokens: Arc::new(Option::<GrantTokenList>::Some {
                                    value: grantTokens.clone()
                                }),
                        DryRun: Arc::new(Option::<bool>::None {}),
                        Recipient: Arc::new(Option::<Arc<RecipientInfo>>::None {})
                    });
            let mut maybeDeriveSharedSecret: Arc<Result<Arc<DeriveSharedSecretResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<DeriveSharedSecretResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = IKMSClient::DeriveSharedSecret(rd!(client.clone()), &deriveSharedSecretRequest);
            maybeDeriveSharedSecret = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<DeriveSharedSecretResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeDeriveSharedSecret.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::ComAmazonawsKms {
                                        ComAmazonawsKms: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut deriveSharedSecretResponse: Arc<DeriveSharedSecretResponse> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(deriveSharedSecretResponse.KeyId().as_ref(), Some{ .. }) && matches!(deriveSharedSecretResponse.SharedSecret().as_ref(), Some{ .. }) && matches!(deriveSharedSecretResponse.KeyAgreementAlgorithm().as_ref(), Some{ .. }) && deriveSharedSecretResponse.KeyId().value().clone() == senderAwsKmsKey.clone() && deriveSharedSecretResponse.KeyAgreementAlgorithm().value().clone() == Arc::new(KeyAgreementAlgorithmSpec::ECDH {}), &_default::E(&string_utf16_of("Invalid response from KMS DeriveSharedSecret")));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<PlaintextType, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: deriveSharedSecretResponse.SharedSecret().value().clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(748,3)
        pub fn E(s: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error> {
            Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                    message: s.clone()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(45,3)
        pub fn AWS_KMS_ECDH_KEYRING_VERSION() -> Sequence<u8> {
            crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::RAW_ECDH_KEYRING_VERSION()
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(50,3)
    pub struct AwsKmsEcdhKeyring {
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_keyAgreementScheme: Arc<KmsEcdhStaticConfigurations>,
        pub __i_curveSpec: Arc<ECDHCurveSpec>,
        pub __i_grantTokens: GrantTokenList,
        pub __i_recipientPublicKey: PublicKeyType,
        pub __i_senderPublicKey: Arc<Option<PublicKeyType>>,
        pub __i_compressedSenderPublicKey: Arc<Option<Sequence<u8>>>,
        pub __i_compressedRecipientPublicKey: Sequence<u8>,
        pub __i_senderKmsKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>
    }

    impl AwsKmsEcdhKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(76,5)
        pub fn _ctor(this: &Object<AwsKmsEcdhKeyring>, KeyAgreementScheme: &Arc<KmsEcdhStaticConfigurations>, curveSpec: &Arc<ECDHCurveSpec>, client: &Object<dyn IKMSClient>, grantTokens: &GrantTokenList, senderKmsKeyId: &Arc<Option<Sequence<DafnyCharUTF16>>>, senderPublicKey: &Arc<Option<PublicKeyType>>, recipientPublicKey: &PublicKeyType, compressedSenderPublicKey: &Arc<Option<Sequence<u8>>>, compressedRecipientPublicKey: &Sequence<u8>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_client: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_keyAgreementScheme: bool = false;
            let mut _set___i_curveSpec: bool = false;
            let mut _set___i_grantTokens: bool = false;
            let mut _set___i_recipientPublicKey: bool = false;
            let mut _set___i_senderPublicKey: bool = false;
            let mut _set___i_compressedSenderPublicKey: bool = false;
            let mut _set___i_compressedRecipientPublicKey: bool = false;
            let mut _set___i_senderKmsKeyId: bool = false;
            update_field_uninit_object!(this.clone(), __i_keyAgreementScheme, _set___i_keyAgreementScheme, KeyAgreementScheme.clone());
            update_field_uninit_object!(this.clone(), __i_curveSpec, _set___i_curveSpec, curveSpec.clone());
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            update_field_uninit_object!(this.clone(), __i_recipientPublicKey, _set___i_recipientPublicKey, recipientPublicKey.clone());
            update_field_uninit_object!(this.clone(), __i_senderPublicKey, _set___i_senderPublicKey, senderPublicKey.clone());
            update_field_uninit_object!(this.clone(), __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, compressedSenderPublicKey.clone());
            update_field_uninit_object!(this.clone(), __i_compressedRecipientPublicKey, _set___i_compressedRecipientPublicKey, compressedRecipientPublicKey.clone());
            update_field_uninit_object!(this.clone(), __i_senderKmsKeyId, _set___i_senderKmsKeyId, senderKmsKeyId.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(53,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(62,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(59,5)
        pub fn keyAgreementScheme(&self) -> Arc<KmsEcdhStaticConfigurations> {
            self.__i_keyAgreementScheme.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(60,5)
        pub fn curveSpec(&self) -> Arc<ECDHCurveSpec> {
            self.__i_curveSpec.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(61,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(56,5)
        pub fn recipientPublicKey(&self) -> PublicKeyType {
            self.__i_recipientPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(55,5)
        pub fn senderPublicKey(&self) -> Arc<Option<PublicKeyType>> {
            self.__i_senderPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(57,5)
        pub fn compressedSenderPublicKey(&self) -> Arc<Option<Sequence<u8>>> {
            self.__i_compressedSenderPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(58,5)
        pub fn compressedRecipientPublicKey(&self) -> Sequence<u8> {
            self.__i_compressedRecipientPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(54,5)
        pub fn senderKmsKeyId(&self) -> Arc<Option<Sequence<DafnyCharUTF16>>> {
            self.__i_senderKmsKeyId.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsEcdhKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for AwsKmsEcdhKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for AwsKmsEcdhKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for AwsKmsEcdhKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(155,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(!matches!((&self.keyAgreementScheme().clone()).as_ref(), KmsPublicKeyDiscovery{ .. }), &_default::E(&string_utf16_of("KmsPublicKeyDiscovery Key Agreement Scheme is forbidden on encrypt.")));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!((&self.senderKmsKeyId().clone()).as_ref(), Some{ .. }), &_default::E(&string_utf16_of("Keyring MUST be configured with a sender KMS Key ID")));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!((&self.senderPublicKey().clone()).as_ref(), Some{ .. }), &_default::E(&string_utf16_of("Keyring MUST be configured with a senderPublicKey")));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut senderKmsKeyId: Sequence<DafnyCharUTF16> = self.senderKmsKeyId().clone().value().clone();
            let mut materials: Arc<EncryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError3: Arc<Result<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::StringifyEncryptionContext(input.materials().encryptionContext());
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut stringifiedEncCtx: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DeriveSharedSecret(&self.client().clone(), &senderKmsKeyId, &self.recipientPublicKey().clone(), &self.grantTokens().clone());
            valueOrError4 = _out0.clone();
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut sharedSecret: Sequence<u8> = valueOrError4.Extract();
            let mut operationCompressedSenderPublicKey: Sequence<u8>;
            if matches!((&self.compressedSenderPublicKey().clone()).as_ref(), None{ .. }) {
                operationCompressedSenderPublicKey = seq![] as Sequence<u8>;
            } else {
                operationCompressedSenderPublicKey = self.compressedSenderPublicKey().clone().value().clone();
            };
            let mut valueOrError5: Arc<Result<ValidUTF8Bytes, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::CurveSpecTypeToString(&self.curveSpec().clone())).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError5.IsFailure() {
                res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut curveSpecUtf8: ValidUTF8Bytes = valueOrError5.Extract();
            let mut valueOrError6: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.materials().encryptionContext());
            if valueOrError6.IsFailure() {
                res = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut canonicalizedEC: Sequence<u8> = valueOrError6.Extract();
            let mut fixedInfo: Sequence<u8> = crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::_default::SerializeFixedInfo(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_UTF8(), &curveSpecUtf8, &operationCompressedSenderPublicKey, &self.compressedRecipientPublicKey().clone(), &canonicalizedEC, &_default::AWS_KMS_ECDH_KEYRING_VERSION());
            let mut ecdhGenerateAndWrap: Object<EcdhGenerateAndWrapKeyMaterial>;
            let mut _nw0: Object<EcdhGenerateAndWrapKeyMaterial> = EcdhGenerateAndWrapKeyMaterial::_allocate_object();
            EcdhGenerateAndWrapKeyMaterial::_ctor(&_nw0, &sharedSecret, &fixedInfo, &self.cryptoPrimitives().clone());
            ecdhGenerateAndWrap = _nw0.clone();
            let mut ecdhWrap: Object<EcdhWrapKeyMaterial>;
            let mut _nw1: Object<EcdhWrapKeyMaterial> = EcdhWrapKeyMaterial::_allocate_object();
            EcdhWrapKeyMaterial::_ctor(&_nw1, &sharedSecret, &fixedInfo, &self.cryptoPrimitives().clone());
            ecdhWrap = _nw1.clone();
            let mut valueOrError7: Arc<Result<Arc<WrapEdkMaterialOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Arc<WrapEdkMaterialOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::WrapEdkMaterial::<Arc<EcdhWrapInfo>>(&materials, &upcast_object::<EcdhWrapKeyMaterial, dyn WrapMaterial<Arc<EcdhWrapInfo>>>()(ecdhWrap.clone()), &upcast_object::<EcdhGenerateAndWrapKeyMaterial, dyn GenerateAndWrapMaterial<Arc<EcdhWrapInfo>>>()(ecdhGenerateAndWrap.clone()));
            valueOrError7 = _out1.clone();
            if valueOrError7.IsFailure() {
                res = MaybePlacebo::from(valueOrError7.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut wrapOutput: Arc<WrapEdkMaterialOutput<Arc<EcdhWrapInfo>>> = valueOrError7.Extract();
            let mut symmetricSigningKeyList: Arc<Option<Sequence<Sequence<u8>>>>;
            if matches!(wrapOutput.symmetricSigningKey().as_ref(), Some{ .. }) {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                            value: seq![wrapOutput.symmetricSigningKey().value().clone()]
                        });
            } else {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::None {});
            };
            let mut valueOrError8: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidCompressedPublicKeyLength(&operationCompressedSenderPublicKey) && crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidCompressedPublicKeyLength(&self.compressedRecipientPublicKey().clone()), &_default::E(&string_utf16_of("Invalid compressed public key length.")));
            if valueOrError8.IsFailure() {
                res = MaybePlacebo::from(valueOrError8.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut edk: Arc<EncryptedDataKey> = Arc::new(EncryptedDataKey::EncryptedDataKey {
                        keyProviderId: crate::implementation_from_dafny::_Constants_Compile::_default::KMS_ECDH_PROVIDER_ID(),
                        keyProviderInfo: crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::SerializeProviderInfo(&operationCompressedSenderPublicKey, &self.compressedRecipientPublicKey().clone()),
                        ciphertext: wrapOutput.wrappedMaterial().clone()
                    });
            if matches!((&wrapOutput).as_ref(), GenerateAndWrapEdkMaterialOutput{ .. }) {
                let mut valueOrError9: Arc<Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddDataKey(&materials, wrapOutput.plaintextDataKey(), &seq![edk.clone()], &symmetricSigningKeyList);
                if valueOrError9.IsFailure() {
                    res = MaybePlacebo::from(valueOrError9.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return res.read();
                };
                let mut result: Arc<EncryptionMaterials> = valueOrError9.Extract();
                res = MaybePlacebo::from(Arc::new(Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                            materials: result.clone()
                                        })
                            }));
                return res.read();
            } else {
                if matches!((&wrapOutput).as_ref(), WrapOnlyEdkMaterialOutput{ .. }) {
                    let mut valueOrError10: Arc<Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddEncryptedDataKeys(&materials, &seq![edk.clone()], &symmetricSigningKeyList);
                    if valueOrError10.IsFailure() {
                        res = MaybePlacebo::from(valueOrError10.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return res.read();
                    };
                    let mut result: Arc<EncryptionMaterials> = valueOrError10.Extract();
                    res = MaybePlacebo::from(Arc::new(Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                    value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                                materials: result.clone()
                                            })
                                }));
                    return res.read();
                }
            };
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(320,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(&materials), &_default::E(&string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut filter: Object<OnDecryptEcdhDataKeyFilter>;
            let mut _nw0: Object<OnDecryptEcdhDataKeyFilter> = OnDecryptEcdhDataKeyFilter::_allocate_object();
            OnDecryptEcdhDataKeyFilter::_ctor(&_nw0, &self.keyAgreementScheme().clone(), &self.compressedRecipientPublicKey().clone(), &self.compressedSenderPublicKey().clone());
            filter = _nw0.clone();
            let mut valueOrError1: Arc<Result<Sequence<Arc<EncryptedDataKey>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Sequence<Arc<EncryptedDataKey>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Actions_Compile::_default::FilterWithResult::<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&upcast_object::<OnDecryptEcdhDataKeyFilter, dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>()(filter.clone()), input.encryptedDataKeys());
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut edksToAttempt: Sequence<Arc<EncryptedDataKey>> = valueOrError1.Extract();
            if 0 == truncate!(edksToAttempt.cardinality(), u64) {
                let mut valueOrError2: Arc<Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of(""));
                if valueOrError2.IsFailure() {
                    res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnDecryptOutput>>());
                    return res.read();
                };
                let mut errorMessage: Sequence<DafnyCharUTF16> = valueOrError2.Extract();
                res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: _default::E(&errorMessage)
                            }));
                return res.read();
            };
            let mut decryptClosure: Object<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _nw1: Object<DecryptSingleEncryptedDataKey> = DecryptSingleEncryptedDataKey::_allocate_object();
            DecryptSingleEncryptedDataKey::_ctor(&_nw1, &materials, &self.cryptoPrimitives().clone(), &self.compressedRecipientPublicKey().clone(), &self.client().clone(), &self.grantTokens().clone(), &self.keyAgreementScheme().clone(), &self.curveSpec().clone());
            decryptClosure = upcast_object::<DecryptSingleEncryptedDataKey, dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>()(_nw1.clone());
            let mut outcome: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>;
            let mut _out1: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>> = crate::implementation_from_dafny::_Actions_Compile::_default::ReduceToSuccess::<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&decryptClosure, &edksToAttempt);
            outcome = _out1.clone();
            let mut valueOrError3: Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = outcome.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |errors: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::CollectionOfErrors {
                                        list: errors.clone(),
                                        message: string_utf16_of("No Configured KMS Key was able to decrypt the Data Key. The list of encountered Exceptions is available via `list`.")
                                    })
                            })
                    }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut SealedDecryptionMaterials: SealedDecryptionMaterials = valueOrError3.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(OnDecryptOutput::OnDecryptOutput {
                                        materials: SealedDecryptionMaterials.clone()
                                    })
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for AwsKmsEcdhKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(469,3)
    pub struct DecryptSingleEncryptedDataKey {
        pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_recipientPublicKey: Sequence<u8>,
        pub __i_keyAgreementScheme: Arc<KmsEcdhStaticConfigurations>,
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_curveSpec: Arc<ECDHCurveSpec>,
        pub __i_grantTokens: GrantTokenList
    }

    impl DecryptSingleEncryptedDataKey {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(483,5)
        pub fn _ctor(this: &Object<DecryptSingleEncryptedDataKey>, materials: &DecryptionMaterialsPendingPlaintextDataKey, cryptoPrimitives: &Object<AtomicPrimitivesClient>, recipientPublicKey: &Sequence<u8>, client: &Object<dyn IKMSClient>, grantTokens: &GrantTokenList, keyAgreementScheme: &Arc<KmsEcdhStaticConfigurations>, curveSpec: &Arc<ECDHCurveSpec>) -> () {
            let mut _set___i_materials: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_recipientPublicKey: bool = false;
            let mut _set___i_keyAgreementScheme: bool = false;
            let mut _set___i_client: bool = false;
            let mut _set___i_curveSpec: bool = false;
            let mut _set___i_grantTokens: bool = false;
            update_field_uninit_object!(this.clone(), __i_materials, _set___i_materials, materials.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            update_field_uninit_object!(this.clone(), __i_recipientPublicKey, _set___i_recipientPublicKey, recipientPublicKey.clone());
            update_field_uninit_object!(this.clone(), __i_keyAgreementScheme, _set___i_keyAgreementScheme, keyAgreementScheme.clone());
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_curveSpec, _set___i_curveSpec, curveSpec.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(475,5)
        pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey {
            self.__i_materials.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(476,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(477,5)
        pub fn recipientPublicKey(&self) -> Sequence<u8> {
            self.__i_recipientPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(480,5)
        pub fn keyAgreementScheme(&self) -> Arc<KmsEcdhStaticConfigurations> {
            self.__i_keyAgreementScheme.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(478,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(481,5)
        pub fn curveSpec(&self) -> Arc<ECDHCurveSpec> {
            self.__i_curveSpec.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(479,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(DynAny);
    }

    impl ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for DecryptSingleEncryptedDataKey {}

    impl UpcastObject<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<EncryptedDataKey>, Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for DecryptSingleEncryptedDataKey {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(540,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = self.materials().clone().algorithmSuite().clone();
            let mut keyProviderId: ValidUTF8Bytes = edk.keyProviderId().clone();
            let mut providerInfo: Sequence<u8> = edk.keyProviderInfo().clone();
            let mut ciphertext: Sequence<u8> = edk.ciphertext().clone();
            let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::GetProviderWrappedMaterial(&ciphertext, &suite);
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut providerWrappedMaterial: Sequence<u8> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(providerInfo.cardinality(), u64) <= crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN() as u64 && crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected")));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut keyringVersion: u8 = providerInfo.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()));
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(seq![keyringVersion] == _default::AWS_KMS_ECDH_KEYRING_VERSION(), &_default::E(&string_utf16_of("Incorrect Keyring version found in provider info.")));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut recipientPublicKeyLength: u32 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone())));
            let mut recipientPublicKeyLengthIndex: u64 = crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX() as u64 + recipientPublicKeyLength as u64;
            let mut senderPublicKeyIndex: u64 = recipientPublicKeyLengthIndex + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN();
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(recipientPublicKeyLengthIndex + 4 < truncate!(providerInfo.cardinality(), u64), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected.")));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut providerInfoRecipientPublicKey: Sequence<u8> = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &int!((&recipientPublicKeyLengthIndex).clone()));
            let mut providerInfoSenderPublicKey: Sequence<u8> = providerInfo.drop(&int!((&senderPublicKeyIndex).clone()));
            let mut valueOrError4: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::DecompressPublicKey(&providerInfoSenderPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone());
            valueOrError4 = _out0.clone();
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut senderPublicKey: Sequence<u8> = valueOrError4.Extract();
            let mut valueOrError5: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::DecompressPublicKey(&providerInfoRecipientPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone());
            valueOrError5 = _out1.clone();
            if valueOrError5.IsFailure() {
                res = MaybePlacebo::from(valueOrError5.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut recipientPublicKey: Sequence<u8> = valueOrError5.Extract();
            let mut valueOrError6: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &senderPublicKey);
            valueOrError6 = _out2.clone();
            if valueOrError6.IsFailure() {
                res = MaybePlacebo::from(valueOrError6.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut _v0: bool = valueOrError6.Extract();
            let mut valueOrError7: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &recipientPublicKey);
            valueOrError7 = _out3.clone();
            if valueOrError7.IsFailure() {
                res = MaybePlacebo::from(valueOrError7.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut _v1: bool = valueOrError7.Extract();
            let mut valueOrError8: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(&senderPublicKey) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(&self.recipientPublicKey().clone()), &_default::E(&string_utf16_of("Received serialized sender public key of incorrect length")));
            if valueOrError8.IsFailure() {
                res = MaybePlacebo::from(valueOrError8.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut sharedSecretPublicKey: Sequence<u8>;
            let mut sharedSecretKmsKeyId: Sequence<DafnyCharUTF16>;
            let mut _source0: Arc<KmsEcdhStaticConfigurations> = self.keyAgreementScheme().clone();
            if matches!((&_source0).as_ref(), KmsPublicKeyDiscovery{ .. }) {
                let mut ___mcc_h0: Arc<KmsPublicKeyDiscoveryInput> = _source0.KmsPublicKeyDiscovery().clone();
                let mut kmsPublicKeyDiscovery: Arc<KmsPublicKeyDiscoveryInput> = ___mcc_h0.clone();
                let mut valueOrError9: Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(kmsPublicKeyDiscovery.recipientKmsIdentifier());
                if valueOrError9.IsFailure() {
                    res = MaybePlacebo::from(valueOrError9.PropagateFailure::<SealedDecryptionMaterials>());
                    return res.read();
                };
                let mut _v2: () = valueOrError9.Extract();
                sharedSecretPublicKey = senderPublicKey.clone();
                sharedSecretKmsKeyId = kmsPublicKeyDiscovery.recipientKmsIdentifier().clone();
            } else {
                let mut ___mcc_h1: Arc<KmsPrivateKeyToStaticPublicKeyInput> = _source0.KmsPrivateKeyToStaticPublicKey().clone();
                let mut kmsPrivateKeyToStaticPublicKey: Arc<KmsPrivateKeyToStaticPublicKeyInput> = ___mcc_h1.clone();
                let mut valueOrError10: Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(kmsPrivateKeyToStaticPublicKey.senderKmsIdentifier());
                if valueOrError10.IsFailure() {
                    res = MaybePlacebo::from(valueOrError10.PropagateFailure::<SealedDecryptionMaterials>());
                    return res.read();
                };
                let mut _v3: () = valueOrError10.Extract();
                sharedSecretKmsKeyId = kmsPrivateKeyToStaticPublicKey.senderKmsIdentifier().clone();
                if kmsPrivateKeyToStaticPublicKey.recipientPublicKey().clone() == recipientPublicKey.clone() {
                    sharedSecretPublicKey = recipientPublicKey.clone();
                } else {
                    sharedSecretPublicKey = senderPublicKey.clone();
                }
            };
            let mut valueOrError11: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PublicKeyType(&sharedSecretPublicKey), &_default::E(&string_utf16_of("Received Recipient Public Key of incorrect expected length")));
            if valueOrError11.IsFailure() {
                res = MaybePlacebo::from(valueOrError11.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut valueOrError12: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DeriveSharedSecret(&self.client().clone(), &sharedSecretKmsKeyId, &sharedSecretPublicKey, &self.grantTokens().clone());
            valueOrError12 = _out4.clone();
            if valueOrError12.IsFailure() {
                res = MaybePlacebo::from(valueOrError12.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut sharedSecret: Sequence<u8> = valueOrError12.Extract();
            let mut ecdhUnwrap: Object<EcdhUnwrap>;
            let mut _nw0: Object<EcdhUnwrap> = EcdhUnwrap::_allocate_object();
            EcdhUnwrap::_ctor(&_nw0, &providerInfoSenderPublicKey, &providerInfoRecipientPublicKey, &sharedSecret, &_default::AWS_KMS_ECDH_KEYRING_VERSION(), &self.curveSpec().clone(), &self.cryptoPrimitives().clone());
            ecdhUnwrap = _nw0.clone();
            let mut unwrapOutputRes: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out5: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::<Arc<EcdhUnwrapInfo>>(edk.ciphertext(), &self.materials().clone(), &upcast_object::<EcdhUnwrap, dyn UnwrapMaterial<Arc<EcdhUnwrapInfo>>>()(ecdhUnwrap.clone()));
            unwrapOutputRes = _out5.clone();
            let mut valueOrError13: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = unwrapOutputRes.clone();
            if valueOrError13.IsFailure() {
                res = MaybePlacebo::from(valueOrError13.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut unwrapOutput: Arc<UnwrapEdkMaterialOutput<Arc<EcdhUnwrapInfo>>> = valueOrError13.Extract();
            let mut valueOrError14: Arc<Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey());
            if valueOrError14.IsFailure() {
                res = MaybePlacebo::from(valueOrError14.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut result: Arc<DecryptionMaterials> = valueOrError14.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: result.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<EncryptedDataKey>, Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(dyn Action<Arc<EncryptedDataKey>, Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(660,3)
    pub struct OnDecryptEcdhDataKeyFilter {
        pub __i_keyAgreementScheme: Arc<KmsEcdhStaticConfigurations>,
        pub __i_compressedRecipientPublicKey: Sequence<u8>,
        pub __i_compressedSenderPublicKey: Sequence<u8>
    }

    impl OnDecryptEcdhDataKeyFilter {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(667,5)
        pub fn _ctor(this: &Object<OnDecryptEcdhDataKeyFilter>, keyAgreementScheme: &Arc<KmsEcdhStaticConfigurations>, compressedRecipientPublicKey: &Sequence<u8>, compressedSenderPublicKey: &Arc<Option<Sequence<u8>>>) -> () {
            let mut _set___i_keyAgreementScheme: bool = false;
            let mut _set___i_compressedRecipientPublicKey: bool = false;
            let mut _set___i_compressedSenderPublicKey: bool = false;
            update_field_uninit_object!(this.clone(), __i_keyAgreementScheme, _set___i_keyAgreementScheme, keyAgreementScheme.clone());
            update_field_uninit_object!(this.clone(), __i_compressedRecipientPublicKey, _set___i_compressedRecipientPublicKey, compressedRecipientPublicKey.clone());
            if matches!(compressedSenderPublicKey.as_ref(), Some{ .. }) {
                update_field_uninit_object!(this.clone(), __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, compressedSenderPublicKey.value().clone())
            } else {
                update_field_uninit_object!(this.clone(), __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, seq![] as Sequence<u8>)
            };
            update_field_if_uninit_object!(this, __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, <Sequence<u8> as Default>::default());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(663,5)
        pub fn keyAgreementScheme(&self) -> Arc<KmsEcdhStaticConfigurations> {
            self.__i_keyAgreementScheme.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(664,5)
        pub fn compressedRecipientPublicKey(&self) -> Sequence<u8> {
            self.__i_compressedRecipientPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(665,5)
        pub fn compressedSenderPublicKey(&self) -> Sequence<u8> {
            self.__i_compressedSenderPublicKey.clone()
        }
    }

    impl UpcastObject<DynAny>
        for OnDecryptEcdhDataKeyFilter {
        UpcastObjectFn!(DynAny);
    }

    impl DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for OnDecryptEcdhDataKeyFilter {}

    impl UpcastObject<dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for OnDecryptEcdhDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for OnDecryptEcdhDataKeyFilter {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsEcdhKeyring.dfy(696,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut providerInfo: Sequence<u8> = edk.keyProviderInfo().clone();
            let mut providerId: ValidUTF8Bytes = edk.keyProviderId().clone();
            if providerId.clone() != crate::implementation_from_dafny::_Constants_Compile::_default::RAW_ECDH_PROVIDER_ID() && providerId.clone() != crate::implementation_from_dafny::_Constants_Compile::_default::KMS_ECDH_PROVIDER_ID() {
                res = MaybePlacebo::from(Arc::new(Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: false
                            }));
                return res.read();
            };
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(providerInfo.cardinality(), u64) <= crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN() as u64 && crate::implementation_from_dafny::_RawECDHKeyring_Compile::_default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected")));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<bool>());
                return res.read();
            };
            let mut keyringVersion: u8 = providerInfo.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()));
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(seq![keyringVersion] == _default::AWS_KMS_ECDH_KEYRING_VERSION(), &_default::E(&string_utf16_of("Incorrect Keyring version found in provider info.")));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<bool>());
                return res.read();
            };
            let mut recipientPublicKeyLength: u32 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone())));
            let mut recipientPublicKeyLengthIndex: u64 = crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX() as u64 + recipientPublicKeyLength as u64;
            let mut senderPublicKeyIndex: u64 = recipientPublicKeyLengthIndex + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN();
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(recipientPublicKeyLengthIndex + 4 < truncate!(providerInfo.cardinality(), u64), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected.")));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<bool>());
                return res.read();
            };
            let mut providerInfoRecipientPublicKey: Sequence<u8> = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &int!((&recipientPublicKeyLengthIndex).clone()));
            let mut providerInfoSenderPublicKey: Sequence<u8> = providerInfo.drop(&int!((&senderPublicKeyIndex).clone()));
            if matches!((&self.keyAgreementScheme().clone()).as_ref(), KmsPublicKeyDiscovery{ .. }) {
                res = MaybePlacebo::from(Arc::new(Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: self.compressedRecipientPublicKey().clone() == providerInfoRecipientPublicKey.clone()
                            }));
                return res.read();
            } else {
                res = MaybePlacebo::from(Arc::new(Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: self.compressedSenderPublicKey().clone() == providerInfoSenderPublicKey.clone() && self.compressedRecipientPublicKey().clone() == providerInfoRecipientPublicKey.clone() || self.compressedSenderPublicKey().clone() == providerInfoRecipientPublicKey.clone() && self.compressedRecipientPublicKey().clone() == providerInfoSenderPublicKey.clone()
                            }));
                return res.read();
            };
            return res.read();
        }
    }

    impl UpcastObject<dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for OnDecryptEcdhDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(21,1)
pub mod _AwsKmsHierarchicalKeyring_Compile {
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong;
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::KdfCtrInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::Map;
    pub use ::dafny_runtime::map;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::IKeyStoreClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IBranchKeyIdSupplier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetBranchKeyIdOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetBranchKeyIdInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BranchKeyMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryOutput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::EntryDoesNotExist;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyInput;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PutCacheEntryInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Materials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::EntryAlreadyExists;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Materials::BranchKey;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicAction;
    pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBranchKeyVersionOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBranchKeyVersionInput;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use ::dafny_runtime::cast_object;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(97,3)
        pub fn cacheEntryWithinLimits(creationTime: PositiveLong, now: PositiveLong, ttlSeconds: PositiveLong) -> bool {
            now - creationTime <= ttlSeconds
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(549,3)
        pub fn DeriveEncryptionKeyFromBranchKey(branchKey: &Sequence<u8>, salt: &Sequence<u8>, purpose: &Arc<Option<Sequence<u8>>>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybeDerivedBranchKey: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::KdfCounterMode(rd!(cryptoPrimitives.clone()), &Arc::new(KdfCtrInput::KdfCtrInput {
                            digestAlgorithm: Arc::new(DigestAlgorithm::SHA_256 {}),
                            ikm: branchKey.clone(),
                            expectedLength: _default::DERIVED_BRANCH_KEY_EXPECTED_LENGTH(),
                            purpose: purpose.clone(),
                            nonce: Arc::new(Option::<Sequence<u8>>::Some {
                                        value: salt.clone()
                                    })
                        }));
            maybeDerivedBranchKey = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeDerivedBranchKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut derivedBranchKey: Sequence<u8> = valueOrError0.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: derivedBranchKey.clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(586,3)
        pub fn WrappingAad(branchKeyId: &Sequence<u8>, branchKeyVersion: &Sequence<u8>, aad: &Sequence<u8>) -> Sequence<u8> {
            crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID_HIERARCHY().concat(branchKeyId).concat(branchKeyVersion).concat(aad)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1309,3)
        pub fn SerializeEDKCiphertext(encOutput: &Arc<AESEncryptOutput>) -> Sequence<u8> {
            encOutput.cipherText().concat(encOutput.authTag())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1313,3)
        pub fn E(s: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error> {
            Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                    message: s.clone()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(76,3)
        pub fn AES_256_ENC_KEY_LENGTH() -> i32 {
            32
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(77,3)
        pub fn AES_256_ENC_TAG_LENGTH() -> i32 {
            16
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(78,3)
        pub fn AES_256_ENC_IV_LENGTH() -> i32 {
            12
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(79,3)
        pub fn AES_256_ENC_ALG() -> Arc<AES_GCM> {
            Arc::new(AES_GCM::AES_GCM {
                    keyLength: _default::AES_256_ENC_KEY_LENGTH(),
                    tagLength: _default::AES_256_ENC_TAG_LENGTH(),
                    ivLength: _default::AES_256_ENC_IV_LENGTH()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(73,3)
        pub fn H_WRAP_SALT_LEN() -> PositiveInteger {
            16
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(74,3)
        pub fn H_WRAP_NONCE_LEN() -> PositiveInteger {
            12
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(89,3)
        pub fn EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX() -> i32 {
            _default::H_WRAP_SALT_LEN() + _default::H_WRAP_NONCE_LEN()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(88,3)
        pub fn EDK_CIPHERTEXT_VERSION_LENGTH() -> i32 {
            16
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(90,3)
        pub fn EDK_CIPHERTEXT_VERSION_INDEX() -> i32 {
            _default::EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX() + _default::EDK_CIPHERTEXT_VERSION_LENGTH()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(92,3)
        pub fn EXPECTED_EDK_CIPHERTEXT_OVERHEAD() -> i32 {
            _default::EDK_CIPHERTEXT_VERSION_INDEX() + _default::AES_256_ENC_TAG_LENGTH()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(75,3)
        pub fn DERIVED_BRANCH_KEY_EXPECTED_LENGTH() -> PositiveInteger {
            32
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(59,3)
        pub fn BRANCH_KEY_STORE_GSI() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("Active-Keys")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(60,3)
        pub fn BRANCH_KEY_FIELD() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("enc")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(61,3)
        pub fn VERSION_FIELD() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("version")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(62,3)
        pub fn BRANCH_KEY_IDENTIFIER_FIELD() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("branch-key-id")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(64,3)
        pub fn KEY_CONDITION_EXPRESSION() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("#status = :status and #branch_key_id = :branch_key_id")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(65,3)
        pub fn EXPRESSION_ATTRIBUTE_NAMES() -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> {
            map![(string_utf16_of("#status")) => (string_utf16_of("status")), (string_utf16_of("#branch_key_id")) => (string_utf16_of("branch-key-id"))]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(69,3)
        pub fn EXPRESSION_ATTRIBUTE_VALUE_STATUS_KEY() -> Sequence<DafnyCharUTF16> {
            string_utf16_of(":status")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(70,3)
        pub fn EXPRESSION_ATTRIBUTE_VALUE_STATUS_VALUE() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("ACTIVE")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(71,3)
        pub fn EXPRESSION_ATTRIBUTE_VALUE_BRANCH_KEY() -> Sequence<DafnyCharUTF16> {
            string_utf16_of(":branch_key_id")
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(109,3)
    pub struct AwsKmsHierarchicalKeyring {
        pub __i_keyStore: Object<dyn IKeyStoreClient>,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_cache: Object<dyn ICryptographicMaterialsCache>,
        pub __i_branchKeyIdSupplier: Arc<Option<Object<dyn IBranchKeyIdSupplier>>>,
        pub __i_branchKeyId: Arc<Option<Sequence<DafnyCharUTF16>>>,
        pub __i_ttlSeconds: PositiveLong,
        pub __i_partitionIdBytes: Sequence<u8>,
        pub __i_logicalKeyStoreNameBytes: Sequence<u8>
    }

    impl AwsKmsHierarchicalKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(141,5)
        pub fn _ctor(this: &Object<AwsKmsHierarchicalKeyring>, keyStore: &Object<dyn IKeyStoreClient>, branchKeyId: &Arc<Option<Sequence<DafnyCharUTF16>>>, branchKeyIdSupplier: &Arc<Option<Object<dyn IBranchKeyIdSupplier>>>, ttlSeconds: PositiveLong, cmc: &Object<dyn ICryptographicMaterialsCache>, partitionIdBytes: &Sequence<u8>, logicalKeyStoreNameBytes: &Sequence<u8>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_keyStore: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_cache: bool = false;
            let mut _set___i_branchKeyIdSupplier: bool = false;
            let mut _set___i_branchKeyId: bool = false;
            let mut _set___i_ttlSeconds: bool = false;
            let mut _set___i_partitionIdBytes: bool = false;
            let mut _set___i_logicalKeyStoreNameBytes: bool = false;
            update_field_uninit_object!(this.clone(), __i_keyStore, _set___i_keyStore, keyStore.clone());
            update_field_uninit_object!(this.clone(), __i_branchKeyId, _set___i_branchKeyId, branchKeyId.clone());
            update_field_uninit_object!(this.clone(), __i_branchKeyIdSupplier, _set___i_branchKeyIdSupplier, branchKeyIdSupplier.clone());
            update_field_uninit_object!(this.clone(), __i_ttlSeconds, _set___i_ttlSeconds, ttlSeconds);
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            update_field_uninit_object!(this.clone(), __i_cache, _set___i_cache, cmc.clone());
            update_field_uninit_object!(this.clone(), __i_partitionIdBytes, _set___i_partitionIdBytes, partitionIdBytes.clone());
            update_field_uninit_object!(this.clone(), __i_logicalKeyStoreNameBytes, _set___i_logicalKeyStoreNameBytes, logicalKeyStoreNameBytes.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(194,5)
        pub fn GetBranchKeyId(&self, context: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut ret = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            if matches!((&self.branchKeyId().clone()).as_ref(), Some{ .. }) {
                ret = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: self.branchKeyId().clone().value().clone()
                            }));
                return ret.read();
            } else {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBranchKeyIdOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBranchKeyIdOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IBranchKeyIdSupplier::GetBranchKeyId(rd!(self.branchKeyIdSupplier().clone().value().clone()), &Arc::new(GetBranchKeyIdInput::GetBranchKeyIdInput {
                                encryptionContext: context.clone()
                            }));
                valueOrError0 = _out0.clone();
                if valueOrError0.IsFailure() {
                    ret = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<DafnyCharUTF16>>());
                    return ret.read();
                };
                let mut GetBranchKeyIdOut: Arc<GetBranchKeyIdOutput> = valueOrError0.Extract();
                ret = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: GetBranchKeyIdOut.branchKeyId().clone()
                            }));
                return ret.read();
            };
            return ret.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(412,5)
        pub fn GetActiveCacheId(&self, branchKeyId: &Sequence<DafnyCharUTF16>, branchKeyIdUtf8: &Sequence<u8>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut cacheId = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(true && ({
                            let __pat_let1_0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Decode(branchKeyIdUtf8);
                            {
                                let branchKeyId: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = __pat_let1_0.clone();
                                matches!((&branchKeyId).as_ref(), Success{ .. }) && (0 <= truncate!(branchKeyId.value().cardinality(), u64) && truncate!(branchKeyId.value().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT32_LIMIT(), u64))
                            }
                        }), &_default::E(&string_utf16_of("Invalid Branch Key ID Length")));
            if valueOrError0.IsFailure() {
                cacheId = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return cacheId.read();
            };
            let mut hashAlgorithm: Arc<DigestAlgorithm> = Arc::new(DigestAlgorithm::SHA_384 {});
            let mut resourceId: Sequence<u8> = crate::implementation_from_dafny::_CacheConstants_Compile::_default::RESOURCE_ID_HIERARCHICAL_KEYRING();
            let mut scopeId: Sequence<u8> = crate::implementation_from_dafny::_CacheConstants_Compile::_default::SCOPE_ID_ENCRYPT();
            let mut suffix: Sequence<u8> = self.logicalKeyStoreNameBytes().clone().concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(branchKeyIdUtf8);
            let mut identifier: Sequence<u8> = resourceId.concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&scopeId).concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&self.partitionIdBytes().clone()).concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&suffix);
            let mut maybeCacheIdDigest: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::Digest(rd!(cryptoPrimitives.clone()), &Arc::new(DigestInput::DigestInput {
                            digestAlgorithm: hashAlgorithm.clone(),
                            message: identifier.clone()
                        }));
            maybeCacheIdDigest = _out0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeCacheIdDigest.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                cacheId = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return cacheId.read();
            };
            let mut cacheDigest: Sequence<u8> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(cacheDigest.cardinality(), u64) == crate::implementation_from_dafny::_Digest_Compile::_default::Length(&hashAlgorithm), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Digest generated a message not equal to the expected length.")
                        }));
            if valueOrError2.IsFailure() {
                cacheId = MaybePlacebo::from(valueOrError2.PropagateFailure::<Sequence<u8>>());
                return cacheId.read();
            };
            cacheId = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: cacheDigest.clone()
                        }));
            return cacheId.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(474,5)
        pub fn GetActiveHierarchicalMaterials(&self, branchKeyId: &Sequence<DafnyCharUTF16>, cacheId: &Sequence<u8>, keyStore: &Object<dyn IKeyStoreClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut material = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut getCacheInput: Arc<GetCacheEntryInput> = Arc::new(GetCacheEntryInput::GetCacheEntryInput {
                        identifier: cacheId.clone(),
                        bytesUsed: Arc::new(Option::<i64>::None {})
                    });
            let mut getCacheOutput: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = ICryptographicMaterialsCache::GetCacheEntry(rd!(self.cache().clone()), &getCacheInput);
            getCacheOutput = _out0.clone();
            if matches!((&getCacheOutput).as_ref(), Failure{ .. }) && !matches!(getCacheOutput.error().as_ref(), EntryDoesNotExist{ .. }) {
                material = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: getCacheOutput.error().clone()
                            }));
                return material.read();
            };
            let mut now: i64;
            let mut _out1: i64 = crate::implementation_from_dafny::Time::_default::CurrentRelativeTime();
            now = _out1;
            if matches!((&getCacheOutput).as_ref(), Failure{ .. }) || !_default::cacheEntryWithinLimits(getCacheOutput.value().creationTime().clone(), now, self.ttlSeconds().clone()) {
                let mut maybeGetActiveBranchKeyOutput: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetActiveBranchKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetActiveBranchKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = IKeyStoreClient::GetActiveBranchKey(rd!(keyStore.clone()), &Arc::new(GetActiveBranchKeyInput::GetActiveBranchKeyInput {
                                branchKeyIdentifier: branchKeyId.clone()
                            }));
                maybeGetActiveBranchKeyOutput = _out2.clone();
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetActiveBranchKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeGetActiveBranchKeyOutput.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyKeyStore {
                                            AwsCryptographyKeyStore: e.clone()
                                        })
                                })
                        }));
                if valueOrError0.IsFailure() {
                    material = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<BranchKeyMaterials>>());
                    return material.read();
                };
                let mut getActiveBranchKeyOutput: Arc<GetActiveBranchKeyOutput> = valueOrError0.Extract();
                let mut branchKeyMaterials: Arc<BranchKeyMaterials> = getActiveBranchKeyOutput.branchKeyMaterials().clone();
                let mut now: i64;
                let mut _out3: i64 = crate::implementation_from_dafny::Time::_default::CurrentRelativeTime();
                now = _out3;
                let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(int!(now) + int!(self.ttlSeconds().clone()) < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT64_MAX_LIMIT(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("INT64 Overflow when putting cache entry.")
                            }));
                if valueOrError1.IsFailure() {
                    material = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<BranchKeyMaterials>>());
                    return material.read();
                };
                let mut putCacheEntryInput: Arc<PutCacheEntryInput> = Arc::new(PutCacheEntryInput::PutCacheEntryInput {
                            identifier: cacheId.clone(),
                            materials: Arc::new(Materials::BranchKey {
                                        BranchKey: branchKeyMaterials.clone()
                                    }),
                            creationTime: now,
                            expiryTime: self.ttlSeconds().clone() + now,
                            messagesUsed: Arc::new(Option::<PositiveInteger>::None {}),
                            bytesUsed: Arc::new(Option::<PositiveInteger>::None {})
                        });
                let mut putResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = ICryptographicMaterialsCache::PutCacheEntry(rd!(self.cache().clone()), &putCacheEntryInput);
                putResult = _out4.clone();
                if matches!((&putResult).as_ref(), Failure{ .. }) && !matches!(putResult.error().as_ref(), EntryAlreadyExists{ .. }) {
                    material = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                    error: putResult.error().clone()
                                }));
                    return material.read();
                };
                material = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: branchKeyMaterials.clone()
                            }));
                return material.read();
            } else {
                let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(getCacheOutput.value().materials().as_ref(), BranchKey{ .. }), &_default::E(&string_utf16_of("Invalid Material Type.")));
                if valueOrError2.IsFailure() {
                    material = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<BranchKeyMaterials>>());
                    return material.read();
                };
                material = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: getCacheOutput.value().materials().BranchKey().clone()
                            }));
                return material.read();
            };
            return material.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(114,5)
        pub fn keyStore(&self) -> Object<dyn IKeyStoreClient> {
            self.__i_keyStore.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(116,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(117,5)
        pub fn cache(&self) -> Object<dyn ICryptographicMaterialsCache> {
            self.__i_cache.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(113,5)
        pub fn branchKeyIdSupplier(&self) -> Arc<Option<Object<dyn IBranchKeyIdSupplier>>> {
            self.__i_branchKeyIdSupplier.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(112,5)
        pub fn branchKeyId(&self) -> Arc<Option<Sequence<DafnyCharUTF16>>> {
            self.__i_branchKeyId.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(115,5)
        pub fn ttlSeconds(&self) -> PositiveLong {
            self.__i_ttlSeconds.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(118,5)
        pub fn partitionIdBytes(&self) -> Sequence<u8> {
            self.__i_partitionIdBytes.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(119,5)
        pub fn logicalKeyStoreNameBytes(&self) -> Sequence<u8> {
            self.__i_logicalKeyStoreNameBytes.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsHierarchicalKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for AwsKmsHierarchicalKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for AwsKmsHierarchicalKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for AwsKmsHierarchicalKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(238,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut materials: Arc<EncryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = materials.algorithmSuite().clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = self.GetBranchKeyId(materials.encryptionContext());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut branchKeyIdForEncrypt: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&branchKeyIdForEncrypt).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut branchKeyIdUtf8: ValidUTF8Bytes = valueOrError1.Extract();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = self.GetActiveCacheId(&branchKeyIdForEncrypt, &branchKeyIdUtf8, &self.cryptoPrimitives().clone());
            valueOrError2 = _out1.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut cacheId: Sequence<u8> = valueOrError2.Extract();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = self.GetActiveHierarchicalMaterials(&branchKeyIdForEncrypt, &cacheId, &self.keyStore().clone());
            valueOrError3 = _out2.clone();
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut hierarchicalMaterials: Arc<BranchKeyMaterials> = valueOrError3.Extract();
            let mut branchKey: Sequence<u8> = hierarchicalMaterials.branchKey().clone();
            let mut branchKeyVersion: ValidUTF8Bytes = hierarchicalMaterials.branchKeyVersion().clone();
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(&branchKeyVersion).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut branchKeyVersionAsString: Sequence<DafnyCharUTF16> = valueOrError4.Extract();
            let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UUID::_default::ToByteArray(&branchKeyVersionAsString).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError5.IsFailure() {
                res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut branchKeyVersionAsBytes: Sequence<u8> = valueOrError5.Extract();
            let mut kmsHierarchyGenerateAndWrap: Object<KmsHierarchyGenerateAndWrapKeyMaterial>;
            let mut _nw0: Object<KmsHierarchyGenerateAndWrapKeyMaterial> = KmsHierarchyGenerateAndWrapKeyMaterial::_allocate_object();
            KmsHierarchyGenerateAndWrapKeyMaterial::_ctor(&_nw0, hierarchicalMaterials.branchKey(), &branchKeyIdUtf8, &branchKeyVersionAsBytes, &self.cryptoPrimitives().clone());
            kmsHierarchyGenerateAndWrap = _nw0.clone();
            let mut kmsHierarchyWrap: Object<KmsHierarchyWrapKeyMaterial>;
            let mut _nw1: Object<KmsHierarchyWrapKeyMaterial> = KmsHierarchyWrapKeyMaterial::_allocate_object();
            KmsHierarchyWrapKeyMaterial::_ctor(&_nw1, hierarchicalMaterials.branchKey(), &branchKeyIdUtf8, &branchKeyVersionAsBytes, &self.cryptoPrimitives().clone());
            kmsHierarchyWrap = _nw1.clone();
            let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::WrapEdkMaterial::<Arc<HierarchyWrapInfo>>(&materials, &upcast_object::<KmsHierarchyWrapKeyMaterial, dyn WrapMaterial<Arc<HierarchyWrapInfo>>>()(kmsHierarchyWrap.clone()), &upcast_object::<KmsHierarchyGenerateAndWrapKeyMaterial, dyn GenerateAndWrapMaterial<Arc<HierarchyWrapInfo>>>()(kmsHierarchyGenerateAndWrap.clone()));
            valueOrError6 = _out3.clone();
            if valueOrError6.IsFailure() {
                res = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut wrapOutput: Arc<WrapEdkMaterialOutput<Arc<HierarchyWrapInfo>>> = valueOrError6.Extract();
            let mut symmetricSigningKeyList: Arc<Option<Sequence<Sequence<u8>>>>;
            if matches!(wrapOutput.symmetricSigningKey().as_ref(), Some{ .. }) {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                            value: seq![wrapOutput.symmetricSigningKey().value().clone()]
                        });
            } else {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::None {});
            };
            let mut edk: Arc<EncryptedDataKey> = Arc::new(EncryptedDataKey::EncryptedDataKey {
                        keyProviderId: crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID_HIERARCHY(),
                        keyProviderInfo: branchKeyIdUtf8.clone(),
                        ciphertext: wrapOutput.wrappedMaterial().clone()
                    });
            if matches!((&wrapOutput).as_ref(), GenerateAndWrapEdkMaterialOutput{ .. }) {
                let mut valueOrError7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddDataKey(&materials, wrapOutput.plaintextDataKey(), &seq![edk.clone()], &symmetricSigningKeyList);
                if valueOrError7.IsFailure() {
                    res = MaybePlacebo::from(valueOrError7.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return res.read();
                };
                let mut result: Arc<EncryptionMaterials> = valueOrError7.Extract();
                res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                            materials: result.clone()
                                        })
                            }));
                return res.read();
            } else {
                if matches!((&wrapOutput).as_ref(), WrapOnlyEdkMaterialOutput{ .. }) {
                    let mut valueOrError8: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddEncryptedDataKeys(&materials, &seq![edk.clone()], &symmetricSigningKeyList);
                    if valueOrError8.IsFailure() {
                        res = MaybePlacebo::from(valueOrError8.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return res.read();
                    };
                    let mut result: Arc<EncryptionMaterials> = valueOrError8.Extract();
                    res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                    value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                                materials: result.clone()
                                            })
                                }));
                    return res.read();
                }
            };
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(346,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(&materials), &_default::E(&string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = self.GetBranchKeyId(materials.encryptionContext());
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut branchKeyIdForDecrypt: Sequence<DafnyCharUTF16> = valueOrError1.Extract();
            let mut filter: Object<OnDecryptHierarchyEncryptedDataKeyFilter>;
            let mut _nw0: Object<OnDecryptHierarchyEncryptedDataKeyFilter> = OnDecryptHierarchyEncryptedDataKeyFilter::_allocate_object();
            OnDecryptHierarchyEncryptedDataKeyFilter::_ctor(&_nw0, &branchKeyIdForDecrypt);
            filter = _nw0.clone();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Arc<EncryptedDataKey>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Arc<EncryptedDataKey>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Actions_Compile::_default::FilterWithResult::<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&upcast_object::<OnDecryptHierarchyEncryptedDataKeyFilter, dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>()(filter.clone()), input.encryptedDataKeys());
            valueOrError2 = _out1.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut edksToAttempt: Sequence<Arc<EncryptedDataKey>> = valueOrError2.Extract();
            if 0 == truncate!(edksToAttempt.cardinality(), u64) {
                let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of(""));
                if valueOrError3.IsFailure() {
                    res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnDecryptOutput>>());
                    return res.read();
                };
                let mut errorMessage: Sequence<DafnyCharUTF16> = valueOrError3.Extract();
                res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: errorMessage.clone()
                                        })
                            }));
                return res.read();
            };
            let mut decryptClosure: Object<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _nw1: Object<DecryptSingleEncryptedDataKey> = DecryptSingleEncryptedDataKey::_allocate_object();
            DecryptSingleEncryptedDataKey::_ctor(&_nw1, &materials, &self.keyStore().clone(), &self.cryptoPrimitives().clone(), &branchKeyIdForDecrypt, self.ttlSeconds().clone(), &self.cache().clone(), &self.partitionIdBytes().clone(), &self.logicalKeyStoreNameBytes().clone());
            decryptClosure = upcast_object::<DecryptSingleEncryptedDataKey, dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>()(_nw1.clone());
            let mut outcome: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>> = crate::implementation_from_dafny::_Actions_Compile::_default::ReduceToSuccess::<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&decryptClosure, &edksToAttempt);
            outcome = _out2.clone();
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = outcome.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |errors: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::CollectionOfErrors {
                                        list: errors.clone(),
                                        message: string_utf16_of("No Configured KMS Key was able to decrypt the Data Key. The list of encountered Exceptions is available via `list`.")
                                    })
                            })
                    }));
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut SealedDecryptionMaterials: SealedDecryptionMaterials = valueOrError4.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(OnDecryptOutput::OnDecryptOutput {
                                        materials: SealedDecryptionMaterials.clone()
                                    })
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for AwsKmsHierarchicalKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(607,3)
    pub struct OnDecryptHierarchyEncryptedDataKeyFilter {
        pub __i_branchKeyId: Sequence<DafnyCharUTF16>
    }

    impl OnDecryptHierarchyEncryptedDataKeyFilter {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(612,5)
        pub fn _ctor(this: &Object<OnDecryptHierarchyEncryptedDataKeyFilter>, branchKeyId: &Sequence<DafnyCharUTF16>) -> () {
            let mut _set___i_branchKeyId: bool = false;
            update_field_uninit_object!(this.clone(), __i_branchKeyId, _set___i_branchKeyId, branchKeyId.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(610,5)
        pub fn branchKeyId(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_branchKeyId.clone()
        }
    }

    impl UpcastObject<DynAny>
        for OnDecryptHierarchyEncryptedDataKeyFilter {
        UpcastObjectFn!(DynAny);
    }

    impl DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for OnDecryptHierarchyEncryptedDataKeyFilter {}

    impl UpcastObject<dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for OnDecryptHierarchyEncryptedDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl DeterministicAction<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for OnDecryptHierarchyEncryptedDataKeyFilter {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(632,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut providerInfo: Sequence<u8> = edk.keyProviderInfo().clone();
            let mut providerId: ValidUTF8Bytes = edk.keyProviderId().clone();
            if providerId.clone() != crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID_HIERARCHY() {
                res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: false
                            }));
                return res.read();
            };
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(&providerInfo).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                _default::E(&string_utf16_of("Invalid encoding, provider info is not UTF8."))
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<bool>());
                return res.read();
            };
            let mut branchKeyId: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: self.branchKeyId().clone() == branchKeyId.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for OnDecryptHierarchyEncryptedDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(660,3)
    pub struct DecryptSingleEncryptedDataKey {
        pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey,
        pub __i_keyStore: Object<dyn IKeyStoreClient>,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_branchKeyId: Sequence<DafnyCharUTF16>,
        pub __i_ttlSeconds: PositiveLong,
        pub __i_cache: Object<dyn ICryptographicMaterialsCache>,
        pub __i_partitionIdBytes: Sequence<u8>,
        pub __i_logicalKeyStoreNameBytes: Sequence<u8>
    }

    impl DecryptSingleEncryptedDataKey {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(675,5)
        pub fn _ctor(this: &Object<DecryptSingleEncryptedDataKey>, materials: &DecryptionMaterialsPendingPlaintextDataKey, keyStore: &Object<dyn IKeyStoreClient>, cryptoPrimitives: &Object<AtomicPrimitivesClient>, branchKeyId: &Sequence<DafnyCharUTF16>, ttlSeconds: PositiveLong, cache: &Object<dyn ICryptographicMaterialsCache>, partitionIdBytes: &Sequence<u8>, logicalKeyStoreNameBytes: &Sequence<u8>) -> () {
            let mut _set___i_materials: bool = false;
            let mut _set___i_keyStore: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_branchKeyId: bool = false;
            let mut _set___i_ttlSeconds: bool = false;
            let mut _set___i_cache: bool = false;
            let mut _set___i_partitionIdBytes: bool = false;
            let mut _set___i_logicalKeyStoreNameBytes: bool = false;
            update_field_uninit_object!(this.clone(), __i_materials, _set___i_materials, materials.clone());
            update_field_uninit_object!(this.clone(), __i_keyStore, _set___i_keyStore, keyStore.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            update_field_uninit_object!(this.clone(), __i_branchKeyId, _set___i_branchKeyId, branchKeyId.clone());
            update_field_uninit_object!(this.clone(), __i_ttlSeconds, _set___i_ttlSeconds, ttlSeconds);
            update_field_uninit_object!(this.clone(), __i_cache, _set___i_cache, cache.clone());
            update_field_uninit_object!(this.clone(), __i_partitionIdBytes, _set___i_partitionIdBytes, partitionIdBytes.clone());
            update_field_uninit_object!(this.clone(), __i_logicalKeyStoreNameBytes, _set___i_logicalKeyStoreNameBytes, logicalKeyStoreNameBytes.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(798,5)
        pub fn GetVersionCacheId(&self, branchKeyIdUtf8: &Sequence<u8>, branchKeyVersion: &Sequence<DafnyCharUTF16>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut cacheId = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(true && ({
                            let __pat_let2_0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Decode(branchKeyIdUtf8);
                            {
                                let branchKeyId: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> = __pat_let2_0.clone();
                                matches!((&branchKeyId).as_ref(), Success{ .. }) && (0 <= truncate!(branchKeyId.value().cardinality(), u64) && truncate!(branchKeyId.value().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT32_LIMIT(), u64))
                            }
                        }), &_default::E(&string_utf16_of("Invalid Branch Key ID Length")));
            if valueOrError0.IsFailure() {
                cacheId = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return cacheId.read();
            };
            let mut hashAlgorithm: Arc<DigestAlgorithm> = Arc::new(DigestAlgorithm::SHA_384 {});
            let mut resourceId: Sequence<u8> = crate::implementation_from_dafny::_CacheConstants_Compile::_default::RESOURCE_ID_HIERARCHICAL_KEYRING();
            let mut scopeId: Sequence<u8> = crate::implementation_from_dafny::_CacheConstants_Compile::_default::SCOPE_ID_DECRYPT();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::UTF8::_default::IsASCIIString(branchKeyVersion), &_default::E(&string_utf16_of("Unable to represent as an ASCII string.")));
            if valueOrError1.IsFailure() {
                cacheId = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return cacheId.read();
            };
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(branchKeyVersion).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                        message: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                cacheId = MaybePlacebo::from(valueOrError2.PropagateFailure::<Sequence<u8>>());
                return cacheId.read();
            };
            let mut versionBytes: ValidUTF8Bytes = valueOrError2.Extract();
            let mut suffix: Sequence<u8> = self.logicalKeyStoreNameBytes().clone().concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(branchKeyIdUtf8).concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&versionBytes);
            let mut identifier: Sequence<u8> = resourceId.concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&scopeId).concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&self.partitionIdBytes().clone()).concat(&crate::implementation_from_dafny::_CacheConstants_Compile::_default::NULL_BYTE()).concat(&suffix);
            let mut identifierDigestInput: Arc<DigestInput> = Arc::new(DigestInput::DigestInput {
                        digestAlgorithm: hashAlgorithm.clone(),
                        message: identifier.clone()
                    });
            let mut maybeCacheDigest: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Digest_Compile::_default::Digest(&identifierDigestInput);
            maybeCacheDigest = _out0.clone();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeCacheDigest.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError3.IsFailure() {
                cacheId = MaybePlacebo::from(valueOrError3.PropagateFailure::<Sequence<u8>>());
                return cacheId.read();
            };
            let mut cacheDigest: Sequence<u8> = valueOrError3.Extract();
            cacheId = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: cacheDigest.clone()
                        }));
            return cacheId.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(860,5)
        pub fn GetHierarchicalMaterialsVersion(&self, branchKeyId: &Sequence<DafnyCharUTF16>, branchKeyIdUtf8: &Sequence<u8>, version: &Sequence<DafnyCharUTF16>, cacheId: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut material = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut getCacheInput: Arc<GetCacheEntryInput> = Arc::new(GetCacheEntryInput::GetCacheEntryInput {
                        identifier: cacheId.clone(),
                        bytesUsed: Arc::new(Option::<i64>::None {})
                    });
            let mut getCacheOutput: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = ICryptographicMaterialsCache::GetCacheEntry(rd!(self.cache().clone()), &getCacheInput);
            getCacheOutput = _out0.clone();
            if matches!((&getCacheOutput).as_ref(), Failure{ .. }) && !matches!(getCacheOutput.error().as_ref(), EntryDoesNotExist{ .. }) {
                material = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: getCacheOutput.error().clone()
                            }));
                return material.read();
            };
            let mut now: i64;
            let mut _out1: i64 = crate::implementation_from_dafny::Time::_default::CurrentRelativeTime();
            now = _out1;
            if matches!((&getCacheOutput).as_ref(), Failure{ .. }) || !_default::cacheEntryWithinLimits(getCacheOutput.value().creationTime().clone(), now, self.ttlSeconds().clone()) {
                let mut maybeGetBranchKeyVersionOutput: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBranchKeyVersionOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
                let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBranchKeyVersionOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = IKeyStoreClient::GetBranchKeyVersion(rd!(self.keyStore().clone()), &Arc::new(GetBranchKeyVersionInput::GetBranchKeyVersionInput {
                                branchKeyIdentifier: branchKeyId.clone(),
                                branchKeyVersion: version.clone()
                            }));
                maybeGetBranchKeyVersionOutput = _out2.clone();
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetBranchKeyVersionOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeGetBranchKeyVersionOutput.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyKeyStore {
                                            AwsCryptographyKeyStore: e.clone()
                                        })
                                })
                        }));
                if valueOrError0.IsFailure() {
                    material = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<BranchKeyMaterials>>());
                    return material.read();
                };
                let mut getBranchKeyVersionOutput: Arc<GetBranchKeyVersionOutput> = valueOrError0.Extract();
                let mut branchKeyMaterials: Arc<BranchKeyMaterials> = getBranchKeyVersionOutput.branchKeyMaterials().clone();
                let mut now: i64;
                let mut _out3: i64 = crate::implementation_from_dafny::Time::_default::CurrentRelativeTime();
                now = _out3;
                let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(int!(now) + int!(self.ttlSeconds().clone()) < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT64_MAX_LIMIT(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("INT64 Overflow when putting cache entry.")
                            }));
                if valueOrError1.IsFailure() {
                    material = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<BranchKeyMaterials>>());
                    return material.read();
                };
                let mut putCacheEntryInput: Arc<PutCacheEntryInput> = Arc::new(PutCacheEntryInput::PutCacheEntryInput {
                            identifier: cacheId.clone(),
                            materials: Arc::new(Materials::BranchKey {
                                        BranchKey: branchKeyMaterials.clone()
                                    }),
                            creationTime: now,
                            expiryTime: self.ttlSeconds().clone() + now,
                            messagesUsed: Arc::new(Option::<PositiveInteger>::None {}),
                            bytesUsed: Arc::new(Option::<PositiveInteger>::None {})
                        });
                let mut putResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = ICryptographicMaterialsCache::PutCacheEntry(rd!(self.cache().clone()), &putCacheEntryInput);
                putResult = _out4.clone();
                if matches!((&putResult).as_ref(), Failure{ .. }) && !matches!(putResult.error().as_ref(), EntryAlreadyExists{ .. }) {
                    material = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                    error: putResult.error().clone()
                                }));
                    return material.read();
                };
                material = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: branchKeyMaterials.clone()
                            }));
                return material.read();
            } else {
                let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(getCacheOutput.value().materials().as_ref(), BranchKey{ .. }), &_default::E(&string_utf16_of("Invalid Material Type.")));
                if valueOrError2.IsFailure() {
                    material = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<BranchKeyMaterials>>());
                    return material.read();
                };
                material = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: getCacheOutput.value().materials().BranchKey().clone()
                            }));
                return material.read();
            };
            return material.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(666,5)
        pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey {
            self.__i_materials.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(667,5)
        pub fn keyStore(&self) -> Object<dyn IKeyStoreClient> {
            self.__i_keyStore.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(668,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(669,5)
        pub fn branchKeyId(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_branchKeyId.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(670,5)
        pub fn ttlSeconds(&self) -> PositiveLong {
            self.__i_ttlSeconds.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(671,5)
        pub fn cache(&self) -> Object<dyn ICryptographicMaterialsCache> {
            self.__i_cache.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(672,5)
        pub fn partitionIdBytes(&self) -> Sequence<u8> {
            self.__i_partitionIdBytes.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(673,5)
        pub fn logicalKeyStoreNameBytes(&self) -> Sequence<u8> {
            self.__i_logicalKeyStoreNameBytes.clone()
        }
    }

    impl UpcastObject<DynAny>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(DynAny);
    }

    impl ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for DecryptSingleEncryptedDataKey {}

    impl UpcastObject<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for DecryptSingleEncryptedDataKey {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(736,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = self.materials().clone().algorithmSuite().clone();
            let mut keyProviderId: ValidUTF8Bytes = edk.keyProviderId().clone();
            let mut branchKeyIdUtf8: Sequence<u8> = edk.keyProviderInfo().clone();
            let mut ciphertext: Sequence<u8> = edk.ciphertext().clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::GetProviderWrappedMaterial(&ciphertext, &suite);
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut providerWrappedMaterial: Sequence<u8> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(providerWrappedMaterial.cardinality(), u64) >= _default::EDK_CIPHERTEXT_VERSION_INDEX() as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Received EDK Ciphertext of incorrect length.")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut branchKeyVersionUuid: Sequence<u8> = providerWrappedMaterial.slice(&int!((&_default::EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX()).clone()), &int!((&_default::EDK_CIPHERTEXT_VERSION_INDEX()).clone()));
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UUID::_default::FromByteArray(&branchKeyVersionUuid).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut version: Sequence<DafnyCharUTF16> = valueOrError2.Extract();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = self.GetVersionCacheId(&branchKeyIdUtf8, &version, &self.cryptoPrimitives().clone());
            valueOrError3 = _out0.clone();
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut cacheId: Sequence<u8> = valueOrError3.Extract();
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<BranchKeyMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = self.GetHierarchicalMaterialsVersion(&self.branchKeyId().clone(), &branchKeyIdUtf8, &version, &cacheId);
            valueOrError4 = _out1.clone();
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut hierarchicalMaterials: Arc<BranchKeyMaterials> = valueOrError4.Extract();
            let mut branchKey: Sequence<u8> = hierarchicalMaterials.branchKey().clone();
            let mut branchKeyVersion: ValidUTF8Bytes = hierarchicalMaterials.branchKeyVersion().clone();
            let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(&branchKeyVersion).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError5.IsFailure() {
                res = MaybePlacebo::from(valueOrError5.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut branchKeyVersionAsString: Sequence<DafnyCharUTF16> = valueOrError5.Extract();
            let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UUID::_default::ToByteArray(&branchKeyVersionAsString).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError6.IsFailure() {
                res = MaybePlacebo::from(valueOrError6.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut branchKeyVersionAsBytes: Sequence<u8> = valueOrError6.Extract();
            let mut maybeCrypto: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::AtomicPrimitives(&crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::DefaultCryptoConfig());
            maybeCrypto = _out2.clone();
            let mut valueOrError7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeCrypto.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError7.IsFailure() {
                res = MaybePlacebo::from(valueOrError7.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut cryptoPrimitivesX: Object<dyn IAwsCryptographicPrimitivesClient> = upcast_object::<AtomicPrimitivesClient, dyn IAwsCryptographicPrimitivesClient>()(valueOrError7.Extract());
            let mut cryptoPrimitives: Object<AtomicPrimitivesClient> = cast_object!(cryptoPrimitivesX.clone(), AtomicPrimitivesClient);
            let mut kmsHierarchyUnwrap: Object<KmsHierarchyUnwrapKeyMaterial>;
            let mut _nw0: Object<KmsHierarchyUnwrapKeyMaterial> = KmsHierarchyUnwrapKeyMaterial::_allocate_object();
            KmsHierarchyUnwrapKeyMaterial::_ctor(&_nw0, &branchKey, &branchKeyIdUtf8, &branchKeyVersionAsBytes, &cryptoPrimitives);
            kmsHierarchyUnwrap = _nw0.clone();
            let mut unwrapOutputRes: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::<Arc<HierarchyUnwrapInfo>>(edk.ciphertext(), &self.materials().clone(), &upcast_object::<KmsHierarchyUnwrapKeyMaterial, dyn UnwrapMaterial<Arc<HierarchyUnwrapInfo>>>()(kmsHierarchyUnwrap.clone()));
            unwrapOutputRes = _out3.clone();
            let mut valueOrError8: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = unwrapOutputRes.clone();
            if valueOrError8.IsFailure() {
                res = MaybePlacebo::from(valueOrError8.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut unwrapOutput: Arc<UnwrapEdkMaterialOutput<Arc<HierarchyUnwrapInfo>>> = valueOrError8.Extract();
            let mut valueOrError9: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey());
            if valueOrError9.IsFailure() {
                res = MaybePlacebo::from(valueOrError9.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut result: Arc<DecryptionMaterials> = valueOrError9.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: result.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(dyn Action<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(935,3)
    #[derive(PartialEq, Clone)]
    pub enum HierarchyUnwrapInfo {
        HierarchyUnwrapInfo {}
    }

    impl HierarchyUnwrapInfo {}

    impl Debug
        for HierarchyUnwrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for HierarchyUnwrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                HierarchyUnwrapInfo::HierarchyUnwrapInfo{} => {
                    write!(_formatter, "AwsKmsHierarchicalKeyring_Compile.HierarchyUnwrapInfo.HierarchyUnwrapInfo")?;
                    Ok(())
                },
            }
        }
    }

    impl HierarchyUnwrapInfo {
        /// Enumerates all possible values of HierarchyUnwrapInfo
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<HierarchyUnwrapInfo>> {
            seq![Arc::new(HierarchyUnwrapInfo::HierarchyUnwrapInfo {})].iter()
        }
    }

    impl Eq
        for HierarchyUnwrapInfo {}

    impl Hash
        for HierarchyUnwrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                HierarchyUnwrapInfo::HierarchyUnwrapInfo{} => {

                },
            }
        }
    }

    impl Default
        for HierarchyUnwrapInfo {
        fn default() -> HierarchyUnwrapInfo {
            HierarchyUnwrapInfo::HierarchyUnwrapInfo {}
        }
    }

    impl AsRef<HierarchyUnwrapInfo>
        for HierarchyUnwrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(936,3)
    #[derive(PartialEq, Clone)]
    pub enum HierarchyWrapInfo {
        HierarchyWrapInfo {}
    }

    impl HierarchyWrapInfo {}

    impl Debug
        for HierarchyWrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for HierarchyWrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                HierarchyWrapInfo::HierarchyWrapInfo{} => {
                    write!(_formatter, "AwsKmsHierarchicalKeyring_Compile.HierarchyWrapInfo.HierarchyWrapInfo")?;
                    Ok(())
                },
            }
        }
    }

    impl HierarchyWrapInfo {
        /// Enumerates all possible values of HierarchyWrapInfo
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<HierarchyWrapInfo>> {
            seq![Arc::new(HierarchyWrapInfo::HierarchyWrapInfo {})].iter()
        }
    }

    impl Eq
        for HierarchyWrapInfo {}

    impl Hash
        for HierarchyWrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                HierarchyWrapInfo::HierarchyWrapInfo{} => {

                },
            }
        }
    }

    impl Default
        for HierarchyWrapInfo {
        fn default() -> HierarchyWrapInfo {
            HierarchyWrapInfo::HierarchyWrapInfo {}
        }
    }

    impl AsRef<HierarchyWrapInfo>
        for HierarchyWrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(938,3)
    pub struct KmsHierarchyUnwrapKeyMaterial {
        pub __i_crypto: Object<AtomicPrimitivesClient>,
        pub __i_branchKeyIdUtf8: ValidUTF8Bytes,
        pub __i_branchKeyVersionAsBytes: Sequence<u8>,
        pub __i_branchKey: Sequence<u8>
    }

    impl KmsHierarchyUnwrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(946,5)
        pub fn _ctor(this: &Object<KmsHierarchyUnwrapKeyMaterial>, branchKey: &Sequence<u8>, branchKeyIdUtf8: &ValidUTF8Bytes, branchKeyVersionAsBytes: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_crypto: bool = false;
            let mut _set___i_branchKeyIdUtf8: bool = false;
            let mut _set___i_branchKeyVersionAsBytes: bool = false;
            let mut _set___i_branchKey: bool = false;
            update_field_uninit_object!(this.clone(), __i_branchKey, _set___i_branchKey, branchKey.clone());
            update_field_uninit_object!(this.clone(), __i_branchKeyIdUtf8, _set___i_branchKeyIdUtf8, branchKeyIdUtf8.clone());
            update_field_uninit_object!(this.clone(), __i_branchKeyVersionAsBytes, _set___i_branchKeyVersionAsBytes, branchKeyVersionAsBytes.clone());
            update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(944,5)
        pub fn crypto(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_crypto.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(942,5)
        pub fn branchKeyIdUtf8(&self) -> ValidUTF8Bytes {
            self.__i_branchKeyIdUtf8.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(943,5)
        pub fn branchKeyVersionAsBytes(&self) -> Sequence<u8> {
            self.__i_branchKeyVersionAsBytes.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(941,5)
        pub fn branchKey(&self) -> Sequence<u8> {
            self.__i_branchKey.clone()
        }
    }

    impl UpcastObject<DynAny>
        for KmsHierarchyUnwrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl UnwrapMaterial<Arc<HierarchyUnwrapInfo>>
        for KmsHierarchyUnwrapKeyMaterial {}

    impl UpcastObject<dyn UnwrapMaterial<Arc<HierarchyUnwrapInfo>>>
        for KmsHierarchyUnwrapKeyMaterial {
        UpcastObjectFn!(dyn UnwrapMaterial<Arc<HierarchyUnwrapInfo>>);
    }

    impl ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for KmsHierarchyUnwrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for KmsHierarchyUnwrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for KmsHierarchyUnwrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1012,5)
        fn Invoke(&self, input: &Arc<UnwrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.algorithmSuite().clone();
            let mut wrappedMaterial: Sequence<u8> = input.wrappedMaterial().clone();
            let mut aad: Map<ValidUTF8Bytes, ValidUTF8Bytes> = input.encryptionContext().clone();
            let mut KeyLength: i32 = crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite);
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(wrappedMaterial.cardinality(), u64) == _default::EXPECTED_EDK_CIPHERTEXT_OVERHEAD() as u64 + KeyLength as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Received EDK Ciphertext of incorrect length2.")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>>());
                return res.read();
            };
            let mut salt: Sequence<u8> = wrappedMaterial.take(&int!((&_default::H_WRAP_SALT_LEN()).clone()));
            let mut iv: Sequence<u8> = wrappedMaterial.slice(&int!((&_default::H_WRAP_SALT_LEN()).clone()), &int!((&_default::EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX()).clone()));
            let mut branchKeyVersionUuid: Sequence<u8> = wrappedMaterial.slice(&int!((&_default::EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX()).clone()), &int!((&_default::EDK_CIPHERTEXT_VERSION_INDEX()).clone()));
            let mut wrappedKey: Sequence<u8> = wrappedMaterial.slice(&int!((&_default::EDK_CIPHERTEXT_VERSION_INDEX()).clone()), &int!((&(_default::EDK_CIPHERTEXT_VERSION_INDEX() + KeyLength)).clone()));
            let mut authTag: Sequence<u8> = wrappedMaterial.drop(&int!((&(_default::EDK_CIPHERTEXT_VERSION_INDEX() + KeyLength)).clone()));
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = input.serializedEC().clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>>());
                return res.read();
            };
            let mut serializedEC: Sequence<u8> = valueOrError1.Extract();
            let mut wrappingAad: Sequence<u8> = _default::WrappingAad(&self.branchKeyIdUtf8().clone(), &self.branchKeyVersionAsBytes().clone(), &serializedEC);
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DeriveEncryptionKeyFromBranchKey(&self.branchKey().clone(), &salt, &Arc::new(Option::<ValidUTF8Bytes>::Some {
                            value: crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID_HIERARCHY()
                        }), &self.crypto().clone());
            valueOrError2 = _out0.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>>());
                return res.read();
            };
            let mut derivedBranchKey: Sequence<u8> = valueOrError2.Extract();
            let mut maybeUnwrappedPdk: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESDecrypt(rd!(self.crypto().clone()), &Arc::new(AESDecryptInput::AESDecryptInput {
                            encAlg: _default::AES_256_ENC_ALG(),
                            key: derivedBranchKey.clone(),
                            cipherTxt: wrappedKey.clone(),
                            authTag: authTag.clone(),
                            iv: iv.clone(),
                            aad: wrappingAad.clone()
                        }));
            maybeUnwrappedPdk = _out1.clone();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeUnwrappedPdk.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>>());
                return res.read();
            };
            let mut unwrappedPdk: Sequence<u8> = valueOrError3.Extract();
            let mut output: Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>> = Arc::new(UnwrapOutput::<Arc<HierarchyUnwrapInfo>>::UnwrapOutput {
                        unwrappedMaterial: unwrappedPdk.clone(),
                        unwrapInfo: Arc::new(HierarchyUnwrapInfo::HierarchyUnwrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for KmsHierarchyUnwrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<HierarchyUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1076,3)
    pub struct KmsHierarchyGenerateAndWrapKeyMaterial {
        pub __i_branchKey: Sequence<u8>,
        pub __i_branchKeyIdUtf8: ValidUTF8Bytes,
        pub __i_branchKeyVersionAsBytes: Sequence<u8>,
        pub __i_crypto: Object<AtomicPrimitivesClient>
    }

    impl KmsHierarchyGenerateAndWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1084,5)
        pub fn _ctor(this: &Object<KmsHierarchyGenerateAndWrapKeyMaterial>, branchKey: &Sequence<u8>, branchKeyIdUtf8: &ValidUTF8Bytes, branchKeyVersionAsBytes: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_branchKey: bool = false;
            let mut _set___i_branchKeyIdUtf8: bool = false;
            let mut _set___i_branchKeyVersionAsBytes: bool = false;
            let mut _set___i_crypto: bool = false;
            update_field_uninit_object!(this.clone(), __i_branchKey, _set___i_branchKey, branchKey.clone());
            update_field_uninit_object!(this.clone(), __i_branchKeyIdUtf8, _set___i_branchKeyIdUtf8, branchKeyIdUtf8.clone());
            update_field_uninit_object!(this.clone(), __i_branchKeyVersionAsBytes, _set___i_branchKeyVersionAsBytes, branchKeyVersionAsBytes.clone());
            update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1079,5)
        pub fn branchKey(&self) -> Sequence<u8> {
            self.__i_branchKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1080,5)
        pub fn branchKeyIdUtf8(&self) -> ValidUTF8Bytes {
            self.__i_branchKeyIdUtf8.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1081,5)
        pub fn branchKeyVersionAsBytes(&self) -> Sequence<u8> {
            self.__i_branchKeyVersionAsBytes.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1082,5)
        pub fn crypto(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_crypto.clone()
        }
    }

    impl UpcastObject<DynAny>
        for KmsHierarchyGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl GenerateAndWrapMaterial<Arc<HierarchyWrapInfo>>
        for KmsHierarchyGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn GenerateAndWrapMaterial<Arc<HierarchyWrapInfo>>>
        for KmsHierarchyGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn GenerateAndWrapMaterial<Arc<HierarchyWrapInfo>>);
    }

    impl ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for KmsHierarchyGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for KmsHierarchyGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for KmsHierarchyGenerateAndWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1126,5)
        fn Invoke(&self, input: &Arc<GenerateAndWrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.algorithmSuite().clone();
            let mut pdkResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(self.crypto().clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                            length: crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite)
                        }));
            pdkResult = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = pdkResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>>());
                return res.read();
            };
            let mut pdk: Sequence<u8> = valueOrError0.Extract();
            let mut wrap: Object<KmsHierarchyWrapKeyMaterial>;
            let mut _nw0: Object<KmsHierarchyWrapKeyMaterial> = KmsHierarchyWrapKeyMaterial::_allocate_object();
            KmsHierarchyWrapKeyMaterial::_ctor(&_nw0, &self.branchKey().clone(), &self.branchKeyIdUtf8().clone(), &self.branchKeyVersionAsBytes().clone(), &self.crypto().clone());
            wrap = _nw0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = Action::<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::Invoke(rd!(wrap.clone()), &Arc::new(WrapInput::WrapInput {
                            plaintextMaterial: pdk.clone(),
                            algorithmSuite: input.algorithmSuite().clone(),
                            encryptionContext: input.encryptionContext().clone(),
                            serializedEC: input.serializedEC().clone()
                        }));
            valueOrError1 = _out1.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>>());
                return res.read();
            };
            let mut wrapOutput: Arc<WrapOutput<Arc<HierarchyWrapInfo>>> = valueOrError1.Extract();
            let mut output: Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>> = Arc::new(GenerateAndWrapOutput::<Arc<HierarchyWrapInfo>>::GenerateAndWrapOutput {
                        plaintextMaterial: pdk.clone(),
                        wrappedMaterial: wrapOutput.wrappedMaterial().clone(),
                        wrapInfo: Arc::new(HierarchyWrapInfo::HierarchyWrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for KmsHierarchyGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1168,3)
    pub struct KmsHierarchyWrapKeyMaterial {
        pub __i_branchKey: Sequence<u8>,
        pub __i_branchKeyIdUtf8: ValidUTF8Bytes,
        pub __i_branchKeyVersionAsBytes: Sequence<u8>,
        pub __i_crypto: Object<AtomicPrimitivesClient>
    }

    impl KmsHierarchyWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1176,5)
        pub fn _ctor(this: &Object<KmsHierarchyWrapKeyMaterial>, branchKey: &Sequence<u8>, branchKeyIdUtf8: &ValidUTF8Bytes, branchKeyVersionAsBytes: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_branchKey: bool = false;
            let mut _set___i_branchKeyIdUtf8: bool = false;
            let mut _set___i_branchKeyVersionAsBytes: bool = false;
            let mut _set___i_crypto: bool = false;
            update_field_uninit_object!(this.clone(), __i_branchKey, _set___i_branchKey, branchKey.clone());
            update_field_uninit_object!(this.clone(), __i_branchKeyIdUtf8, _set___i_branchKeyIdUtf8, branchKeyIdUtf8.clone());
            update_field_uninit_object!(this.clone(), __i_branchKeyVersionAsBytes, _set___i_branchKeyVersionAsBytes, branchKeyVersionAsBytes.clone());
            update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1171,5)
        pub fn branchKey(&self) -> Sequence<u8> {
            self.__i_branchKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1172,5)
        pub fn branchKeyIdUtf8(&self) -> ValidUTF8Bytes {
            self.__i_branchKeyIdUtf8.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1173,5)
        pub fn branchKeyVersionAsBytes(&self) -> Sequence<u8> {
            self.__i_branchKeyVersionAsBytes.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1174,5)
        pub fn crypto(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_crypto.clone()
        }
    }

    impl UpcastObject<DynAny>
        for KmsHierarchyWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl WrapMaterial<Arc<HierarchyWrapInfo>>
        for KmsHierarchyWrapKeyMaterial {}

    impl UpcastObject<dyn WrapMaterial<Arc<HierarchyWrapInfo>>>
        for KmsHierarchyWrapKeyMaterial {
        UpcastObjectFn!(dyn WrapMaterial<Arc<HierarchyWrapInfo>>);
    }

    impl ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for KmsHierarchyWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for KmsHierarchyWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for KmsHierarchyWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsHierarchicalKeyring.dfy(1232,5)
        fn Invoke(&self, input: &Arc<WrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.algorithmSuite().clone();
            let mut maybeNonceSalt: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(self.crypto().clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                            length: _default::H_WRAP_SALT_LEN() + _default::H_WRAP_NONCE_LEN()
                        }));
            maybeNonceSalt = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeNonceSalt.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>>());
                return res.read();
            };
            let mut saltAndNonce: Sequence<u8> = valueOrError0.Extract();
            let mut salt: Sequence<u8> = saltAndNonce.take(&int!((&_default::H_WRAP_SALT_LEN()).clone()));
            let mut nonce: Sequence<u8> = saltAndNonce.drop(&int!((&_default::H_WRAP_SALT_LEN()).clone()));
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = input.serializedEC().clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>>());
                return res.read();
            };
            let mut serializedEC: Sequence<u8> = valueOrError1.Extract();
            let mut wrappingAad: Sequence<u8> = _default::WrappingAad(&self.branchKeyIdUtf8().clone(), &self.branchKeyVersionAsBytes().clone(), &serializedEC);
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DeriveEncryptionKeyFromBranchKey(&self.branchKey().clone(), &salt, &Arc::new(Option::<ValidUTF8Bytes>::Some {
                            value: crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID_HIERARCHY()
                        }), &self.crypto().clone());
            valueOrError2 = _out1.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>>());
                return res.read();
            };
            let mut derivedBranchKey: Sequence<u8> = valueOrError2.Extract();
            let mut maybeWrappedPdk: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESEncrypt(rd!(self.crypto().clone()), &Arc::new(AESEncryptInput::AESEncryptInput {
                            encAlg: _default::AES_256_ENC_ALG(),
                            iv: nonce.clone(),
                            key: derivedBranchKey.clone(),
                            msg: input.plaintextMaterial().clone(),
                            aad: wrappingAad.clone()
                        }));
            maybeWrappedPdk = _out2.clone();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeWrappedPdk.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>>());
                return res.read();
            };
            let mut wrappedPdk: Arc<AESEncryptOutput> = valueOrError3.Extract();
            let mut output: Arc<WrapOutput<Arc<HierarchyWrapInfo>>> = Arc::new(WrapOutput::<Arc<HierarchyWrapInfo>>::WrapOutput {
                        wrappedMaterial: salt.concat(&nonce).concat(&self.branchKeyVersionAsBytes().clone()).concat(wrappedPdk.cipherText()).concat(wrappedPdk.authTag()),
                        wrapInfo: Arc::new(HierarchyWrapInfo::HierarchyWrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for KmsHierarchyWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<HierarchyWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(16,1)
pub mod _AwsKmsKeyring_Compile {
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicAction;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn;
    pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptRequest;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptResponse;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyRequest;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeySpec;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyResponse;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptRequest;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptResponse;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(41,3)
    pub struct AwsKmsKeyring {
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>,
        pub __i_grantTokens: GrantTokenList,
        pub __i_awsKmsArn: Arc<AwsKmsIdentifier>
    }

    impl AwsKmsKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// = aws-encryption-sdk-specification/framework/aws-kms/aws-kms-keyring.md#initialization
        /// = type=implication
        /// # The AWS KMS
        /// # key identifier MUST be [a valid identifier](aws-kms-key-arn.md#a-
        /// # valid-aws-kms-identifier).
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(58,5)
        pub fn _ctor(this: &Object<AwsKmsKeyring>, client: &Object<dyn IKMSClient>, awsKmsKey: &Sequence<DafnyCharUTF16>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_client: bool = false;
            let mut _set___i_awsKmsKey: bool = false;
            let mut _set___i_grantTokens: bool = false;
            let mut _set___i_awsKmsArn: bool = false;
            let mut parsedAwsKmsId: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsIdentifier(awsKmsKey);
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsArn, _set___i_awsKmsArn, parsedAwsKmsId.value().clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(44,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(45,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(47,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(46,5)
        pub fn awsKmsArn(&self) -> Arc<AwsKmsIdentifier> {
            self.__i_awsKmsArn.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for AwsKmsKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for AwsKmsKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for AwsKmsKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(131,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut materials: Arc<EncryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::StringifyEncryptionContext(input.materials().encryptionContext());
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut stringifiedEncCtx: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = valueOrError0.Extract();
            let mut kmsGenerateAndWrap: Object<KmsGenerateAndWrapKeyMaterial>;
            let mut _nw0: Object<KmsGenerateAndWrapKeyMaterial> = KmsGenerateAndWrapKeyMaterial::_allocate_object();
            KmsGenerateAndWrapKeyMaterial::_ctor(&_nw0, &self.client().clone(), &self.awsKmsKey().clone(), &self.grantTokens().clone());
            kmsGenerateAndWrap = _nw0.clone();
            let mut kmsWrap: Object<KmsWrapKeyMaterial>;
            let mut _nw1: Object<KmsWrapKeyMaterial> = KmsWrapKeyMaterial::_allocate_object();
            KmsWrapKeyMaterial::_ctor(&_nw1, &self.client().clone(), &self.awsKmsKey().clone(), &self.grantTokens().clone());
            kmsWrap = _nw1.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::WrapEdkMaterial::<Arc<KmsWrapInfo>>(&materials, &upcast_object::<KmsWrapKeyMaterial, dyn WrapMaterial<Arc<KmsWrapInfo>>>()(kmsWrap.clone()), &upcast_object::<KmsGenerateAndWrapKeyMaterial, dyn GenerateAndWrapMaterial<Arc<KmsWrapInfo>>>()(kmsGenerateAndWrap.clone()));
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut wrapOutput: Arc<WrapEdkMaterialOutput<Arc<KmsWrapInfo>>> = valueOrError1.Extract();
            let mut kmsKeyArn: Sequence<DafnyCharUTF16> = wrapOutput.wrapInfo().kmsKeyArn().clone();
            let mut symmetricSigningKeyList: Arc<Option<Sequence<Sequence<u8>>>>;
            if matches!(wrapOutput.symmetricSigningKey().as_ref(), Some{ .. }) {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                            value: seq![wrapOutput.symmetricSigningKey().value().clone()]
                        });
            } else {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::None {});
            };
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&kmsKeyArn).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut providerInfo: ValidUTF8Bytes = valueOrError2.Extract();
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(providerInfo.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from AWS KMS GenerateDataKey: Key ID too long.")
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut edk: Arc<EncryptedDataKey> = Arc::new(EncryptedDataKey::EncryptedDataKey {
                        keyProviderId: crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID(),
                        keyProviderInfo: providerInfo.clone(),
                        ciphertext: wrapOutput.wrappedMaterial().clone()
                    });
            if matches!((&wrapOutput).as_ref(), GenerateAndWrapEdkMaterialOutput{ .. }) {
                let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddDataKey(&materials, wrapOutput.plaintextDataKey(), &seq![edk.clone()], &symmetricSigningKeyList);
                if valueOrError4.IsFailure() {
                    res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return res.read();
                };
                let mut result: Arc<EncryptionMaterials> = valueOrError4.Extract();
                res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                            materials: result.clone()
                                        })
                            }));
                return res.read();
            } else {
                if matches!((&wrapOutput).as_ref(), WrapOnlyEdkMaterialOutput{ .. }) {
                    let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddEncryptedDataKeys(&materials, &seq![edk.clone()], &symmetricSigningKeyList);
                    if valueOrError5.IsFailure() {
                        res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return res.read();
                    };
                    let mut result: Arc<EncryptionMaterials> = valueOrError5.Extract();
                    res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                    value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                                materials: result.clone()
                                            })
                                }));
                    return res.read();
                }
            };
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(426,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(&materials), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::OkForDecrypt(&self.awsKmsArn().clone(), &self.awsKmsKey().clone());
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut filter: Object<dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _nw0: Object<OnDecryptEncryptedDataKeyFilter> = OnDecryptEncryptedDataKeyFilter::_allocate_object();
            OnDecryptEncryptedDataKeyFilter::_ctor(&_nw0, &self.awsKmsKey().clone());
            filter = upcast_object::<OnDecryptEncryptedDataKeyFilter, dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>()(_nw0.clone());
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Arc<EncryptedDataKey>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Arc<EncryptedDataKey>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Actions_Compile::_default::FilterWithResult::<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&filter, input.encryptedDataKeys());
            valueOrError2 = _out0.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut edksToAttempt: Sequence<Arc<EncryptedDataKey>> = valueOrError2.Extract();
            if 0 == truncate!(edksToAttempt.cardinality(), u64) {
                let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of(""));
                if valueOrError3.IsFailure() {
                    res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnDecryptOutput>>());
                    return res.read();
                };
                let mut errorMessage: Sequence<DafnyCharUTF16> = valueOrError3.Extract();
                res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: errorMessage.clone()
                                        })
                            }));
                return res.read();
            };
            let mut decryptClosure: Object<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _nw1: Object<DecryptSingleEncryptedDataKey> = DecryptSingleEncryptedDataKey::_allocate_object();
            DecryptSingleEncryptedDataKey::_ctor(&_nw1, &materials, &self.client().clone(), &self.awsKmsKey().clone(), &self.grantTokens().clone());
            decryptClosure = upcast_object::<DecryptSingleEncryptedDataKey, dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>()(_nw1.clone());
            let mut outcome: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>> = crate::implementation_from_dafny::_Actions_Compile::_default::ReduceToSuccess::<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&decryptClosure, &edksToAttempt);
            outcome = _out1.clone();
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = outcome.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |errors: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::CollectionOfErrors {
                                        list: errors.clone(),
                                        message: string_utf16_of("No Configured KMS Key was able to decrypt the Data Key. The list of encountered Exceptions is available via `list`.")
                                    })
                            })
                    }));
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut SealedDecryptionMaterials: SealedDecryptionMaterials = valueOrError4.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(OnDecryptOutput::OnDecryptOutput {
                                        materials: SealedDecryptionMaterials.clone()
                                    })
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for AwsKmsKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(592,3)
    pub struct OnDecryptEncryptedDataKeyFilter {
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>
    }

    impl OnDecryptEncryptedDataKeyFilter {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(597,5)
        pub fn _ctor(this: &Object<OnDecryptEncryptedDataKeyFilter>, awsKmsKey: &Sequence<DafnyCharUTF16>) -> () {
            let mut _set___i_awsKmsKey: bool = false;
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(595,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
    }

    impl UpcastObject<DynAny>
        for OnDecryptEncryptedDataKeyFilter {
        UpcastObjectFn!(DynAny);
    }

    impl DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for OnDecryptEncryptedDataKeyFilter {}

    impl UpcastObject<dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for OnDecryptEncryptedDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl DeterministicAction<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for OnDecryptEncryptedDataKeyFilter {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(612,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            if edk.keyProviderId().clone() != crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID() {
                res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: false
                            }));
                return res.read();
            };
            if !crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderInfo()) {
                res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: string_utf16_of("Invalid AWS KMS encoding, provider info is not UTF8.")
                                        })
                            }));
                return res.read();
            };
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(edk.keyProviderInfo()).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<bool>());
                return res.read();
            };
            let mut keyId: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<AwsKmsArn, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(&keyId).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<bool>());
                return res.read();
            };
            let mut _v0: AwsKmsArn = valueOrError1.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: self.awsKmsKey().clone() == keyId.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for OnDecryptEncryptedDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(643,3)
    pub struct DecryptSingleEncryptedDataKey {
        pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey,
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>,
        pub __i_grantTokens: GrantTokenList
    }

    impl DecryptSingleEncryptedDataKey {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(654,5)
        pub fn _ctor(this: &Object<DecryptSingleEncryptedDataKey>, materials: &DecryptionMaterialsPendingPlaintextDataKey, client: &Object<dyn IKMSClient>, awsKmsKey: &Sequence<DafnyCharUTF16>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_materials: bool = false;
            let mut _set___i_client: bool = false;
            let mut _set___i_awsKmsKey: bool = false;
            let mut _set___i_grantTokens: bool = false;
            update_field_uninit_object!(this.clone(), __i_materials, _set___i_materials, materials.clone());
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(649,5)
        pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey {
            self.__i_materials.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(650,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(651,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(652,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(DynAny);
    }

    impl ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for DecryptSingleEncryptedDataKey {}

    impl UpcastObject<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for DecryptSingleEncryptedDataKey {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(722,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut kmsUnwrap: Object<KmsUnwrapKeyMaterial>;
            let mut _nw0: Object<KmsUnwrapKeyMaterial> = KmsUnwrapKeyMaterial::_allocate_object();
            KmsUnwrapKeyMaterial::_ctor(&_nw0, &self.client().clone(), &self.awsKmsKey().clone(), &self.grantTokens().clone());
            kmsUnwrap = _nw0.clone();
            let mut unwrapOutputRes: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::<Arc<KmsUnwrapInfo>>(edk.ciphertext(), &self.materials().clone(), &upcast_object::<KmsUnwrapKeyMaterial, dyn UnwrapMaterial<Arc<KmsUnwrapInfo>>>()(kmsUnwrap.clone()));
            unwrapOutputRes = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = unwrapOutputRes.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut unwrapOutput: Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>> = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey());
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut result: Arc<DecryptionMaterials> = valueOrError1.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: result.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(dyn Action<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(756,3)
    #[derive(PartialEq, Clone)]
    pub enum KmsUnwrapInfo {
        KmsUnwrapInfo {}
    }

    impl KmsUnwrapInfo {}

    impl Debug
        for KmsUnwrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for KmsUnwrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                KmsUnwrapInfo::KmsUnwrapInfo{} => {
                    write!(_formatter, "AwsKmsKeyring_Compile.KmsUnwrapInfo.KmsUnwrapInfo")?;
                    Ok(())
                },
            }
        }
    }

    impl KmsUnwrapInfo {
        /// Enumerates all possible values of KmsUnwrapInfo
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KmsUnwrapInfo>> {
            seq![Arc::new(KmsUnwrapInfo::KmsUnwrapInfo {})].iter()
        }
    }

    impl Eq
        for KmsUnwrapInfo {}

    impl Hash
        for KmsUnwrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                KmsUnwrapInfo::KmsUnwrapInfo{} => {

                },
            }
        }
    }

    impl Default
        for KmsUnwrapInfo {
        fn default() -> KmsUnwrapInfo {
            KmsUnwrapInfo::KmsUnwrapInfo {}
        }
    }

    impl AsRef<KmsUnwrapInfo>
        for KmsUnwrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(758,3)
    #[derive(PartialEq, Clone)]
    pub enum KmsWrapInfo {
        KmsWrapInfo {
            kmsKeyArn: Sequence<DafnyCharUTF16>
        }
    }

    impl KmsWrapInfo {
        /// Returns a borrow of the field kmsKeyArn
        pub fn kmsKeyArn(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                KmsWrapInfo::KmsWrapInfo{kmsKeyArn, } => kmsKeyArn,
            }
        }
    }

    impl Debug
        for KmsWrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for KmsWrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                KmsWrapInfo::KmsWrapInfo{kmsKeyArn, } => {
                    write!(_formatter, "AwsKmsKeyring_Compile.KmsWrapInfo.KmsWrapInfo(")?;
                    DafnyPrint::fmt_print(kmsKeyArn, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for KmsWrapInfo {}

    impl Hash
        for KmsWrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                KmsWrapInfo::KmsWrapInfo{kmsKeyArn, } => {
                    Hash::hash(kmsKeyArn, _state)
                },
            }
        }
    }

    impl Default
        for KmsWrapInfo {
        fn default() -> KmsWrapInfo {
            KmsWrapInfo::KmsWrapInfo {
                kmsKeyArn: Default::default()
            }
        }
    }

    impl AsRef<KmsWrapInfo>
        for KmsWrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(762,3)
    pub struct KmsUnwrapKeyMaterial {
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_grantTokens: GrantTokenList,
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>
    }

    impl KmsUnwrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(769,5)
        pub fn _ctor(this: &Object<KmsUnwrapKeyMaterial>, client: &Object<dyn IKMSClient>, awsKmsKey: &Sequence<DafnyCharUTF16>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_client: bool = false;
            let mut _set___i_grantTokens: bool = false;
            let mut _set___i_awsKmsKey: bool = false;
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(765,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(767,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(766,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
    }

    impl UpcastObject<DynAny>
        for KmsUnwrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl UnwrapMaterial<Arc<KmsUnwrapInfo>>
        for KmsUnwrapKeyMaterial {}

    impl UpcastObject<dyn UnwrapMaterial<Arc<KmsUnwrapInfo>>>
        for KmsUnwrapKeyMaterial {
        UpcastObjectFn!(dyn UnwrapMaterial<Arc<KmsUnwrapInfo>>);
    }

    impl ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for KmsUnwrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for KmsUnwrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for KmsUnwrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(823,5)
        fn Invoke(&self, input: &Arc<UnwrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_CiphertextType(input.wrappedMaterial()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Ciphertext length invalid")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>>());
                return res.read();
            };
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::StringifyEncryptionContext(input.encryptionContext());
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>>());
                return res.read();
            };
            let mut stringifiedEncCtx: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = valueOrError1.Extract();
            let mut decryptRequest: Arc<DecryptRequest> = Arc::new(DecryptRequest::DecryptRequest {
                        CiphertextBlob: input.wrappedMaterial().clone(),
                        EncryptionContext: Arc::new(Option::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>::Some {
                                    value: stringifiedEncCtx.clone()
                                }),
                        GrantTokens: Arc::new(Option::<GrantTokenList>::Some {
                                    value: self.grantTokens().clone()
                                }),
                        KeyId: Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                    value: self.awsKmsKey().clone()
                                }),
                        EncryptionAlgorithm: Arc::new(Option::<Arc<EncryptionAlgorithmSpec>>::None {}),
                        Recipient: Arc::new(Option::<Arc<RecipientInfo>>::None {}),
                        DryRun: Arc::new(Option::<bool>::None {})
                    });
            let mut maybeDecryptResponse: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = IKMSClient::Decrypt(rd!(self.client().clone()), &decryptRequest);
            maybeDecryptResponse = _out0.clone();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeDecryptResponse.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::ComAmazonawsKms {
                                        ComAmazonawsKms: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>>());
                return res.read();
            };
            let mut decryptResponse: Arc<DecryptResponse> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(decryptResponse.KeyId().as_ref(), Some{ .. }) && decryptResponse.KeyId().value().clone() == self.awsKmsKey().clone() && matches!(decryptResponse.Plaintext().as_ref(), Some{ .. }) && crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite()) as u64 == truncate!(decryptResponse.Plaintext().value().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from KMS Decrypt")
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>>());
                return res.read();
            };
            let mut output: Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>> = Arc::new(UnwrapOutput::<Arc<KmsUnwrapInfo>>::UnwrapOutput {
                        unwrappedMaterial: decryptResponse.Plaintext().value().clone(),
                        unwrapInfo: Arc::new(KmsUnwrapInfo::KmsUnwrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for KmsUnwrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<KmsUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(867,3)
    pub struct KmsGenerateAndWrapKeyMaterial {
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>,
        pub __i_grantTokens: GrantTokenList
    }

    impl KmsGenerateAndWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(874,5)
        pub fn _ctor(this: &Object<KmsGenerateAndWrapKeyMaterial>, client: &Object<dyn IKMSClient>, awsKmsKey: &Sequence<DafnyCharUTF16>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_client: bool = false;
            let mut _set___i_awsKmsKey: bool = false;
            let mut _set___i_grantTokens: bool = false;
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(870,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(871,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(872,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for KmsGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl GenerateAndWrapMaterial<Arc<KmsWrapInfo>>
        for KmsGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn GenerateAndWrapMaterial<Arc<KmsWrapInfo>>>
        for KmsGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn GenerateAndWrapMaterial<Arc<KmsWrapInfo>>);
    }

    impl ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for KmsGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for KmsGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for KmsGenerateAndWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(938,5)
        fn Invoke(&self, input: &Arc<GenerateAndWrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.algorithmSuite().clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::StringifyEncryptionContext(input.encryptionContext());
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut stringifiedEncCtx: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = valueOrError0.Extract();
            let mut generatorRequest: Arc<GenerateDataKeyRequest> = Arc::new(GenerateDataKeyRequest::GenerateDataKeyRequest {
                        KeyId: self.awsKmsKey().clone(),
                        EncryptionContext: Arc::new(Option::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>::Some {
                                    value: stringifiedEncCtx.clone()
                                }),
                        NumberOfBytes: Arc::new(Option::<i32>::Some {
                                    value: crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite)
                                }),
                        KeySpec: Arc::new(Option::<Arc<DataKeySpec>>::None {}),
                        GrantTokens: Arc::new(Option::<GrantTokenList>::Some {
                                    value: self.grantTokens().clone()
                                }),
                        Recipient: Arc::new(Option::<Arc<RecipientInfo>>::None {}),
                        DryRun: Arc::new(Option::<bool>::None {})
                    });
            let mut maybeGenerateResponse: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateDataKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateDataKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = IKMSClient::GenerateDataKey(rd!(self.client().clone()), &generatorRequest);
            maybeGenerateResponse = _out0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateDataKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeGenerateResponse.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::ComAmazonawsKms {
                                        ComAmazonawsKms: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut generateResponse: Arc<GenerateDataKeyResponse> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(generateResponse.KeyId().as_ref(), Some{ .. }) && matches!((&crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsIdentifier(generateResponse.KeyId().value())).as_ref(), Success{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from KMS GenerateDataKey:: Invalid Key Id")
                        }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(generateResponse.Plaintext().as_ref(), Some{ .. }) && crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64 == truncate!(generateResponse.Plaintext().value().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from AWS KMS GenerateDataKey: Invalid data key")
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut valueOrError4: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(generateResponse.CiphertextBlob().as_ref(), Some{ .. }) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_CiphertextType(generateResponse.CiphertextBlob().value()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from AWS KMS GeneratedDataKey: Invalid ciphertext")
                        }));
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut valueOrError5: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(true && matches!(generateResponse.CiphertextForRecipient().as_ref(), None{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from AWS KMS GeneratedDataKey: Invalid CiphertextForRecipient")
                        }));
            if valueOrError5.IsFailure() {
                res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut output: Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>> = Arc::new(GenerateAndWrapOutput::<Arc<KmsWrapInfo>>::GenerateAndWrapOutput {
                        plaintextMaterial: generateResponse.Plaintext().value().clone(),
                        wrappedMaterial: generateResponse.CiphertextBlob().value().clone(),
                        wrapInfo: Arc::new(KmsWrapInfo::KmsWrapInfo {
                                    kmsKeyArn: generateResponse.KeyId().value().clone()
                                })
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for KmsGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1014,3)
    pub struct KmsWrapKeyMaterial {
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>,
        pub __i_grantTokens: GrantTokenList
    }

    impl KmsWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1021,5)
        pub fn _ctor(this: &Object<KmsWrapKeyMaterial>, client: &Object<dyn IKMSClient>, awsKmsKey: &Sequence<DafnyCharUTF16>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_client: bool = false;
            let mut _set___i_awsKmsKey: bool = false;
            let mut _set___i_grantTokens: bool = false;
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1017,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1018,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1019,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for KmsWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl WrapMaterial<Arc<KmsWrapInfo>>
        for KmsWrapKeyMaterial {}

    impl UpcastObject<dyn WrapMaterial<Arc<KmsWrapInfo>>>
        for KmsWrapKeyMaterial {
        UpcastObjectFn!(dyn WrapMaterial<Arc<KmsWrapInfo>>);
    }

    impl ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for KmsWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for KmsWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for KmsWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsKeyring.dfy(1080,5)
        fn Invoke(&self, input: &Arc<WrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.algorithmSuite().clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::StringifyEncryptionContext(input.encryptionContext());
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<WrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut stringifiedEncCtx: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_PlaintextType(input.plaintextMaterial()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid Plaintext on KMS Encrypt")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<WrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut encryptRequest: Arc<EncryptRequest> = Arc::new(EncryptRequest::EncryptRequest {
                        KeyId: self.awsKmsKey().clone(),
                        Plaintext: input.plaintextMaterial().clone(),
                        EncryptionContext: Arc::new(Option::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>::Some {
                                    value: stringifiedEncCtx.clone()
                                }),
                        GrantTokens: Arc::new(Option::<GrantTokenList>::Some {
                                    value: self.grantTokens().clone()
                                }),
                        EncryptionAlgorithm: Arc::new(Option::<Arc<EncryptionAlgorithmSpec>>::None {}),
                        DryRun: Arc::new(Option::<bool>::None {})
                    });
            let mut maybeEncryptResponse: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = IKMSClient::Encrypt(rd!(self.client().clone()), &encryptRequest);
            maybeEncryptResponse = _out0.clone();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeEncryptResponse.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::ComAmazonawsKms {
                                        ComAmazonawsKms: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<WrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut encryptResponse: Arc<EncryptResponse> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(encryptResponse.KeyId().as_ref(), Some{ .. }) && matches!((&crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsIdentifier(encryptResponse.KeyId().value())).as_ref(), Success{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from AWS KMS Encrypt:: Invalid Key Id")
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<WrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut valueOrError4: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(encryptResponse.CiphertextBlob().as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from AWS KMS Encrypt: Invalid Ciphertext Blob")
                        }));
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<WrapOutput<Arc<KmsWrapInfo>>>>());
                return res.read();
            };
            let mut output: Arc<WrapOutput<Arc<KmsWrapInfo>>> = Arc::new(WrapOutput::<Arc<KmsWrapInfo>>::WrapOutput {
                        wrappedMaterial: encryptResponse.CiphertextBlob().value().clone(),
                        wrapInfo: Arc::new(KmsWrapInfo::KmsWrapInfo {
                                    kmsKeyArn: encryptResponse.KeyId().value().clone()
                                })
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<WrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for KmsWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkAreUnique.dfy(7,1)
pub mod _AwsKmsMrkAreUnique_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::SetBuilder;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier::AwsKmsArnIdentifier;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsResource;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkAreUnique.dfy(19,3)
        pub fn AwsKmsMrkAreUnique(identifiers: &Sequence<Arc<AwsKmsIdentifier>>) -> Arc<Outcome<Arc<Error>>> {
            let mut mrks: Sequence<Arc<AwsKmsIdentifier>> = crate::implementation_from_dafny::_Seq_Compile::_default::Filter::<Arc<AwsKmsIdentifier>>(&(Arc::new(move |x0: &Arc<AwsKmsIdentifier>| crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsMultiRegionAwsKmsIdentifier(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>), identifiers);
            if truncate!(mrks.cardinality(), u64) == 0 {
                Arc::new(Outcome::<Arc<Error>>::Pass {})
            } else {
                let mut mrkKeyIds: Sequence<Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_Seq_Compile::_default::Map::<Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>(&(Arc::new(move |x0: &Arc<AwsKmsIdentifier>| _default::GetKeyId(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>), &mrks);
                let mut setMrks: Set<Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_Seq_Compile::_default::ToSet::<Sequence<DafnyCharUTF16>>(&mrkKeyIds);
                if truncate!(mrkKeyIds.cardinality(), u64) == truncate!(setMrks.cardinality(), u64) {
                    Arc::new(Outcome::<Arc<Error>>::Pass {})
                } else {
                    let mut duplicateMrkIds: Set<Sequence<DafnyCharUTF16>> = (&({
                            let mut mrkKeyIds = mrkKeyIds.clone();
                            Arc::new(move || -> Set<Sequence<DafnyCharUTF16>>{
                                    let mut _coll0: SetBuilder<Sequence<DafnyCharUTF16>> = SetBuilder::<Sequence<DafnyCharUTF16>>::new();
                                    for __compr_0 in (&mrkKeyIds).iter() {
                                        let mut x: Sequence<DafnyCharUTF16> = __compr_0.clone();
                                        if mrkKeyIds.contains(&x) && mrkKeyIds.as_dafny_multiset().get(&((&x)/*<i>Coercion from ::dafny_runtime::Sequence<::dafny_runtime::DafnyCharUTF16> to ::dafny_runtime::DafnyInt</i> not yet implemented*/)) >= int!(1) {
                                            _coll0.add(&x)
                                        }
                                    }
                                    _coll0.build()
                                })
                        }))();
                    let mut isDuplicate: Arc<dyn ::std::ops::Fn(&Arc<AwsKmsIdentifier>) -> bool + Sync + Send> = {
                            let duplicateMrkIds: Set<Sequence<DafnyCharUTF16>> = duplicateMrkIds.clone();
                            {
                                let mut duplicateMrkIds = duplicateMrkIds.clone();
                                Arc::new(move |identifier: &Arc<AwsKmsIdentifier>| -> bool{
                                        duplicateMrkIds.contains(&_default::GetKeyId(identifier))
                                    })
                            }
                        };
                    let mut identifierToString: Arc<dyn ::std::ops::Fn(&Arc<AwsKmsIdentifier>) -> Sequence<DafnyCharUTF16> + Sync + Send> = {
                            Arc::new(move |i: &Arc<AwsKmsIdentifier>| -> Sequence<DafnyCharUTF16>{
                                    i.ToString()
                                })
                        };
                    let mut duplicateIdentifiers: Sequence<Arc<AwsKmsIdentifier>> = crate::implementation_from_dafny::_Seq_Compile::_default::Filter::<Arc<AwsKmsIdentifier>>(&isDuplicate, identifiers);
                    let mut duplicates: Sequence<Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_Seq_Compile::_default::Map::<Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>(&identifierToString, &duplicateIdentifiers);
                    if truncate!(duplicates.cardinality(), u64) == 0 {
                        Arc::new(Outcome::<Arc<Error>>::Fail {
                                error: Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                            message: string_utf16_of("Impossible")
                                        })
                            })
                    } else {
                        Arc::new(Outcome::<Arc<Error>>::Fail {
                                error: Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                            message: string_utf16_of("Related multi-Region keys: ").concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Join::<DafnyCharUTF16>(&duplicates, &string_utf16_of(","))).concat(&string_utf16_of("are not allowed."))
                                        })
                            })
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkAreUnique.dfy(54,3)
        pub fn GetKeyId(identifier: &Arc<AwsKmsIdentifier>) -> Sequence<DafnyCharUTF16> {
            let mut _source0: Arc<AwsKmsIdentifier> = identifier.clone();
            if matches!((&_source0).as_ref(), AwsKmsArnIdentifier{ .. }) {
                let mut ___mcc_h0: AwsKmsArn = _source0.a().clone();
                let mut a: AwsKmsArn = ___mcc_h0.clone();
                a.resource().value().clone()
            } else {
                let mut ___mcc_h1: AwsKmsResource = _source0.r().clone();
                let mut i: AwsKmsResource = ___mcc_h1.clone();
                i.value().clone()
            }
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(15,1)
pub mod _AwsKmsMrkDiscoveryKeyring_Compile {
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsArn;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Constants_Compile::AwsKmsEdkHelper;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicAction;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::KmsUnwrapKeyMaterial;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::KmsUnwrapInfo;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(558,3)
        pub fn ToStringForRegion(arn: &AwsKmsArn, region: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            if crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsMultiRegionAwsKmsArn(arn) {
                AwsArn::ToArnString(arn, &Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                            value: region.clone()
                        }))
            } else {
                AwsArn::ToString(arn)
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(581,3)
        pub fn DiscoveryMatch(arn: &AwsKmsArn, discoveryFilter: &Arc<Option<Arc<DiscoveryFilter>>>, region: &Sequence<DafnyCharUTF16>) -> bool {
            (&({
                let mut arn = arn.clone();
                Arc::new(move |_source0: &Arc<Option<Arc<DiscoveryFilter>>>| -> bool{
                        if matches!(_source0.as_ref(), None{ .. }) {
                            true
                        } else {
                            let mut ___mcc_h0: Arc<DiscoveryFilter> = _source0.value().clone();
                            let mut filter: Arc<DiscoveryFilter> = ___mcc_h0.clone();
                            filter.partition().clone() == arn.partition().clone() && filter.accountIds().contains(arn.account())
                        }
                    })
            }))(discoveryFilter) && (if !crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsMultiRegionAwsKmsArn(arn) {
                    region.clone() == arn.region().clone()
                } else {
                    true
                })
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(36,3)
    pub struct AwsKmsMrkDiscoveryKeyring {
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_region: Sequence<DafnyCharUTF16>,
        pub __i_discoveryFilter: Arc<Option<Arc<DiscoveryFilter>>>,
        pub __i_grantTokens: GrantTokenList
    }

    impl AwsKmsMrkDiscoveryKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(60,5)
        pub fn _ctor(this: &Object<AwsKmsMrkDiscoveryKeyring>, client: &Object<dyn IKMSClient>, region: &Sequence<DafnyCharUTF16>, discoveryFilter: &Arc<Option<Arc<DiscoveryFilter>>>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_client: bool = false;
            let mut _set___i_region: bool = false;
            let mut _set___i_discoveryFilter: bool = false;
            let mut _set___i_grantTokens: bool = false;
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_region, _set___i_region, region.clone());
            update_field_uninit_object!(this.clone(), __i_discoveryFilter, _set___i_discoveryFilter, discoveryFilter.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(43,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(46,5)
        pub fn region(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_region.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(44,5)
        pub fn discoveryFilter(&self) -> Arc<Option<Arc<DiscoveryFilter>>> {
            self.__i_discoveryFilter.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(45,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsMrkDiscoveryKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for AwsKmsMrkDiscoveryKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for AwsKmsMrkDiscoveryKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for AwsKmsMrkDiscoveryKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(111,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>> {
            let mut output: Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>> = Arc::new(Result::<Arc<OnEncryptOutput>, Arc<Error>>::Failure {
                        error: Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Encryption is not supported with a Discovery Keyring.")
                                })
                    });
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(154,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>>>::new();
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut encryptedDataKeys: Sequence<Arc<EncryptedDataKey>> = input.encryptedDataKeys().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(&materials), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut edkFilterTransform: Object<AwsKmsEncryptedDataKeyFilterTransform>;
            let mut _nw0: Object<AwsKmsEncryptedDataKeyFilterTransform> = AwsKmsEncryptedDataKeyFilterTransform::_allocate_object();
            AwsKmsEncryptedDataKeyFilterTransform::_ctor(&_nw0, &self.region().clone(), &self.discoveryFilter().clone());
            edkFilterTransform = _nw0.clone();
            let mut valueOrError1: Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>;
            let mut _out0: Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>> = crate::implementation_from_dafny::_Actions_Compile::_default::DeterministicFlatMapWithResult::<Arc<EncryptedDataKey>, Arc<AwsKmsEdkHelper>, Arc<Error>>(&upcast_object::<AwsKmsEncryptedDataKeyFilterTransform, dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>()(edkFilterTransform.clone()), &encryptedDataKeys);
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut edksToAttempt: Sequence<Arc<AwsKmsEdkHelper>> = valueOrError1.Extract();
            if 0 == truncate!(edksToAttempt.cardinality(), u64) {
                let mut valueOrError2: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of(""));
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnDecryptOutput>>());
                    return output.read();
                };
                let mut errorMessage: Sequence<DafnyCharUTF16> = valueOrError2.Extract();
                output = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Failure {
                                error: Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                            message: errorMessage.clone()
                                        })
                            }));
                return output.read();
            };
            let mut decryptAction: Object<AwsKmsEncryptedDataKeyDecryptor>;
            let mut _nw1: Object<AwsKmsEncryptedDataKeyDecryptor> = AwsKmsEncryptedDataKeyDecryptor::_allocate_object();
            AwsKmsEncryptedDataKeyDecryptor::_ctor(&_nw1, &materials, &self.client().clone(), &self.region().clone(), &self.grantTokens().clone());
            decryptAction = _nw1.clone();
            let mut outcome: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<Error>>>>;
            let mut _out1: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<Error>>>> = crate::implementation_from_dafny::_Actions_Compile::_default::ReduceToSuccess::<Arc<AwsKmsEdkHelper>, SealedDecryptionMaterials, Arc<Error>>(&upcast_object::<AwsKmsEncryptedDataKeyDecryptor, dyn ActionWithResult<Arc<AwsKmsEdkHelper>, SealedDecryptionMaterials, Arc<Error>>>()(decryptAction.clone()), &edksToAttempt);
            outcome = _out1.clone();
            let mut _source0: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<Error>>>> = outcome.clone();
            if matches!((&_source0).as_ref(), Success{ .. }) {
                let mut ___mcc_h0: SealedDecryptionMaterials = _source0.value().clone();
                let mut mat: SealedDecryptionMaterials = ___mcc_h0.clone();
                output = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Success {
                                value: Arc::new(OnDecryptOutput::OnDecryptOutput {
                                            materials: mat.clone()
                                        })
                            }));
            } else {
                let mut ___mcc_h1: Sequence<Arc<Error>> = _source0.error().clone();
                let mut errors: Sequence<Arc<Error>> = ___mcc_h1.clone();
                output = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Failure {
                                error: Arc::new(Error::CollectionOfErrors {
                                            list: errors.clone(),
                                            message: string_utf16_of("No Configured KMS Key was able to decrypt the Data Key. The list of encountered Exceptions is available via `list`.")
                                        })
                            }));
            };
            return output.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for AwsKmsMrkDiscoveryKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(348,3)
    pub struct AwsKmsEncryptedDataKeyFilterTransform {
        pub __i_region: Sequence<DafnyCharUTF16>,
        pub __i_discoveryFilter: Arc<Option<Arc<DiscoveryFilter>>>
    }

    impl AwsKmsEncryptedDataKeyFilterTransform {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(357,5)
        pub fn _ctor(this: &Object<AwsKmsEncryptedDataKeyFilterTransform>, region: &Sequence<DafnyCharUTF16>, discoveryFilter: &Arc<Option<Arc<DiscoveryFilter>>>) -> () {
            let mut _set___i_region: bool = false;
            let mut _set___i_discoveryFilter: bool = false;
            update_field_uninit_object!(this.clone(), __i_region, _set___i_region, region.clone());
            update_field_uninit_object!(this.clone(), __i_discoveryFilter, _set___i_discoveryFilter, discoveryFilter.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(355,5)
        pub fn region(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_region.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(356,5)
        pub fn discoveryFilter(&self) -> Arc<Option<Arc<DiscoveryFilter>>> {
            self.__i_discoveryFilter.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsEncryptedDataKeyFilterTransform {
        UpcastObjectFn!(DynAny);
    }

    impl DeterministicActionWithResult<Arc<EncryptedDataKey>, Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>
        for AwsKmsEncryptedDataKeyFilterTransform {}

    impl UpcastObject<dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>
        for AwsKmsEncryptedDataKeyFilterTransform {
        UpcastObjectFn!(dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>);
    }

    impl DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>>
        for AwsKmsEncryptedDataKeyFilterTransform {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(389,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>>::new();
            if edk.keyProviderId().clone() != crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID() {
                res = MaybePlacebo::from(Arc::new(Result::<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>::Success {
                                value: seq![] as Sequence<Arc<AwsKmsEdkHelper>>
                            }));
                return res.read();
            };
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderInfo()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid AWS KMS encoding, provider info is not UTF8.")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<Arc<AwsKmsEdkHelper>>>());
                return res.read();
            };
            let mut valueOrError1: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(edk.keyProviderInfo()).MapFailure::<Arc<Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                        message: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<Arc<AwsKmsEdkHelper>>>());
                return res.read();
            };
            let mut keyId: Sequence<DafnyCharUTF16> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<AwsKmsArn, Arc<Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(&keyId).MapFailure::<Arc<Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                        message: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Sequence<Arc<AwsKmsEdkHelper>>>());
                return res.read();
            };
            let mut arn: Arc<AwsArn> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(arn.resource().resourceType().clone() == string_utf16_of("key"), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Only AWS KMS Keys supported")
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Sequence<Arc<AwsKmsEdkHelper>>>());
                return res.read();
            };
            if !_default::DiscoveryMatch(&arn, &self.discoveryFilter().clone(), &self.region().clone()) {
                res = MaybePlacebo::from(Arc::new(Result::<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>::Success {
                                value: seq![] as Sequence<Arc<AwsKmsEdkHelper>>
                            }));
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>::Success {
                            value: seq![Arc::new(AwsKmsEdkHelper::AwsKmsEdkHelper {
                                            edk: edk.clone(),
                                            arn: arn.clone()
                                        })]
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>>>
        for AwsKmsEncryptedDataKeyFilterTransform {
        UpcastObjectFn!(dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<Sequence<Arc<AwsKmsEdkHelper>>, Arc<Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(430,3)
    pub struct AwsKmsEncryptedDataKeyDecryptor {
        pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey,
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_region: Sequence<DafnyCharUTF16>,
        pub __i_grantTokens: GrantTokenList
    }

    impl AwsKmsEncryptedDataKeyDecryptor {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(441,5)
        pub fn _ctor(this: &Object<AwsKmsEncryptedDataKeyDecryptor>, materials: &DecryptionMaterialsPendingPlaintextDataKey, client: &Object<dyn IKMSClient>, region: &Sequence<DafnyCharUTF16>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_materials: bool = false;
            let mut _set___i_client: bool = false;
            let mut _set___i_region: bool = false;
            let mut _set___i_grantTokens: bool = false;
            update_field_uninit_object!(this.clone(), __i_materials, _set___i_materials, materials.clone());
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_region, _set___i_region, region.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(436,5)
        pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey {
            self.__i_materials.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(437,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(438,5)
        pub fn region(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_region.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(439,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsEncryptedDataKeyDecryptor {
        UpcastObjectFn!(DynAny);
    }

    impl ActionWithResult<Arc<AwsKmsEdkHelper>, SealedDecryptionMaterials, Arc<Error>>
        for AwsKmsEncryptedDataKeyDecryptor {}

    impl UpcastObject<dyn ActionWithResult<Arc<AwsKmsEdkHelper>, SealedDecryptionMaterials, Arc<Error>>>
        for AwsKmsEncryptedDataKeyDecryptor {
        UpcastObjectFn!(dyn ActionWithResult<Arc<AwsKmsEdkHelper>, SealedDecryptionMaterials, Arc<Error>>);
    }

    impl Action<Arc<AwsKmsEdkHelper>, Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>
        for AwsKmsEncryptedDataKeyDecryptor {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkDiscoveryKeyring.dfy(522,5)
        fn Invoke(&self, helper: &Arc<AwsKmsEdkHelper>) -> Arc<Result<SealedDecryptionMaterials, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>::new();
            let mut awsKmsKey: Sequence<DafnyCharUTF16> = _default::ToStringForRegion(helper.arn(), &self.region().clone());
            let mut valueOrError0: Arc<Result<(), Arc<Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::ValidateKmsKeyId(&awsKmsKey);
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut _v0: () = valueOrError0.Extract();
            let mut kmsUnwrap: Object<KmsUnwrapKeyMaterial>;
            let mut _nw0: Object<KmsUnwrapKeyMaterial> = KmsUnwrapKeyMaterial::_allocate_object();
            KmsUnwrapKeyMaterial::_ctor(&_nw0, &self.client().clone(), &awsKmsKey, &self.grantTokens().clone());
            kmsUnwrap = _nw0.clone();
            let mut unwrapOutputRes: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<Error>>>;
            let mut _out0: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::<Arc<KmsUnwrapInfo>>(helper.edk().ciphertext(), &self.materials().clone(), &upcast_object::<KmsUnwrapKeyMaterial, dyn UnwrapMaterial<Arc<KmsUnwrapInfo>>>()(kmsUnwrap.clone()));
            unwrapOutputRes = _out0.clone();
            let mut valueOrError1: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<Error>>> = unwrapOutputRes.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut unwrapOutput: Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>> = valueOrError1.Extract();
            res = MaybePlacebo::from(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey()));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<AwsKmsEdkHelper>, Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>>
        for AwsKmsEncryptedDataKeyDecryptor {
        UpcastObjectFn!(dyn Action<Arc<AwsKmsEdkHelper>, Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(16,1)
pub mod _AwsKmsMrkKeyring_Compile {
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::KmsGenerateAndWrapKeyMaterial;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::KmsWrapKeyMaterial;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::KmsWrapInfo;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::_AwsKmsUtils_Compile::OnDecryptMrkAwareEncryptedDataKeyFilter;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult;
    pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::KmsUnwrapKeyMaterial;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::KmsUnwrapInfo;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(40,3)
    pub struct AwsKmsMrkKeyring {
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>,
        pub __i_grantTokens: GrantTokenList,
        pub __i_awsKmsArn: Arc<AwsKmsIdentifier>
    }

    impl AwsKmsMrkKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// = aws-encryption-sdk-specification/framework/aws-kms/aws-kms-mrk-keyring.md#initialization
        /// = type=implication
        /// # The AWS KMS key identifier MUST NOT be null or empty.
        /// # The AWS KMS
        /// # key identifier MUST be [a valid identifier](aws-kms-key-arn.md#a-
        /// # valid-aws-kms-identifier).
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(58,5)
        pub fn _ctor(this: &Object<AwsKmsMrkKeyring>, client: &Object<dyn IKMSClient>, awsKmsKey: &Sequence<DafnyCharUTF16>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_client: bool = false;
            let mut _set___i_awsKmsKey: bool = false;
            let mut _set___i_grantTokens: bool = false;
            let mut _set___i_awsKmsArn: bool = false;
            let mut parsedAwsKmsId: Arc<Result<Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsIdentifier(awsKmsKey);
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsArn, _set___i_awsKmsArn, parsedAwsKmsId.value().clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(44,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(45,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(47,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(46,5)
        pub fn awsKmsArn(&self) -> Arc<AwsKmsIdentifier> {
            self.__i_awsKmsArn.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsMrkKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for AwsKmsMrkKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for AwsKmsMrkKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for AwsKmsMrkKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(119,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>>>::new();
            let mut materials: Arc<EncryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError0: Arc<Result<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::StringifyEncryptionContext(input.materials().encryptionContext());
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnEncryptOutput>>());
                return output.read();
            };
            let mut stringifiedEncCtx: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = valueOrError0.Extract();
            let mut kmsGenerateAndWrap: Object<KmsGenerateAndWrapKeyMaterial>;
            let mut _nw0: Object<KmsGenerateAndWrapKeyMaterial> = KmsGenerateAndWrapKeyMaterial::_allocate_object();
            KmsGenerateAndWrapKeyMaterial::_ctor(&_nw0, &self.client().clone(), &self.awsKmsKey().clone(), &self.grantTokens().clone());
            kmsGenerateAndWrap = _nw0.clone();
            let mut kmsWrap: Object<KmsWrapKeyMaterial>;
            let mut _nw1: Object<KmsWrapKeyMaterial> = KmsWrapKeyMaterial::_allocate_object();
            KmsWrapKeyMaterial::_ctor(&_nw1, &self.client().clone(), &self.awsKmsKey().clone(), &self.grantTokens().clone());
            kmsWrap = _nw1.clone();
            let mut valueOrError1: Arc<Result<Arc<WrapEdkMaterialOutput<Arc<KmsWrapInfo>>>, Arc<Error>>>;
            let mut _out0: Arc<Result<Arc<WrapEdkMaterialOutput<Arc<KmsWrapInfo>>>, Arc<Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::WrapEdkMaterial::<Arc<KmsWrapInfo>>(&materials, &upcast_object::<KmsWrapKeyMaterial, dyn WrapMaterial<Arc<KmsWrapInfo>>>()(kmsWrap.clone()), &upcast_object::<KmsGenerateAndWrapKeyMaterial, dyn GenerateAndWrapMaterial<Arc<KmsWrapInfo>>>()(kmsGenerateAndWrap.clone()));
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnEncryptOutput>>());
                return output.read();
            };
            let mut wrapOutput: Arc<WrapEdkMaterialOutput<Arc<KmsWrapInfo>>> = valueOrError1.Extract();
            let mut kmsKeyArn: Sequence<DafnyCharUTF16> = wrapOutput.wrapInfo().kmsKeyArn().clone();
            let mut symmetricSigningKeyList: Arc<Option<Sequence<Sequence<u8>>>>;
            if matches!(wrapOutput.symmetricSigningKey().as_ref(), Some{ .. }) {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                            value: seq![wrapOutput.symmetricSigningKey().value().clone()]
                        });
            } else {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::None {});
            };
            let mut valueOrError2: Arc<Result<ValidUTF8Bytes, Arc<Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&kmsKeyArn).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnEncryptOutput>>());
                return output.read();
            };
            let mut providerInfo: ValidUTF8Bytes = valueOrError2.Extract();
            let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(providerInfo.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from AWS KMS GenerateDataKey: Key ID too long.")
                        }));
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnEncryptOutput>>());
                return output.read();
            };
            let mut edk: Arc<EncryptedDataKey> = Arc::new(EncryptedDataKey::EncryptedDataKey {
                        keyProviderId: crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID(),
                        keyProviderInfo: providerInfo.clone(),
                        ciphertext: wrapOutput.wrappedMaterial().clone()
                    });
            if matches!((&wrapOutput).as_ref(), GenerateAndWrapEdkMaterialOutput{ .. }) {
                let mut valueOrError4: Arc<Result<Arc<EncryptionMaterials>, Arc<Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddDataKey(&materials, wrapOutput.plaintextDataKey(), &seq![edk.clone()], &symmetricSigningKeyList);
                if valueOrError4.IsFailure() {
                    output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return output.read();
                };
                let mut result: Arc<EncryptionMaterials> = valueOrError4.Extract();
                output = MaybePlacebo::from(Arc::new(Result::<Arc<OnEncryptOutput>, Arc<Error>>::Success {
                                value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                            materials: result.clone()
                                        })
                            }));
                return output.read();
            } else {
                if matches!((&wrapOutput).as_ref(), WrapOnlyEdkMaterialOutput{ .. }) {
                    let mut valueOrError5: Arc<Result<Arc<EncryptionMaterials>, Arc<Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddEncryptedDataKeys(&materials, &seq![edk.clone()], &symmetricSigningKeyList);
                    if valueOrError5.IsFailure() {
                        output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return output.read();
                    };
                    let mut result: Arc<EncryptionMaterials> = valueOrError5.Extract();
                    output = MaybePlacebo::from(Arc::new(Result::<Arc<OnEncryptOutput>, Arc<Error>>::Success {
                                    value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                                materials: result.clone()
                                            })
                                }));
                    return output.read();
                }
            };
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(432,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>>>::new();
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(&materials), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::OkForDecrypt(&self.awsKmsArn().clone(), &self.awsKmsKey().clone());
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut filter: Object<OnDecryptMrkAwareEncryptedDataKeyFilter>;
            let mut _nw0: Object<OnDecryptMrkAwareEncryptedDataKeyFilter> = OnDecryptMrkAwareEncryptedDataKeyFilter::_allocate_object();
            OnDecryptMrkAwareEncryptedDataKeyFilter::_ctor(&_nw0, &self.awsKmsArn().clone(), &crate::implementation_from_dafny::_Constants_Compile::_default::PROVIDER_ID());
            filter = _nw0.clone();
            let mut valueOrError2: Arc<Result<Sequence<Arc<EncryptedDataKey>>, Arc<Error>>>;
            let mut _out0: Arc<Result<Sequence<Arc<EncryptedDataKey>>, Arc<Error>>> = crate::implementation_from_dafny::_Actions_Compile::_default::FilterWithResult::<Arc<EncryptedDataKey>, Arc<Error>>(&upcast_object::<OnDecryptMrkAwareEncryptedDataKeyFilter, dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<Error>>>()(filter.clone()), input.encryptedDataKeys());
            valueOrError2 = _out0.clone();
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut edksToAttempt: Sequence<Arc<EncryptedDataKey>> = valueOrError2.Extract();
            if 0 == truncate!(edksToAttempt.cardinality(), u64) {
                let mut valueOrError3: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of(""));
                if valueOrError3.IsFailure() {
                    output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnDecryptOutput>>());
                    return output.read();
                };
                let mut errorMessage: Sequence<DafnyCharUTF16> = valueOrError3.Extract();
                output = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Failure {
                                error: Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                            message: errorMessage.clone()
                                        })
                            }));
                return output.read();
            };
            let mut decryptClosure: Object<DecryptSingleEncryptedDataKey>;
            let mut _nw1: Object<DecryptSingleEncryptedDataKey> = DecryptSingleEncryptedDataKey::_allocate_object();
            DecryptSingleEncryptedDataKey::_ctor(&_nw1, &materials, &self.client().clone(), &self.awsKmsKey().clone(), &self.grantTokens().clone());
            decryptClosure = _nw1.clone();
            let mut outcome: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<Error>>>>;
            let mut _out1: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<Error>>>> = crate::implementation_from_dafny::_Actions_Compile::_default::ReduceToSuccess::<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<Error>>(&upcast_object::<DecryptSingleEncryptedDataKey, dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<Error>>>()(decryptClosure.clone()), &edksToAttempt);
            outcome = _out1.clone();
            let mut valueOrError4: Arc<Result<SealedDecryptionMaterials, Arc<Error>>> = outcome.MapFailure::<Arc<Error>>(&({
                        Arc::new(move |errors: &Sequence<Arc<Error>>| -> Arc<Error>{
                                Arc::new(Error::CollectionOfErrors {
                                        list: errors.clone(),
                                        message: string_utf16_of("No Configured KMS Key was able to decrypt the Data Key. The list of encountered Exceptions is available via `list`.")
                                    })
                            })
                    }));
            if valueOrError4.IsFailure() {
                output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut SealedDecryptionMaterials: SealedDecryptionMaterials = valueOrError4.Extract();
            output = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Success {
                            value: Arc::new(OnDecryptOutput::OnDecryptOutput {
                                        materials: SealedDecryptionMaterials.clone()
                                    })
                        }));
            return output.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for AwsKmsMrkKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(568,3)
    pub struct DecryptSingleEncryptedDataKey {
        pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey,
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>,
        pub __i_grantTokens: GrantTokenList
    }

    impl DecryptSingleEncryptedDataKey {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(579,5)
        pub fn _ctor(this: &Object<DecryptSingleEncryptedDataKey>, materials: &DecryptionMaterialsPendingPlaintextDataKey, client: &Object<dyn IKMSClient>, awsKmsKey: &Sequence<DafnyCharUTF16>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_materials: bool = false;
            let mut _set___i_client: bool = false;
            let mut _set___i_awsKmsKey: bool = false;
            let mut _set___i_grantTokens: bool = false;
            update_field_uninit_object!(this.clone(), __i_materials, _set___i_materials, materials.clone());
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(574,5)
        pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey {
            self.__i_materials.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(575,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(576,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(577,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(DynAny);
    }

    impl ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<Error>>
        for DecryptSingleEncryptedDataKey {}

    impl UpcastObject<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<Error>>>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<Error>>);
    }

    impl Action<Arc<EncryptedDataKey>, Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>
        for DecryptSingleEncryptedDataKey {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkKeyring.dfy(648,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<Result<SealedDecryptionMaterials, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>::new();
            let mut kmsUnwrap: Object<KmsUnwrapKeyMaterial>;
            let mut _nw0: Object<KmsUnwrapKeyMaterial> = KmsUnwrapKeyMaterial::_allocate_object();
            KmsUnwrapKeyMaterial::_ctor(&_nw0, &self.client().clone(), &self.awsKmsKey().clone(), &self.grantTokens().clone());
            kmsUnwrap = _nw0.clone();
            let mut unwrapOutputRes: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<Error>>>;
            let mut _out0: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::<Arc<KmsUnwrapInfo>>(edk.ciphertext(), &self.materials().clone(), &upcast_object::<KmsUnwrapKeyMaterial, dyn UnwrapMaterial<Arc<KmsUnwrapInfo>>>()(kmsUnwrap.clone()));
            unwrapOutputRes = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>>, Arc<Error>>> = unwrapOutputRes.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut unwrapOutput: Arc<UnwrapEdkMaterialOutput<Arc<KmsUnwrapInfo>>> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Arc<DecryptionMaterials>, Arc<Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey());
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut result: Arc<DecryptionMaterials> = valueOrError1.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Arc<DecryptionMaterials>, Arc<Error>>::Success {
                            value: result.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<EncryptedDataKey>, Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(dyn Action<Arc<EncryptedDataKey>, Arc<Result<SealedDecryptionMaterials, Arc<Error>>>>);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkMatchForDecrypt.dfy(6,1)
pub mod _AwsKmsMrkMatchForDecrypt_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier::AwsKmsArnIdentifier;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsResource;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsMrkMatchForDecrypt.dfy(16,3)
        pub fn AwsKmsMrkMatchForDecrypt(configuredAwsKmsIdentifier: &Arc<AwsKmsIdentifier>, messageAwsKmsIdentifer: &Arc<AwsKmsIdentifier>) -> bool {
            if configuredAwsKmsIdentifier.clone() == messageAwsKmsIdentifer.clone() {
                true
            } else {
                let mut _source0: (Arc<AwsKmsIdentifier>, Arc<AwsKmsIdentifier>) = (
                        messageAwsKmsIdentifer.clone(),
                        configuredAwsKmsIdentifier.clone()
                    );
                let mut ___mcc_h0: Arc<AwsKmsIdentifier> = _source0.0.clone();
                let mut ___mcc_h1: Arc<AwsKmsIdentifier> = _source0.1.clone();
                let mut _source1: Arc<AwsKmsIdentifier> = ___mcc_h0.clone();
                if matches!((&_source1).as_ref(), AwsKmsArnIdentifier{ .. }) {
                    let mut ___mcc_h2: AwsKmsArn = _source1.a().clone();
                    let mut _source2: Arc<AwsKmsIdentifier> = ___mcc_h1.clone();
                    if matches!((&_source2).as_ref(), AwsKmsArnIdentifier{ .. }) {
                        let mut ___mcc_h4: AwsKmsArn = _source2.a().clone();
                        let mut messageAwsKmsArn: AwsKmsArn = ___mcc_h4.clone();
                        let mut configuredAwsKmsArn: AwsKmsArn = ___mcc_h2.clone();
                        if !crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsMultiRegionAwsKmsArn(&configuredAwsKmsArn) || !crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsMultiRegionAwsKmsArn(&messageAwsKmsArn) {
                            false
                        } else {
                            messageAwsKmsArn.partition().clone() == configuredAwsKmsArn.partition().clone() && messageAwsKmsArn.service().clone() == configuredAwsKmsArn.service().clone() && messageAwsKmsArn.account().clone() == configuredAwsKmsArn.account().clone() && messageAwsKmsArn.resource().clone() == configuredAwsKmsArn.resource().clone()
                        }
                    } else {
                        let mut ___mcc_h6: AwsKmsResource = _source2.r().clone();
                        false
                    }
                } else {
                    let mut ___mcc_h8: AwsKmsResource = _source1.r().clone();
                    false
                }
            }
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(17,1)
pub mod _AwsKmsRsaKeyring_Compile {
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBits;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::_AwsKmsUtils_Compile::OnDecryptMrkAwareEncryptedDataKeyFilter;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials;
    pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPaddingMode;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec::RSAES_OAEP_SHA_1;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAEncryptInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptRequest;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptResponse;
    pub use ::dafny_runtime::int;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(318,3)
        pub fn EncryptionContextDigest(cryptoPrimitives: &Object<AtomicPrimitivesClient>, encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionContext);
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut canonicalEC: Sequence<u8> = valueOrError0.Extract();
            let mut DigestInput: Arc<DigestInput> = Arc::new(DigestInput::DigestInput {
                        digestAlgorithm: Arc::new(DigestAlgorithm::SHA_384 {}),
                        message: canonicalEC.clone()
                    });
            let mut maybeDigest: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::Digest(rd!(cryptoPrimitives.clone()), &DigestInput);
            maybeDigest = _out0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeDigest.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut digest: Sequence<u8> = valueOrError1.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: digest.clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(41,3)
        pub fn MIN_KMS_RSA_KEY_LEN() -> RSAModulusLengthBits {
            2048
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(43,3)
    pub struct AwsKmsRsaKeyring {
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_client: Arc<Option<Object<dyn IKMSClient>>>,
        pub __i_paddingScheme: Arc<EncryptionAlgorithmSpec>,
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>,
        pub __i_publicKey: Arc<Option<Sequence<u8>>>,
        pub __i_awsKmsArn: Arc<AwsKmsIdentifier>,
        pub __i_grantTokens: GrantTokenList
    }

    impl AwsKmsRsaKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(77,5)
        pub fn _ctor(this: &Object<AwsKmsRsaKeyring>, publicKey: &Arc<Option<Sequence<u8>>>, awsKmsKey: &Sequence<DafnyCharUTF16>, paddingScheme: &Arc<EncryptionAlgorithmSpec>, client: &Arc<Option<Object<dyn IKMSClient>>>, cryptoPrimitives: &Object<AtomicPrimitivesClient>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_client: bool = false;
            let mut _set___i_paddingScheme: bool = false;
            let mut _set___i_awsKmsKey: bool = false;
            let mut _set___i_publicKey: bool = false;
            let mut _set___i_awsKmsArn: bool = false;
            let mut _set___i_grantTokens: bool = false;
            let mut parsedAwsKmsId: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsIdentifier(awsKmsKey);
            update_field_uninit_object!(this.clone(), __i_publicKey, _set___i_publicKey, publicKey.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsArn, _set___i_awsKmsArn, parsedAwsKmsId.value().clone());
            update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone());
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(52,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(46,5)
        pub fn client(&self) -> Arc<Option<Object<dyn IKMSClient>>> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(50,5)
        pub fn paddingScheme(&self) -> Arc<EncryptionAlgorithmSpec> {
            self.__i_paddingScheme.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(48,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(51,5)
        pub fn publicKey(&self) -> Arc<Option<Sequence<u8>>> {
            self.__i_publicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(49,5)
        pub fn awsKmsArn(&self) -> Arc<AwsKmsIdentifier> {
            self.__i_awsKmsArn.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(47,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AwsKmsRsaKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for AwsKmsRsaKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for AwsKmsRsaKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for AwsKmsRsaKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(137,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!((&self.publicKey().clone()).as_ref(), Some{ .. }) && 0 < truncate!(self.publicKey().clone().Extract().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("A AwsKmsRsaKeyring without a public key cannot provide OnEncrypt")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(input.materials().algorithmSuite().signature().as_ref(), None{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("AwsKmsRsaKeyring cannot be used with an Algorithm Suite with asymmetric signing.").concat(&string_utf16_of(" Please specify an algorithm suite without asymmetric signing."))
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut wrap: Object<KmsRsaWrapKeyMaterial>;
            let mut _nw0: Object<KmsRsaWrapKeyMaterial> = KmsRsaWrapKeyMaterial::_allocate_object();
            KmsRsaWrapKeyMaterial::_ctor(&_nw0, self.publicKey().clone().value(), &self.paddingScheme().clone(), &self.cryptoPrimitives().clone());
            wrap = _nw0.clone();
            let mut generateAndWrap: Object<KmsRsaGenerateAndWrapKeyMaterial>;
            let mut _nw1: Object<KmsRsaGenerateAndWrapKeyMaterial> = KmsRsaGenerateAndWrapKeyMaterial::_allocate_object();
            KmsRsaGenerateAndWrapKeyMaterial::_ctor(&_nw1, self.publicKey().clone().value(), &self.paddingScheme().clone(), &self.cryptoPrimitives().clone());
            generateAndWrap = _nw1.clone();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::WrapEdkMaterial::<Arc<KmsRsaWrapInfo>>(input.materials(), &upcast_object::<KmsRsaWrapKeyMaterial, dyn WrapMaterial<Arc<KmsRsaWrapInfo>>>()(wrap.clone()), &upcast_object::<KmsRsaGenerateAndWrapKeyMaterial, dyn GenerateAndWrapMaterial<Arc<KmsRsaWrapInfo>>>()(generateAndWrap.clone()));
            valueOrError2 = _out0.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut wrapOutput: Arc<WrapEdkMaterialOutput<Arc<KmsRsaWrapInfo>>> = valueOrError2.Extract();
            let mut symmetricSigningKeyList: Arc<Option<Sequence<Sequence<u8>>>>;
            if matches!(wrapOutput.symmetricSigningKey().as_ref(), Some{ .. }) {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                            value: seq![wrapOutput.symmetricSigningKey().value().clone()]
                        });
            } else {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::None {});
            };
            let mut edk: Arc<EncryptedDataKey> = Arc::new(EncryptedDataKey::EncryptedDataKey {
                        keyProviderId: crate::implementation_from_dafny::_Constants_Compile::_default::RSA_PROVIDER_ID(),
                        keyProviderInfo: crate::implementation_from_dafny::UTF8::_default::Encode(&self.awsKmsKey().clone()).value().clone(),
                        ciphertext: wrapOutput.wrappedMaterial().clone()
                    });
            let mut returnMaterials = MaybePlacebo::<Arc<EncryptionMaterials>>::new();
            if matches!((&wrapOutput).as_ref(), GenerateAndWrapEdkMaterialOutput{ .. }) {
                let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddDataKey(input.materials(), wrapOutput.plaintextDataKey(), &seq![edk.clone()], &symmetricSigningKeyList);
                if valueOrError3.IsFailure() {
                    res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return res.read();
                };
                returnMaterials = MaybePlacebo::from(valueOrError3.Extract());
            } else {
                if matches!((&wrapOutput).as_ref(), WrapOnlyEdkMaterialOutput{ .. }) {
                    let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddEncryptedDataKeys(input.materials(), &seq![edk.clone()], &symmetricSigningKeyList);
                    if valueOrError4.IsFailure() {
                        res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return res.read();
                    };
                    returnMaterials = MaybePlacebo::from(valueOrError4.Extract());
                }
            };
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                        materials: returnMaterials.read()
                                    })
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(230,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!((&self.client().clone()).as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("An AwsKmsRsaKeyring without an AWS KMS client cannot provide OnDecrypt")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(&materials), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::OkForDecrypt(&self.awsKmsArn().clone(), &self.awsKmsKey().clone());
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(input.materials().algorithmSuite().signature().as_ref(), None{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("AwsKmsRsaKeyring cannot be used with an Algorithm Suite with asymmetric signing.").concat(&string_utf16_of(" Please specify an algorithm suite without asymmetric signing."))
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut filter: Object<OnDecryptMrkAwareEncryptedDataKeyFilter>;
            let mut _nw0: Object<OnDecryptMrkAwareEncryptedDataKeyFilter> = OnDecryptMrkAwareEncryptedDataKeyFilter::_allocate_object();
            OnDecryptMrkAwareEncryptedDataKeyFilter::_ctor(&_nw0, &self.awsKmsArn().clone(), &crate::implementation_from_dafny::_Constants_Compile::_default::RSA_PROVIDER_ID());
            filter = _nw0.clone();
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Arc<EncryptedDataKey>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Arc<EncryptedDataKey>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Actions_Compile::_default::FilterWithResult::<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&upcast_object::<OnDecryptMrkAwareEncryptedDataKeyFilter, dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>()(filter.clone()), input.encryptedDataKeys());
            valueOrError4 = _out0.clone();
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut edksToAttempt: Sequence<Arc<EncryptedDataKey>> = valueOrError4.Extract();
            if 0 == truncate!(edksToAttempt.cardinality(), u64) {
                let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of(""));
                if valueOrError5.IsFailure() {
                    res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<OnDecryptOutput>>());
                    return res.read();
                };
                let mut errorMessage: Sequence<DafnyCharUTF16> = valueOrError5.Extract();
                res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: errorMessage.clone()
                                        })
                            }));
                return res.read();
            };
            let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::EncryptionContextDigest(&self.cryptoPrimitives().clone(), materials.encryptionContext());
            valueOrError6 = _out1.clone();
            if valueOrError6.IsFailure() {
                res = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut encryptionContextDigest: Sequence<u8> = valueOrError6.Extract();
            let mut decryptClosure: Object<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _nw1: Object<DecryptSingleAWSRSAEncryptedDataKey> = DecryptSingleAWSRSAEncryptedDataKey::_allocate_object();
            DecryptSingleAWSRSAEncryptedDataKey::_ctor(&_nw1, &materials, self.client().clone().value(), &self.awsKmsKey().clone(), &self.paddingScheme().clone(), &encryptionContextDigest, &self.grantTokens().clone());
            decryptClosure = upcast_object::<DecryptSingleAWSRSAEncryptedDataKey, dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>()(_nw1.clone());
            let mut outcome: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>> = crate::implementation_from_dafny::_Actions_Compile::_default::ReduceToSuccess::<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&decryptClosure, &edksToAttempt);
            outcome = _out2.clone();
            let mut valueOrError7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = outcome.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |errors: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::CollectionOfErrors {
                                        list: errors.clone(),
                                        message: string_utf16_of("No Configured KMS Key was able to decrypt the Data Key. The list of encountered Exceptions is available via `list`.")
                                    })
                            })
                    }));
            if valueOrError7.IsFailure() {
                res = MaybePlacebo::from(valueOrError7.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut SealedDecryptionMaterials: SealedDecryptionMaterials = valueOrError7.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(OnDecryptOutput::OnDecryptOutput {
                                        materials: SealedDecryptionMaterials.clone()
                                    })
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for AwsKmsRsaKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(345,3)
    pub struct DecryptSingleAWSRSAEncryptedDataKey {
        pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey,
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>,
        pub __i_paddingScheme: Arc<EncryptionAlgorithmSpec>,
        pub __i_encryptionContextDigest: Sequence<u8>,
        pub __i_grantTokens: GrantTokenList
    }

    impl DecryptSingleAWSRSAEncryptedDataKey {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(358,5)
        pub fn _ctor(this: &Object<DecryptSingleAWSRSAEncryptedDataKey>, materials: &DecryptionMaterialsPendingPlaintextDataKey, client: &Object<dyn IKMSClient>, awsKmsKey: &Sequence<DafnyCharUTF16>, paddingScheme: &Arc<EncryptionAlgorithmSpec>, encryptionContextDigest: &Sequence<u8>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_materials: bool = false;
            let mut _set___i_client: bool = false;
            let mut _set___i_awsKmsKey: bool = false;
            let mut _set___i_paddingScheme: bool = false;
            let mut _set___i_encryptionContextDigest: bool = false;
            let mut _set___i_grantTokens: bool = false;
            update_field_uninit_object!(this.clone(), __i_materials, _set___i_materials, materials.clone());
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone());
            update_field_uninit_object!(this.clone(), __i_encryptionContextDigest, _set___i_encryptionContextDigest, encryptionContextDigest.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(351,5)
        pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey {
            self.__i_materials.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(352,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(353,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(354,5)
        pub fn paddingScheme(&self) -> Arc<EncryptionAlgorithmSpec> {
            self.__i_paddingScheme.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(355,5)
        pub fn encryptionContextDigest(&self) -> Sequence<u8> {
            self.__i_encryptionContextDigest.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(356,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
    }

    impl UpcastObject<DynAny>
        for DecryptSingleAWSRSAEncryptedDataKey {
        UpcastObjectFn!(DynAny);
    }

    impl ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for DecryptSingleAWSRSAEncryptedDataKey {}

    impl UpcastObject<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for DecryptSingleAWSRSAEncryptedDataKey {
        UpcastObjectFn!(dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for DecryptSingleAWSRSAEncryptedDataKey {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(430,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut unwrap: Object<KmsRsaUnwrapKeyMaterial>;
            let mut _nw0: Object<KmsRsaUnwrapKeyMaterial> = KmsRsaUnwrapKeyMaterial::_allocate_object();
            KmsRsaUnwrapKeyMaterial::_ctor(&_nw0, &self.client().clone(), &self.awsKmsKey().clone(), &self.paddingScheme().clone(), &self.encryptionContextDigest().clone(), &self.grantTokens().clone());
            unwrap = _nw0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::<Arc<KmsRsaUnwrapInfo>>(edk.ciphertext(), &self.materials().clone(), &upcast_object::<KmsRsaUnwrapKeyMaterial, dyn UnwrapMaterial<Arc<KmsRsaUnwrapInfo>>>()(unwrap.clone()));
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut unwrapOutput: Arc<UnwrapEdkMaterialOutput<Arc<KmsRsaUnwrapInfo>>> = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey());
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut result: Arc<DecryptionMaterials> = valueOrError1.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: result.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for DecryptSingleAWSRSAEncryptedDataKey {
        UpcastObjectFn!(dyn Action<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(458,3)
    #[derive(PartialEq, Clone)]
    pub enum KmsRsaUnwrapInfo {
        KmsRsaUnwrapInfo {}
    }

    impl KmsRsaUnwrapInfo {}

    impl Debug
        for KmsRsaUnwrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for KmsRsaUnwrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                KmsRsaUnwrapInfo::KmsRsaUnwrapInfo{} => {
                    write!(_formatter, "AwsKmsRsaKeyring_Compile.KmsRsaUnwrapInfo.KmsRsaUnwrapInfo")?;
                    Ok(())
                },
            }
        }
    }

    impl KmsRsaUnwrapInfo {
        /// Enumerates all possible values of KmsRsaUnwrapInfo
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KmsRsaUnwrapInfo>> {
            seq![Arc::new(KmsRsaUnwrapInfo::KmsRsaUnwrapInfo {})].iter()
        }
    }

    impl Eq
        for KmsRsaUnwrapInfo {}

    impl Hash
        for KmsRsaUnwrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                KmsRsaUnwrapInfo::KmsRsaUnwrapInfo{} => {

                },
            }
        }
    }

    impl Default
        for KmsRsaUnwrapInfo {
        fn default() -> KmsRsaUnwrapInfo {
            KmsRsaUnwrapInfo::KmsRsaUnwrapInfo {}
        }
    }

    impl AsRef<KmsRsaUnwrapInfo>
        for KmsRsaUnwrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(460,3)
    #[derive(PartialEq, Clone)]
    pub enum KmsRsaWrapInfo {
        KmsRsaWrapInfo {}
    }

    impl KmsRsaWrapInfo {}

    impl Debug
        for KmsRsaWrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for KmsRsaWrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                KmsRsaWrapInfo::KmsRsaWrapInfo{} => {
                    write!(_formatter, "AwsKmsRsaKeyring_Compile.KmsRsaWrapInfo.KmsRsaWrapInfo")?;
                    Ok(())
                },
            }
        }
    }

    impl KmsRsaWrapInfo {
        /// Enumerates all possible values of KmsRsaWrapInfo
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<KmsRsaWrapInfo>> {
            seq![Arc::new(KmsRsaWrapInfo::KmsRsaWrapInfo {})].iter()
        }
    }

    impl Eq
        for KmsRsaWrapInfo {}

    impl Hash
        for KmsRsaWrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                KmsRsaWrapInfo::KmsRsaWrapInfo{} => {

                },
            }
        }
    }

    impl Default
        for KmsRsaWrapInfo {
        fn default() -> KmsRsaWrapInfo {
            KmsRsaWrapInfo::KmsRsaWrapInfo {}
        }
    }

    impl AsRef<KmsRsaWrapInfo>
        for KmsRsaWrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(462,3)
    pub struct KmsRsaGenerateAndWrapKeyMaterial {
        pub __i_publicKey: Sequence<u8>,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_paddingScheme: Arc<EncryptionAlgorithmSpec>
    }

    impl KmsRsaGenerateAndWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(469,5)
        pub fn _ctor(this: &Object<KmsRsaGenerateAndWrapKeyMaterial>, publicKey: &Sequence<u8>, paddingScheme: &Arc<EncryptionAlgorithmSpec>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_publicKey: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_paddingScheme: bool = false;
            update_field_uninit_object!(this.clone(), __i_publicKey, _set___i_publicKey, publicKey.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(465,5)
        pub fn publicKey(&self) -> Sequence<u8> {
            self.__i_publicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(467,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(466,5)
        pub fn paddingScheme(&self) -> Arc<EncryptionAlgorithmSpec> {
            self.__i_paddingScheme.clone()
        }
    }

    impl UpcastObject<DynAny>
        for KmsRsaGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl GenerateAndWrapMaterial<Arc<KmsRsaWrapInfo>>
        for KmsRsaGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn GenerateAndWrapMaterial<Arc<KmsRsaWrapInfo>>>
        for KmsRsaGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn GenerateAndWrapMaterial<Arc<KmsRsaWrapInfo>>);
    }

    impl ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for KmsRsaGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for KmsRsaGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for KmsRsaGenerateAndWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(506,5)
        fn Invoke(&self, input: &Arc<GenerateAndWrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut generateBytesResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(self.cryptoPrimitives().clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                            length: crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite())
                        }));
            generateBytesResult = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = generateBytesResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>>());
                return res.read();
            };
            let mut plaintextMaterial: Sequence<u8> = valueOrError0.Extract();
            let mut wrap: Object<KmsRsaWrapKeyMaterial>;
            let mut _nw0: Object<KmsRsaWrapKeyMaterial> = KmsRsaWrapKeyMaterial::_allocate_object();
            KmsRsaWrapKeyMaterial::_ctor(&_nw0, &self.publicKey().clone(), &self.paddingScheme().clone(), &self.cryptoPrimitives().clone());
            wrap = _nw0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = Action::<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::Invoke(rd!(wrap.clone()), &Arc::new(WrapInput::WrapInput {
                            plaintextMaterial: plaintextMaterial.clone(),
                            algorithmSuite: input.algorithmSuite().clone(),
                            encryptionContext: input.encryptionContext().clone(),
                            serializedEC: input.serializedEC().clone()
                        }));
            valueOrError1 = _out1.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>>());
                return res.read();
            };
            let mut wrapOutput: Arc<WrapOutput<Arc<KmsRsaWrapInfo>>> = valueOrError1.Extract();
            let mut output: Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>> = Arc::new(GenerateAndWrapOutput::<Arc<KmsRsaWrapInfo>>::GenerateAndWrapOutput {
                        plaintextMaterial: plaintextMaterial.clone(),
                        wrappedMaterial: wrapOutput.wrappedMaterial().clone(),
                        wrapInfo: Arc::new(KmsRsaWrapInfo::KmsRsaWrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for KmsRsaGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(544,3)
    pub struct KmsRsaWrapKeyMaterial {
        pub __i_publicKey: Sequence<u8>,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_paddingScheme: Arc<EncryptionAlgorithmSpec>
    }

    impl KmsRsaWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(551,5)
        pub fn _ctor(this: &Object<KmsRsaWrapKeyMaterial>, publicKey: &Sequence<u8>, paddingScheme: &Arc<EncryptionAlgorithmSpec>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_publicKey: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_paddingScheme: bool = false;
            update_field_uninit_object!(this.clone(), __i_publicKey, _set___i_publicKey, publicKey.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(547,5)
        pub fn publicKey(&self) -> Sequence<u8> {
            self.__i_publicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(549,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(548,5)
        pub fn paddingScheme(&self) -> Arc<EncryptionAlgorithmSpec> {
            self.__i_paddingScheme.clone()
        }
    }

    impl UpcastObject<DynAny>
        for KmsRsaWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl WrapMaterial<Arc<KmsRsaWrapInfo>>
        for KmsRsaWrapKeyMaterial {}

    impl UpcastObject<dyn WrapMaterial<Arc<KmsRsaWrapInfo>>>
        for KmsRsaWrapKeyMaterial {
        UpcastObjectFn!(dyn WrapMaterial<Arc<KmsRsaWrapInfo>>);
    }

    impl ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for KmsRsaWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for KmsRsaWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for KmsRsaWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(588,5)
        fn Invoke(&self, input: &Arc<WrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::EncryptionContextDigest(&self.cryptoPrimitives().clone(), input.encryptionContext());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>>());
                return res.read();
            };
            let mut encryptionContextDigest: Sequence<u8> = valueOrError0.Extract();
            let mut padding: Arc<RSAPaddingMode>;
            let mut _source0: Arc<EncryptionAlgorithmSpec> = self.paddingScheme().clone();
            if matches!((&_source0).as_ref(), RSAES_OAEP_SHA_1{ .. }) {
                padding = Arc::new(RSAPaddingMode::OAEP_SHA1 {});
            } else {
                padding = Arc::new(RSAPaddingMode::OAEP_SHA256 {});
            };
            let mut RSAEncryptOutput: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::RSAEncrypt(rd!(self.cryptoPrimitives().clone()), &Arc::new(RSAEncryptInput::RSAEncryptInput {
                            padding: padding.clone(),
                            publicKey: self.publicKey().clone(),
                            plaintext: encryptionContextDigest.concat(input.plaintextMaterial())
                        }));
            RSAEncryptOutput = _out1.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = RSAEncryptOutput.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>>());
                return res.read();
            };
            let mut ciphertext: Sequence<u8> = valueOrError1.Extract();
            let mut output: Arc<WrapOutput<Arc<KmsRsaWrapInfo>>> = Arc::new(WrapOutput::<Arc<KmsRsaWrapInfo>>::WrapOutput {
                        wrappedMaterial: ciphertext.clone(),
                        wrapInfo: Arc::new(KmsRsaWrapInfo::KmsRsaWrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for KmsRsaWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<KmsRsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(622,3)
    pub struct KmsRsaUnwrapKeyMaterial {
        pub __i_client: Object<dyn IKMSClient>,
        pub __i_grantTokens: GrantTokenList,
        pub __i_awsKmsKey: Sequence<DafnyCharUTF16>,
        pub __i_paddingScheme: Arc<EncryptionAlgorithmSpec>,
        pub __i_encryptionContextDigest: Sequence<u8>
    }

    impl KmsRsaUnwrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(631,5)
        pub fn _ctor(this: &Object<KmsRsaUnwrapKeyMaterial>, client: &Object<dyn IKMSClient>, awsKmsKey: &Sequence<DafnyCharUTF16>, paddingScheme: &Arc<EncryptionAlgorithmSpec>, encryptionContextDigest: &Sequence<u8>, grantTokens: &GrantTokenList) -> () {
            let mut _set___i_client: bool = false;
            let mut _set___i_grantTokens: bool = false;
            let mut _set___i_awsKmsKey: bool = false;
            let mut _set___i_paddingScheme: bool = false;
            let mut _set___i_encryptionContextDigest: bool = false;
            update_field_uninit_object!(this.clone(), __i_client, _set___i_client, client.clone());
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone());
            update_field_uninit_object!(this.clone(), __i_encryptionContextDigest, _set___i_encryptionContextDigest, encryptionContextDigest.clone());
            update_field_uninit_object!(this.clone(), __i_grantTokens, _set___i_grantTokens, grantTokens.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(625,5)
        pub fn client(&self) -> Object<dyn IKMSClient> {
            self.__i_client.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(629,5)
        pub fn grantTokens(&self) -> GrantTokenList {
            self.__i_grantTokens.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(626,5)
        pub fn awsKmsKey(&self) -> Sequence<DafnyCharUTF16> {
            self.__i_awsKmsKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(627,5)
        pub fn paddingScheme(&self) -> Arc<EncryptionAlgorithmSpec> {
            self.__i_paddingScheme.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(628,5)
        pub fn encryptionContextDigest(&self) -> Sequence<u8> {
            self.__i_encryptionContextDigest.clone()
        }
    }

    impl UpcastObject<DynAny>
        for KmsRsaUnwrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl UnwrapMaterial<Arc<KmsRsaUnwrapInfo>>
        for KmsRsaUnwrapKeyMaterial {}

    impl UpcastObject<dyn UnwrapMaterial<Arc<KmsRsaUnwrapInfo>>>
        for KmsRsaUnwrapKeyMaterial {
        UpcastObjectFn!(dyn UnwrapMaterial<Arc<KmsRsaUnwrapInfo>>);
    }

    impl ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for KmsRsaUnwrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for KmsRsaUnwrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for KmsRsaUnwrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsRsaKeyring.dfy(690,5)
        fn Invoke(&self, input: &Arc<UnwrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_CiphertextType(input.wrappedMaterial()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Ciphertext length invalid")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>>());
                return res.read();
            };
            let mut decryptRequest: Arc<DecryptRequest> = Arc::new(DecryptRequest::DecryptRequest {
                        CiphertextBlob: input.wrappedMaterial().clone(),
                        EncryptionContext: Arc::new(Option::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>::None {}),
                        GrantTokens: Arc::new(Option::<GrantTokenList>::Some {
                                    value: self.grantTokens().clone()
                                }),
                        KeyId: Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                    value: self.awsKmsKey().clone()
                                }),
                        EncryptionAlgorithm: Arc::new(Option::<Arc<EncryptionAlgorithmSpec>>::Some {
                                    value: self.paddingScheme().clone()
                                }),
                        Recipient: Arc::new(Option::<Arc<RecipientInfo>>::None {}),
                        DryRun: Arc::new(Option::<bool>::None {})
                    });
            let mut maybeDecryptResponse: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = IKMSClient::Decrypt(rd!(self.client().clone()), &decryptRequest);
            maybeDecryptResponse = _out0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeDecryptResponse.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::ComAmazonawsKms {
                                        ComAmazonawsKms: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>>());
                return res.read();
            };
            let mut decryptResponse: Arc<DecryptResponse> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(decryptResponse.KeyId().as_ref(), Some{ .. }) && decryptResponse.KeyId().value().clone() == self.awsKmsKey().clone() && matches!(decryptResponse.Plaintext().as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from KMS Decrypt")
                        }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>>());
                return res.read();
            };
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(self.encryptionContextDigest().clone() <= decryptResponse.Plaintext().value().clone() && crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite()) as u64 + truncate!(self.encryptionContextDigest().clone().cardinality(), u64) == truncate!(decryptResponse.Plaintext().value().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Encryption context digest does not match expected value.")
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>>());
                return res.read();
            };
            let mut output: Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>> = Arc::new(UnwrapOutput::<Arc<KmsRsaUnwrapInfo>>::UnwrapOutput {
                        unwrappedMaterial: decryptResponse.Plaintext().value().drop(&int!((&truncate!((&self.encryptionContextDigest().clone().cardinality()).clone(), u64)).clone())),
                        unwrapInfo: Arc::new(KmsRsaUnwrapInfo::KmsRsaUnwrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for KmsRsaUnwrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<KmsRsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(8,1)
pub mod _AwsKmsUtils_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier::AwsKmsArnIdentifier;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::map;
    pub use ::dafny_runtime::MapBuilder;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::itertools::Itertools;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::PublicKeyType;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GetPublicKeyRequest;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GetPublicKeyResponse;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::KeyUsageType;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter;
    pub use ::dafny_runtime::allocate_object;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicAction;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(20,3)
        pub fn OkForDecrypt(id: &Arc<AwsKmsIdentifier>, arn: &Sequence<DafnyCharUTF16>) -> Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            if !matches!(id.as_ref(), AwsKmsArnIdentifier{ .. }) {
                Arc::new(Outcome::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Fail {
                        error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("KeyID cannot be used for Decrypt : ").concat(arn)
                                })
                    })
            } else {
                if id.a().resource().resourceType().clone() != string_utf16_of("key") {
                    Arc::new(Outcome::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Fail {
                            error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                        message: string_utf16_of("Alias cannot be used for Decrypt : ").concat(arn)
                                    })
                        })
                } else {
                    Arc::new(Outcome::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Pass {})
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(30,3)
        pub fn StringifyEncryptionContext(utf8EncCtx: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> Arc<Result<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            if truncate!(utf8EncCtx.cardinality(), u64) == 0 {
                Arc::new(Result::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                        value: map![]
                    })
            } else {
                let mut stringifyResults: Map<ValidUTF8Bytes, Arc<Result<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>> = (&({
                        let mut utf8EncCtx = utf8EncCtx.clone();
                        Arc::new(move || -> Map<ValidUTF8Bytes, Arc<Result<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>{
                                let mut _coll0: MapBuilder<ValidUTF8Bytes, Arc<Result<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>> = MapBuilder::<ValidUTF8Bytes, Arc<Result<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
                                for __compr_0 in (&utf8EncCtx.keys()).iter().cloned() {
                                    let mut utf8Key: ValidUTF8Bytes = __compr_0.clone();
                                    if {
                                            let i: Sequence<u8> = utf8Key.clone();
                                            crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                        } {
                                        if utf8EncCtx.keys().contains(&utf8Key) {
                                            _coll0.add(&utf8Key, &_default::StringifyEncryptionContextPair(&utf8Key, &utf8EncCtx.get(&utf8Key)))
                                        }
                                    }
                                }
                                _coll0.build()
                            })
                    }))();
                if (&stringifyResults.values()).iter().any(({
                            let mut stringifyResults = stringifyResults.clone();
                            Arc::new(move |__exists_var_0: &Arc<Result<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>| -> bool{
                                    let mut r: Arc<Result<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = __exists_var_0.clone();
                                    stringifyResults.values().contains(&r) && matches!((&r).as_ref(), Failure{ .. })
                                })
                        }).as_ref()) {
                    Arc::new(Result::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                            error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                        message: string_utf16_of("Encryption context contains invalid UTF8")
                                    })
                        })
                } else {
                    let mut stringKeysUnique: bool = (&stringifyResults).keys().iter().all(({
                                let mut stringifyResults = stringifyResults.clone();
                                Arc::new(move |__forall_var_0: &ValidUTF8Bytes| -> bool{
                                        let mut k: Sequence<u8> = __forall_var_0.clone();
                                        (&stringifyResults).keys().iter().all(({
                                                let mut stringifyResults = stringifyResults.clone();
                                                let mut k = k.clone();
                                                Arc::new(move |__forall_var_1: &ValidUTF8Bytes| -> bool{
                                                        let mut _k_k: Sequence<u8> = __forall_var_1.clone();
                                                        !(stringifyResults.contains(&k) && stringifyResults.contains(&_k_k)) || (!(k.clone() != _k_k.clone()) || stringifyResults.get(&k).value().0.clone() != stringifyResults.get(&_k_k).value().0.clone())
                                                    })
                                            }).as_ref())
                                    })
                            }).as_ref());
                    if !stringKeysUnique {
                        Arc::new(Result::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: string_utf16_of("Encryption context keys are not unique")
                                        })
                            })
                    } else {
                        Arc::new(Result::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: (&({
                                        let mut stringifyResults = stringifyResults.clone();
                                        Arc::new(move || -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>{
                                                let mut _coll1: MapBuilder<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = MapBuilder::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::new();
                                                for __compr_1 in (&stringifyResults.values()).iter().cloned() {
                                                    let mut r: Arc<Result<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = __compr_1.clone();
                                                    if stringifyResults.values().contains(&r) {
                                                        _coll1.add(&r.value().0.clone(), &r.value().1.clone())
                                                    }
                                                }
                                                _coll1.build()
                                            })
                                    }))()
                            })
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(51,3)
        pub fn StringifyEncryptionContextPair(utf8Key: &ValidUTF8Bytes, utf8Value: &ValidUTF8Bytes) -> Arc<Result<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(utf8Key).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| _default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>)>()
            } else {
                let mut key: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
                let mut valueOrError1: Arc<Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(utf8Value).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| _default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>)>()
                } else {
                    let mut value: Sequence<DafnyCharUTF16> = valueOrError1.Extract();
                    Arc::new(Result::<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: (
                                    key.clone(),
                                    value.clone()
                                )
                        })
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(65,3)
        pub fn WrapStringToError(e: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error> {
            Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                    message: e.clone()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(71,3)
        pub fn ValidateKmsKeyId(keyId: &Sequence<DafnyCharUTF16>) -> Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Result<Arc<AwsKmsIdentifier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsIdentifier(keyId).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| _default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<()>()
            } else {
                let mut _v0: Arc<AwsKmsIdentifier> = valueOrError0.Extract();
                let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::UTF8::_default::IsASCIIString(keyId), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Key identifier is not ASCII")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<()>()
                } else {
                    let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(0 < truncate!(keyId.cardinality(), u64) && truncate!(keyId.cardinality(), u64) <= crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::MAX_AWS_KMS_IDENTIFIER_LENGTH(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Key identifier is too long")
                                }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<()>()
                    } else {
                        Arc::new(Result::<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: ()
                            })
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(90,3)
        pub fn GetValidGrantTokens(grantTokens: &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>) -> Arc<Result<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut tokens: Sequence<Sequence<DafnyCharUTF16>> = grantTokens.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>));
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(0 <= truncate!(tokens.cardinality(), u64) && truncate!(tokens.cardinality(), u64) <= 10, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Grant token list can have no more than 10 tokens")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Sequence<Sequence<DafnyCharUTF16>>>()
            } else {
                let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(Itertools::unique((&tokens).iter()).all(({
                                let mut tokens = tokens.clone();
                                Arc::new(move |__forall_var_0: Sequence<DafnyCharUTF16>| -> bool{
                                        let mut token: Sequence<DafnyCharUTF16> = __forall_var_0.clone();
                                        !tokens.contains(&token) || 1 <= truncate!(token.cardinality(), u64) && truncate!(token.cardinality(), u64) <= 8192
                                    })
                            }).as_ref()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Grant token list contains a grant token with invalid length")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Sequence<Sequence<DafnyCharUTF16>>>()
                } else {
                    Arc::new(Result::<Sequence<Sequence<DafnyCharUTF16>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: tokens.clone()
                        })
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(110,3)
        pub fn GetEcdhPublicKey(client: &Object<dyn IKMSClient>, awsKmsKey: &Sequence<DafnyCharUTF16>) -> Arc<Result<PublicKeyType, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<PublicKeyType, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut getPublicKeyRequest: Arc<GetPublicKeyRequest> = Arc::new(GetPublicKeyRequest::GetPublicKeyRequest {
                        KeyId: awsKmsKey.clone(),
                        GrantTokens: Arc::new(Option::<GrantTokenList>::None {})
                    });
            let mut maybePublicKeyResponse: Arc<Result<Arc<GetPublicKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<GetPublicKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = IKMSClient::GetPublicKey(rd!(client.clone()), &getPublicKeyRequest);
            maybePublicKeyResponse = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<GetPublicKeyResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybePublicKeyResponse.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::ComAmazonawsKms {
                                        ComAmazonawsKms: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<PublicKeyType>());
                return res.read();
            };
            let mut getPublicKeyResponse: Arc<GetPublicKeyResponse> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!(getPublicKeyResponse.KeyId().as_ref(), Some{ .. }) && getPublicKeyResponse.KeyId().value().clone() == awsKmsKey.clone() && matches!(getPublicKeyResponse.KeyUsage().as_ref(), Some{ .. }) && getPublicKeyResponse.KeyUsage().value().clone() == Arc::new(KeyUsageType::KEY_AGREEMENT {}) && matches!(getPublicKeyResponse.PublicKey().as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid response from KMS GetPublicKey")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<PublicKeyType>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<PublicKeyType, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: getPublicKeyResponse.PublicKey().value().clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(159,3)
        pub fn ParseKeyNamespaceAndName(keyNamespace: &Sequence<DafnyCharUTF16>, keyName: &Sequence<DafnyCharUTF16>) -> Arc<Result<(ValidUTF8Bytes, ValidUTF8Bytes), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Result<ValidUTF8Bytes, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(keyNamespace).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                        message: string_utf16_of("Key namespace could not be UTF8-encoded").concat(e)
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<(ValidUTF8Bytes, ValidUTF8Bytes)>()
            } else {
                let mut namespace: ValidUTF8Bytes = valueOrError0.Extract();
                let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(namespace.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Key namespace too long")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<(ValidUTF8Bytes, ValidUTF8Bytes)>()
                } else {
                    let mut valueOrError2: Arc<Result<ValidUTF8Bytes, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(keyName).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                                Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                        Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                                message: string_utf16_of("Key name could not be UTF8-encoded").concat(e)
                                            })
                                    })
                            }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<(ValidUTF8Bytes, ValidUTF8Bytes)>()
                    } else {
                        let mut name: ValidUTF8Bytes = valueOrError2.Extract();
                        let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(name.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                        message: string_utf16_of("Key name too long")
                                    }));
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<(ValidUTF8Bytes, ValidUTF8Bytes)>()
                        } else {
                            Arc::new(Result::<(ValidUTF8Bytes, ValidUTF8Bytes), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                    value: (
                                            namespace.clone(),
                                            name.clone()
                                        )
                                })
                        }
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(185,3)
        pub fn ValidateDiscoveryFilter(filter: &Arc<DiscoveryFilter>) -> Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(0 < truncate!(filter.accountIds().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Discovery filter must have at least one account ID")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<()>()
            } else {
                let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(Itertools::unique(filter.accountIds().iter()).all(({
                                let mut filter = filter.clone();
                                Arc::new(move |__forall_var_0: Sequence<DafnyCharUTF16>| -> bool{
                                        let mut accountId: Sequence<DafnyCharUTF16> = __forall_var_0.clone();
                                        !filter.accountIds().contains(&accountId) || 0 < truncate!(accountId.cardinality(), u64)
                                    })
                            }).as_ref()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Discovery filter account IDs cannot be blank")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<()>()
                } else {
                    let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(0 < truncate!(filter.partition().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Discovery filter partition cannot be blank")
                                }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<()>()
                    } else {
                        Arc::new(Result::<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: ()
                            })
                    }
                }
            }
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(207,3)
    pub struct OnDecryptMrkAwareEncryptedDataKeyFilter {
        pub __i_awsKmsKey: Arc<AwsKmsIdentifier>,
        pub __i_providerId: ValidUTF8Bytes
    }

    impl OnDecryptMrkAwareEncryptedDataKeyFilter {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(215,5)
        pub fn _ctor(this: &Object<OnDecryptMrkAwareEncryptedDataKeyFilter>, awsKmsKey: &Arc<AwsKmsIdentifier>, providerId: &ValidUTF8Bytes) -> () {
            let mut _set___i_awsKmsKey: bool = false;
            let mut _set___i_providerId: bool = false;
            update_field_uninit_object!(this.clone(), __i_awsKmsKey, _set___i_awsKmsKey, awsKmsKey.clone());
            update_field_uninit_object!(this.clone(), __i_providerId, _set___i_providerId, providerId.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(210,5)
        pub fn awsKmsKey(&self) -> Arc<AwsKmsIdentifier> {
            self.__i_awsKmsKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(211,5)
        pub fn providerId(&self) -> ValidUTF8Bytes {
            self.__i_providerId.clone()
        }
    }

    impl UpcastObject<DynAny>
        for OnDecryptMrkAwareEncryptedDataKeyFilter {
        UpcastObjectFn!(DynAny);
    }

    impl DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for OnDecryptMrkAwareEncryptedDataKeyFilter {}

    impl UpcastObject<dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for OnDecryptMrkAwareEncryptedDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for OnDecryptMrkAwareEncryptedDataKeyFilter {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/AwsKmsUtils.dfy(239,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            if edk.keyProviderId().clone() != self.providerId().clone() {
                res = MaybePlacebo::from(Arc::new(Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: false
                            }));
                return res.read();
            };
            if !crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderInfo()) {
                res = MaybePlacebo::from(Arc::new(Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: string_utf16_of("Invalid AWS KMS encoding, provider info is not UTF8.")
                                        })
                            }));
                return res.read();
            };
            let mut valueOrError0: Arc<Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(edk.keyProviderInfo()).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| _default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<bool>());
                return res.read();
            };
            let mut keyId: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<AwsKmsArn, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(&keyId).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| _default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<bool>());
                return res.read();
            };
            let mut arn: AwsKmsArn = valueOrError1.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: crate::implementation_from_dafny::_AwsKmsMrkMatchForDecrypt_Compile::_default::AwsKmsMrkMatchForDecrypt(&self.awsKmsKey().clone(), &Arc::new(AwsKmsIdentifier::AwsKmsArnIdentifier {
                                            a: arn.clone()
                                        }))
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for OnDecryptMrkAwareEncryptedDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }
}
/// ../mpl/StandardLibrary/src/Base64.dfy(10,1)
pub mod _Base64_Compile {
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::Sequence;
    pub use ::std::default::Default;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::fmt::Formatter;
    pub use ::std::ops::Deref;
    pub use ::std::mem::transmute;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::ops::Add;
    pub use ::std::ops::Sub;
    pub use ::std::ops::Mul;
    pub use ::std::ops::Div;
    pub use ::std::cmp::PartialOrd;
    pub use ::std::option::Option;
    pub use ::std::cmp::Ordering;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/Base64.dfy(21,3)
        pub fn IsBase64Char(c: &DafnyCharUTF16) -> bool {
            c.clone() == DafnyCharUTF16(43 as u16) || c.clone() == DafnyCharUTF16(47 as u16) || DafnyCharUTF16(48 as u16) <= c.clone() && c.clone() <= DafnyCharUTF16(57 as u16) || DafnyCharUTF16(65 as u16) <= c.clone() && c.clone() <= DafnyCharUTF16(90 as u16) || DafnyCharUTF16(97 as u16) <= c.clone() && c.clone() <= DafnyCharUTF16(122 as u16)
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(27,3)
        pub fn IsUnpaddedBase64String(s: &Sequence<DafnyCharUTF16>) -> bool {
            let mut _hresult: bool = <bool as Default>::default();
            let mut size: u64 = truncate!(s.cardinality(), u64);
            if size % 4 != 0 {
                _hresult = false;
                return _hresult;
            };
            let mut _hi0: u64 = size;
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                if !_default::IsBase64Char(&s.get(&int!((&i).clone()))) {
                    _hresult = false;
                    return _hresult;
                }
            }
            _hresult = true;
            return _hresult;
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(46,3)
        pub fn IndexToChar(i: u8) -> DafnyCharUTF16 {
            if i == 63 {
                DafnyCharUTF16(47 as u16)
            } else {
                if i == 62 {
                    DafnyCharUTF16(43 as u16)
                } else {
                    if 52 <= i && i <= 61 {
                        DafnyCharUTF16((i - 4) as u16)
                    } else {
                        if 26 <= i && i <= 51 {
                            DafnyCharUTF16((i + 71) as u16)
                        } else {
                            DafnyCharUTF16((i + 65) as u16)
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(62,3)
        pub fn CharToIndex(c: &DafnyCharUTF16) -> u8 {
            if c.clone() == DafnyCharUTF16(47 as u16) {
                63
            } else {
                if c.clone() == DafnyCharUTF16(43 as u16) {
                    62
                } else {
                    if DafnyCharUTF16(48 as u16) <= c.clone() && c.clone() <= DafnyCharUTF16(57 as u16) {
                        c.clone().0 as u8 + 4
                    } else {
                        if DafnyCharUTF16(97 as u16) <= c.clone() && c.clone() <= DafnyCharUTF16(122 as u16) {
                            c.clone().0 as u8 - 71
                        } else {
                            c.clone().0 as u8 - 65
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(83,3)
        pub fn UInt24ToSeq(x: u32) -> Sequence<u8> {
            let mut b0: u8 = (x / 65536) as u8;
            let mut x0: u32 = x - b0 as u32 * 65536;
            let mut b1: u8 = (x0 / 256) as u8;
            let mut b2: u8 = (x0 % 256) as u8;
            seq![b0, b1, b2]
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(95,3)
        pub fn SeqToUInt24(s: &Sequence<u8>) -> u32 {
            s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) as u32 * 65536 + s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) as u32 * 256 + s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) as u32
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(102,3)
        pub fn SeqPosToUInt24(s: &Sequence<u8>, pos: u64) -> u32 {
            s.get(&int!((&pos).clone())) as u32 * 65536 + s.get(&int!((&(pos + 1)).clone())) as u32 * 256 + s.get(&int!((&(pos + 2)).clone())) as u32
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(119,3)
        pub fn UInt24ToIndexSeq(x: u32) -> Sequence<u8> {
            let mut b0: u8 = (x / 262144) as u8;
            let mut x0: u32 = x - b0 as u32 * 262144;
            let mut b1: u8 = (x0 / 4096) as u8;
            let mut x1: u32 = x0 - b1 as u32 * 4096;
            let mut b2: u8 = (x1 / 64) as u8;
            let mut b3: u8 = (x1 % 64) as u8;
            seq![b0, b1, b2, b3]
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(137,3)
        pub fn IndexSeqToUInt24(s: &Sequence<u8>) -> u32 {
            s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) as u32 * 262144 + s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) as u32 * 4096 + s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) as u32 * 64 + s.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) as u32
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(144,3)
        pub fn IndexSeqPosToUInt24(s: &Sequence<u8>, pos: u64) -> u32 {
            s.get(&int!((&pos).clone())) as u32 * 262144 + s.get(&int!((&(pos + 1)).clone())) as u32 * 4096 + s.get(&int!((&(pos + 2)).clone())) as u32 * 64 + s.get(&int!((&(pos + 3)).clone())) as u32
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(161,3)
        pub fn DecodeBlock(s: &Sequence<u8>) -> Sequence<u8> {
            _default::UInt24ToSeq(_default::IndexSeqToUInt24(s))
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(169,3)
        pub fn DecodeBlockPos(s: &Sequence<u8>, pos: u64) -> Sequence<u8> {
            _default::UInt24ToSeq(_default::IndexSeqPosToUInt24(s, pos))
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(178,3)
        pub fn EncodeBlock(s: &Sequence<u8>) -> Sequence<u8> {
            _default::UInt24ToIndexSeq(_default::SeqToUInt24(s))
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(187,3)
        pub fn EncodeBlockPos(s: &Sequence<u8>, pos: u64) -> Sequence<u8> {
            _default::UInt24ToIndexSeq(_default::SeqPosToUInt24(s, pos))
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(206,3)
        pub fn DecodeRecursively(s: &Sequence<u8>) -> Sequence<u8> {
            let mut b = MaybePlacebo::<Sequence<u8>>::new();
            let mut i: u64 = truncate!(s.cardinality(), u64);
            let mut result: Sequence<u8> = seq![] as Sequence<u8>;
            while 0 < i {
                result = _default::DecodeBlockPos(s, i - 4).concat(&result);
                i = i - 4;
            };
            b = MaybePlacebo::from(result.clone());
            return b.read();
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(232,3)
        pub fn EncodeRecursively(b: &Sequence<u8>) -> Sequence<u8> {
            let mut s = MaybePlacebo::<Sequence<u8>>::new();
            let mut i: u64 = truncate!(b.cardinality(), u64);
            let mut result: Sequence<u8> = seq![] as Sequence<u8>;
            while 0 < i {
                result = _default::EncodeBlockPos(b, i - 3).concat(&result);
                i = i - 3;
            };
            s = MaybePlacebo::from(result.clone());
            return s.read();
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(266,3)
        pub fn FromCharsToIndices(s: &Sequence<DafnyCharUTF16>) -> Sequence<u8> {
            let mut b = MaybePlacebo::<Sequence<u8>>::new();
            let mut result: Sequence<u8> = seq![] as Sequence<u8>;
            let mut _hi0: u64 = truncate!(s.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                result = result.concat(&seq![_default::CharToIndex(&s.get(&int!((&i).clone())))]);
            }
            b = MaybePlacebo::from(result.clone());
            return b.read();
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(284,3)
        pub fn FromIndicesToChars(b: &Sequence<u8>) -> Sequence<DafnyCharUTF16> {
            let mut s = MaybePlacebo::<Sequence<DafnyCharUTF16>>::new();
            let mut result: Sequence<DafnyCharUTF16> = seq![] as Sequence<DafnyCharUTF16>;
            let mut _hi0: u64 = truncate!(b.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                result = result.concat(&seq![_default::IndexToChar(b.get(&int!((&i).clone())))]);
            }
            s = MaybePlacebo::from(result.clone());
            return s.read();
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(311,3)
        pub fn DecodeUnpadded(s: &Sequence<DafnyCharUTF16>) -> Sequence<u8> {
            _default::DecodeRecursively(&_default::FromCharsToIndices(s))
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(319,3)
        pub fn EncodeUnpadded(b: &Sequence<u8>) -> Sequence<DafnyCharUTF16> {
            _default::FromIndicesToChars(&_default::EncodeRecursively(b))
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(359,3)
        pub fn Is1Padding(s: &Sequence<DafnyCharUTF16>) -> bool {
            truncate!(s.cardinality(), u64) == 4 && _default::IsBase64Char(&s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))) && _default::IsBase64Char(&s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))) && _default::IsBase64Char(&s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone()))) && _default::CharToIndex(&s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone()))) % 4 == 0 && s.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) == DafnyCharUTF16(61 as u16)
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(370,3)
        pub fn Decode1Padding(s: &Sequence<DafnyCharUTF16>) -> Sequence<u8> {
            let mut d: Sequence<u8> = _default::DecodeBlock(&seq![_default::CharToIndex(&s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))), _default::CharToIndex(&s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))), _default::CharToIndex(&s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone()))), 0]);
            seq![d.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), d.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))]
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(379,3)
        pub fn Encode1Padding(b: &Sequence<u8>) -> Sequence<DafnyCharUTF16> {
            let mut e: Sequence<u8> = _default::EncodeBlock(&seq![b.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), b.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())), 0]);
            seq![_default::IndexToChar(e.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))), _default::IndexToChar(e.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))), _default::IndexToChar(e.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone()))), DafnyCharUTF16(61 as u16)]
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(400,3)
        pub fn Is2Padding(s: &Sequence<DafnyCharUTF16>) -> bool {
            truncate!(s.cardinality(), u64) == 4 && _default::IsBase64Char(&s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))) && _default::IsBase64Char(&s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))) && _default::CharToIndex(&s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))) % 16 == 0 && s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) == DafnyCharUTF16(61 as u16) && s.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) == DafnyCharUTF16(61 as u16)
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(411,3)
        pub fn Decode2Padding(s: &Sequence<DafnyCharUTF16>) -> Sequence<u8> {
            let mut d: Sequence<u8> = _default::DecodeBlock(&seq![_default::CharToIndex(&s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))), _default::CharToIndex(&s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))), 0, 0]);
            seq![d.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))]
        }
        /// Padding with 2 = implies the sequence represents 1 bytes
        /// ../mpl/StandardLibrary/src/Base64.dfy(420,3)
        pub fn Encode2Padding(b: &Sequence<u8>) -> Sequence<DafnyCharUTF16> {
            let mut e: Sequence<u8> = _default::EncodeBlock(&seq![b.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), 0, 0]);
            seq![_default::IndexToChar(e.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))), _default::IndexToChar(e.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone()))), DafnyCharUTF16(61 as u16), DafnyCharUTF16(61 as u16)]
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(442,3)
        pub fn IsBase64String(s: &Sequence<DafnyCharUTF16>) -> bool {
            let mut size: u64 = truncate!(s.cardinality(), u64);
            size % 4 == 0 && (_default::IsUnpaddedBase64String(s) || _default::IsUnpaddedBase64String(&s.take(&int!((&(size - 4)).clone()))) && (_default::Is1Padding(&s.drop(&int!((&(size - 4)).clone()))) || _default::Is2Padding(&s.drop(&int!((&(size - 4)).clone())))))
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(451,3)
        pub fn DecodeValid(s: &Sequence<DafnyCharUTF16>) -> Sequence<u8> {
            let mut size: u64 = truncate!(s.cardinality(), u64);
            if size == 0 {
                seq![] as Sequence<u8>
            } else {
                let mut finalBlockStart: u64 = size - 4;
                let mut prefix: Sequence<DafnyCharUTF16> = s.take(&int!((&finalBlockStart).clone()));
                let mut suffix: Sequence<DafnyCharUTF16> = s.drop(&int!((&finalBlockStart).clone()));
                if _default::Is1Padding(&suffix) {
                    _default::DecodeUnpadded(&prefix).concat(&_default::Decode1Padding(&suffix))
                } else {
                    if _default::Is2Padding(&suffix) {
                        _default::DecodeUnpadded(&prefix).concat(&_default::Decode2Padding(&suffix))
                    } else {
                        _default::DecodeUnpadded(s)
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(504,3)
        pub fn Decode(s: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Sequence<DafnyCharUTF16>>> {
            if _default::IsBase64String(s) {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Sequence<DafnyCharUTF16>>::Success {
                        value: _default::DecodeValid(s)
                    })
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Sequence<DafnyCharUTF16>>::Failure {
                        error: string_utf16_of("The encoding is malformed")
                    })
            }
        }
        /// ../mpl/StandardLibrary/src/Base64.dfy(522,3)
        pub fn Encode(b: &Sequence<u8>) -> Sequence<DafnyCharUTF16> {
            let mut size: u64 = truncate!(b.cardinality(), u64);
            let mut r#mod: u64 = size % 3;
            if r#mod == 0 {
                let mut s: Sequence<DafnyCharUTF16> = _default::EncodeUnpadded(b);
                s.clone()
            } else {
                if r#mod == 1 {
                    let mut s1: Sequence<DafnyCharUTF16> = _default::EncodeUnpadded(&b.take(&int!((&(size - 1)).clone())));
                    let mut s2: Sequence<DafnyCharUTF16> = _default::Encode2Padding(&b.drop(&int!((&(size - 1)).clone())));
                    let mut s: Sequence<DafnyCharUTF16> = s1.concat(&s2);
                    s.clone()
                } else {
                    let mut s1: Sequence<DafnyCharUTF16> = _default::EncodeUnpadded(&b.take(&int!((&(size - 2)).clone())));
                    let mut s2: Sequence<DafnyCharUTF16> = _default::Encode1Padding(&b.drop(&int!((&(size - 2)).clone())));
                    let mut s: Sequence<DafnyCharUTF16> = s1.concat(&s2);
                    s.clone()
                }
            }
        }
    }

    /// ../mpl/StandardLibrary/src/Base64.dfy(16,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct index(pub u8);

    impl index {
        /// Constraint check
        pub fn is(_source: u8) -> bool {
            let mut x: DafnyInt = int!(_source.clone());
            return int!(0) <= x.clone() && x.clone() < int!(64);
        }
    }

    impl Default
        for index {
        /// An element of index
        fn default() -> Self {
            index(Default::default())
        }
    }

    impl DafnyPrint
        for index {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for index {
        type Target = u8;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl index {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &u8) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for index {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for index {
        type Output = index;
        fn add(self, other: Self) -> Self {
            index(self.0 + other.0)
        }
    }

    impl Sub
        for index {
        type Output = index;
        fn sub(self, other: Self) -> Self {
            index(self.0 - other.0)
        }
    }

    impl Mul
        for index {
        type Output = index;
        fn mul(self, other: Self) -> Self {
            index(self.0 * other.0)
        }
    }

    impl Div
        for index {
        type Output = index;
        fn div(self, other: Self) -> Self {
            index(self.0 / other.0)
        }
    }

    impl PartialOrd
        for index {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/StandardLibrary/src/Base64.dfy(19,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct uint24(pub u32);

    impl uint24 {
        /// Constraint check
        pub fn is(_source: u32) -> bool {
            let mut x: DafnyInt = int!(_source.clone());
            return int!(0) <= x.clone() && x.clone() < int!(b"16777216");
        }
    }

    impl Default
        for uint24 {
        /// An element of uint24
        fn default() -> Self {
            uint24(Default::default())
        }
    }

    impl DafnyPrint
        for uint24 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for uint24 {
        type Target = u32;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl uint24 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &u32) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for uint24 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for uint24 {
        type Output = uint24;
        fn add(self, other: Self) -> Self {
            uint24(self.0 + other.0)
        }
    }

    impl Sub
        for uint24 {
        type Output = uint24;
        fn sub(self, other: Self) -> Self {
            uint24(self.0 - other.0)
        }
    }

    impl Mul
        for uint24 {
        type Output = uint24;
        fn mul(self, other: Self) -> Self {
            uint24(self.0 * other.0)
        }
    }

    impl Div
        for uint24 {
        type Output = uint24;
        fn div(self, other: Self) -> Self {
            uint24(self.0 / other.0)
        }
    }

    impl PartialOrd
        for uint24 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }
}
/// ../mpl/StandardLibrary/src/Base64Lemmas.dfy(8,1)
pub mod _Base64Lemmas_Compile {

}
/// ../mpl/libraries/src/BoundedInts.dfy(3,1)
pub mod _BoundedInts_Compile {
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::int;
    pub use ::std::default::Default;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::fmt::Formatter;
    pub use ::std::fmt::Result;
    pub use ::std::ops::Deref;
    pub use ::std::mem::transmute;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::ops::Add;
    pub use ::std::ops::Sub;
    pub use ::std::ops::Mul;
    pub use ::std::ops::Div;
    pub use ::std::cmp::PartialOrd;
    pub use ::std::option::Option;
    pub use ::std::cmp::Ordering;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/BoundedInts.dfy(9,3)
        pub fn TWO_TO_THE_8() -> DafnyInt {
            int!(256)
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(37,3)
        pub fn UINT8_MAX() -> u8 {
            255
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(10,3)
        pub fn TWO_TO_THE_16() -> DafnyInt {
            int!(b"65536")
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(38,3)
        pub fn UINT16_MAX() -> u16 {
            65535
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(12,3)
        pub fn TWO_TO_THE_32() -> DafnyInt {
            int!(b"4294967296")
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(39,3)
        pub fn UINT32_MAX() -> u32 {
            4294967295
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(16,3)
        pub fn TWO_TO_THE_64() -> DafnyInt {
            int!(b"18446744073709551616")
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(40,3)
        pub fn UINT64_MAX() -> u64 {
            18446744073709551615
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(42,3)
        pub fn INT8_MIN() -> i8 {
            -128
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(43,3)
        pub fn INT8_MAX() -> i8 {
            127
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(44,3)
        pub fn INT16_MIN() -> i16 {
            -32768
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(45,3)
        pub fn INT16_MAX() -> i16 {
            32767
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(46,3)
        pub fn INT32_MIN() -> i32 {
            -2147483648
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(47,3)
        pub fn INT32_MAX() -> i32 {
            2147483647
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(48,3)
        pub fn INT64_MIN() -> i64 {
            -9223372036854775808
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(49,3)
        pub fn INT64_MAX() -> i64 {
            9223372036854775807
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(51,3)
        pub fn NAT8_MAX() -> u8 {
            127
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(52,3)
        pub fn NAT16_MAX() -> u16 {
            32767
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(53,3)
        pub fn NAT32_MAX() -> u32 {
            2147483647
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(54,3)
        pub fn NAT64_MAX() -> u64 {
            9223372036854775807
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(4,3)
        pub fn TWO_TO_THE_0() -> DafnyInt {
            int!(1)
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(5,3)
        pub fn TWO_TO_THE_1() -> DafnyInt {
            int!(2)
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(6,3)
        pub fn TWO_TO_THE_2() -> DafnyInt {
            int!(4)
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(7,3)
        pub fn TWO_TO_THE_4() -> DafnyInt {
            int!(16)
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(8,3)
        pub fn TWO_TO_THE_5() -> DafnyInt {
            int!(32)
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(11,3)
        pub fn TWO_TO_THE_24() -> DafnyInt {
            int!(b"16777216")
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(13,3)
        pub fn TWO_TO_THE_40() -> DafnyInt {
            int!(b"1099511627776")
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(14,3)
        pub fn TWO_TO_THE_48() -> DafnyInt {
            int!(b"281474976710656")
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(15,3)
        pub fn TWO_TO_THE_56() -> DafnyInt {
            int!(b"72057594037927936")
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(17,3)
        pub fn TWO_TO_THE_128() -> DafnyInt {
            int!(b"340282366920938463463374607431768211456")
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(18,3)
        pub fn TWO_TO_THE_256() -> DafnyInt {
            int!(b"115792089237316195423570985008687907853269984665640564039457584007913129639936")
        }
        /// ../mpl/libraries/src/BoundedInts.dfy(19,3)
        pub fn TWO_TO_THE_512() -> DafnyInt {
            int!(b"13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084096")
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(22,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct uint8(pub u8);

    impl uint8 {
        /// Constraint check
        pub fn is(_source: u8) -> bool {
            return true;
        }
    }

    impl Default
        for uint8 {
        /// An element of uint8
        fn default() -> Self {
            uint8(Default::default())
        }
    }

    impl DafnyPrint
        for uint8 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for uint8 {
        type Target = u8;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl uint8 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &u8) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for uint8 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for uint8 {
        type Output = uint8;
        fn add(self, other: Self) -> Self {
            uint8(self.0 + other.0)
        }
    }

    impl Sub
        for uint8 {
        type Output = uint8;
        fn sub(self, other: Self) -> Self {
            uint8(self.0 - other.0)
        }
    }

    impl Mul
        for uint8 {
        type Output = uint8;
        fn mul(self, other: Self) -> Self {
            uint8(self.0 * other.0)
        }
    }

    impl Div
        for uint8 {
        type Output = uint8;
        fn div(self, other: Self) -> Self {
            uint8(self.0 / other.0)
        }
    }

    impl PartialOrd
        for uint8 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(23,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct uint16(pub u16);

    impl uint16 {
        /// Constraint check
        pub fn is(_source: u16) -> bool {
            return true;
        }
    }

    impl Default
        for uint16 {
        /// An element of uint16
        fn default() -> Self {
            uint16(Default::default())
        }
    }

    impl DafnyPrint
        for uint16 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for uint16 {
        type Target = u16;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl uint16 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &u16) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for uint16 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for uint16 {
        type Output = uint16;
        fn add(self, other: Self) -> Self {
            uint16(self.0 + other.0)
        }
    }

    impl Sub
        for uint16 {
        type Output = uint16;
        fn sub(self, other: Self) -> Self {
            uint16(self.0 - other.0)
        }
    }

    impl Mul
        for uint16 {
        type Output = uint16;
        fn mul(self, other: Self) -> Self {
            uint16(self.0 * other.0)
        }
    }

    impl Div
        for uint16 {
        type Output = uint16;
        fn div(self, other: Self) -> Self {
            uint16(self.0 / other.0)
        }
    }

    impl PartialOrd
        for uint16 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(24,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct uint32(pub u32);

    impl uint32 {
        /// Constraint check
        pub fn is(_source: u32) -> bool {
            return true;
        }
    }

    impl Default
        for uint32 {
        /// An element of uint32
        fn default() -> Self {
            uint32(Default::default())
        }
    }

    impl DafnyPrint
        for uint32 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for uint32 {
        type Target = u32;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl uint32 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &u32) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for uint32 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for uint32 {
        type Output = uint32;
        fn add(self, other: Self) -> Self {
            uint32(self.0 + other.0)
        }
    }

    impl Sub
        for uint32 {
        type Output = uint32;
        fn sub(self, other: Self) -> Self {
            uint32(self.0 - other.0)
        }
    }

    impl Mul
        for uint32 {
        type Output = uint32;
        fn mul(self, other: Self) -> Self {
            uint32(self.0 * other.0)
        }
    }

    impl Div
        for uint32 {
        type Output = uint32;
        fn div(self, other: Self) -> Self {
            uint32(self.0 / other.0)
        }
    }

    impl PartialOrd
        for uint32 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(25,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct uint64(pub u64);

    impl uint64 {
        /// Constraint check
        pub fn is(_source: u64) -> bool {
            return true;
        }
    }

    impl Default
        for uint64 {
        /// An element of uint64
        fn default() -> Self {
            uint64(Default::default())
        }
    }

    impl DafnyPrint
        for uint64 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for uint64 {
        type Target = u64;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl uint64 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &u64) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for uint64 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for uint64 {
        type Output = uint64;
        fn add(self, other: Self) -> Self {
            uint64(self.0 + other.0)
        }
    }

    impl Sub
        for uint64 {
        type Output = uint64;
        fn sub(self, other: Self) -> Self {
            uint64(self.0 - other.0)
        }
    }

    impl Mul
        for uint64 {
        type Output = uint64;
        fn mul(self, other: Self) -> Self {
            uint64(self.0 * other.0)
        }
    }

    impl Div
        for uint64 {
        type Output = uint64;
        fn div(self, other: Self) -> Self {
            uint64(self.0 / other.0)
        }
    }

    impl PartialOrd
        for uint64 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(27,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct int8(pub i8);

    impl int8 {
        /// Constraint check
        pub fn is(_source: i8) -> bool {
            return true;
        }
    }

    impl Default
        for int8 {
        /// An element of int8
        fn default() -> Self {
            int8(Default::default())
        }
    }

    impl DafnyPrint
        for int8 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for int8 {
        type Target = i8;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl int8 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &i8) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for int8 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for int8 {
        type Output = int8;
        fn add(self, other: Self) -> Self {
            int8(self.0 + other.0)
        }
    }

    impl Sub
        for int8 {
        type Output = int8;
        fn sub(self, other: Self) -> Self {
            int8(self.0 - other.0)
        }
    }

    impl Mul
        for int8 {
        type Output = int8;
        fn mul(self, other: Self) -> Self {
            int8(self.0 * other.0)
        }
    }

    impl Div
        for int8 {
        type Output = int8;
        fn div(self, other: Self) -> Self {
            int8(self.0 / other.0)
        }
    }

    impl PartialOrd
        for int8 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(28,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct int16(pub i16);

    impl int16 {
        /// Constraint check
        pub fn is(_source: i16) -> bool {
            return true;
        }
    }

    impl Default
        for int16 {
        /// An element of int16
        fn default() -> Self {
            int16(Default::default())
        }
    }

    impl DafnyPrint
        for int16 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for int16 {
        type Target = i16;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl int16 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &i16) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for int16 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for int16 {
        type Output = int16;
        fn add(self, other: Self) -> Self {
            int16(self.0 + other.0)
        }
    }

    impl Sub
        for int16 {
        type Output = int16;
        fn sub(self, other: Self) -> Self {
            int16(self.0 - other.0)
        }
    }

    impl Mul
        for int16 {
        type Output = int16;
        fn mul(self, other: Self) -> Self {
            int16(self.0 * other.0)
        }
    }

    impl Div
        for int16 {
        type Output = int16;
        fn div(self, other: Self) -> Self {
            int16(self.0 / other.0)
        }
    }

    impl PartialOrd
        for int16 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(29,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct int32(pub i32);

    impl int32 {
        /// Constraint check
        pub fn is(_source: i32) -> bool {
            return true;
        }
    }

    impl Default
        for int32 {
        /// An element of int32
        fn default() -> Self {
            int32(Default::default())
        }
    }

    impl DafnyPrint
        for int32 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for int32 {
        type Target = i32;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl int32 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &i32) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for int32 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for int32 {
        type Output = int32;
        fn add(self, other: Self) -> Self {
            int32(self.0 + other.0)
        }
    }

    impl Sub
        for int32 {
        type Output = int32;
        fn sub(self, other: Self) -> Self {
            int32(self.0 - other.0)
        }
    }

    impl Mul
        for int32 {
        type Output = int32;
        fn mul(self, other: Self) -> Self {
            int32(self.0 * other.0)
        }
    }

    impl Div
        for int32 {
        type Output = int32;
        fn div(self, other: Self) -> Self {
            int32(self.0 / other.0)
        }
    }

    impl PartialOrd
        for int32 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(30,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct int64(pub i64);

    impl int64 {
        /// Constraint check
        pub fn is(_source: i64) -> bool {
            return true;
        }
    }

    impl Default
        for int64 {
        /// An element of int64
        fn default() -> Self {
            int64(Default::default())
        }
    }

    impl DafnyPrint
        for int64 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for int64 {
        type Target = i64;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl int64 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &i64) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for int64 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for int64 {
        type Output = int64;
        fn add(self, other: Self) -> Self {
            int64(self.0 + other.0)
        }
    }

    impl Sub
        for int64 {
        type Output = int64;
        fn sub(self, other: Self) -> Self {
            int64(self.0 - other.0)
        }
    }

    impl Mul
        for int64 {
        type Output = int64;
        fn mul(self, other: Self) -> Self {
            int64(self.0 * other.0)
        }
    }

    impl Div
        for int64 {
        type Output = int64;
        fn div(self, other: Self) -> Self {
            int64(self.0 / other.0)
        }
    }

    impl PartialOrd
        for int64 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(32,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct nat8(pub u8);

    impl nat8 {
        /// Constraint check
        pub fn is(_source: u8) -> bool {
            let mut x: DafnyInt = int!(_source.clone());
            return int!(0) <= x.clone() && x.clone() < int!(128);
        }
    }

    impl Default
        for nat8 {
        /// An element of nat8
        fn default() -> Self {
            nat8(Default::default())
        }
    }

    impl DafnyPrint
        for nat8 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for nat8 {
        type Target = u8;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl nat8 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &u8) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for nat8 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for nat8 {
        type Output = nat8;
        fn add(self, other: Self) -> Self {
            nat8(self.0 + other.0)
        }
    }

    impl Sub
        for nat8 {
        type Output = nat8;
        fn sub(self, other: Self) -> Self {
            nat8(self.0 - other.0)
        }
    }

    impl Mul
        for nat8 {
        type Output = nat8;
        fn mul(self, other: Self) -> Self {
            nat8(self.0 * other.0)
        }
    }

    impl Div
        for nat8 {
        type Output = nat8;
        fn div(self, other: Self) -> Self {
            nat8(self.0 / other.0)
        }
    }

    impl PartialOrd
        for nat8 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(33,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct nat16(pub u16);

    impl nat16 {
        /// Constraint check
        pub fn is(_source: u16) -> bool {
            let mut x: DafnyInt = int!(_source.clone());
            return int!(0) <= x.clone() && x.clone() < int!(b"32768");
        }
    }

    impl Default
        for nat16 {
        /// An element of nat16
        fn default() -> Self {
            nat16(Default::default())
        }
    }

    impl DafnyPrint
        for nat16 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for nat16 {
        type Target = u16;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl nat16 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &u16) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for nat16 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for nat16 {
        type Output = nat16;
        fn add(self, other: Self) -> Self {
            nat16(self.0 + other.0)
        }
    }

    impl Sub
        for nat16 {
        type Output = nat16;
        fn sub(self, other: Self) -> Self {
            nat16(self.0 - other.0)
        }
    }

    impl Mul
        for nat16 {
        type Output = nat16;
        fn mul(self, other: Self) -> Self {
            nat16(self.0 * other.0)
        }
    }

    impl Div
        for nat16 {
        type Output = nat16;
        fn div(self, other: Self) -> Self {
            nat16(self.0 / other.0)
        }
    }

    impl PartialOrd
        for nat16 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(34,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct nat32(pub u32);

    impl nat32 {
        /// Constraint check
        pub fn is(_source: u32) -> bool {
            let mut x: DafnyInt = int!(_source.clone());
            return int!(0) <= x.clone() && x.clone() < int!(b"2147483648");
        }
    }

    impl Default
        for nat32 {
        /// An element of nat32
        fn default() -> Self {
            nat32(Default::default())
        }
    }

    impl DafnyPrint
        for nat32 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for nat32 {
        type Target = u32;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl nat32 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &u32) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for nat32 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for nat32 {
        type Output = nat32;
        fn add(self, other: Self) -> Self {
            nat32(self.0 + other.0)
        }
    }

    impl Sub
        for nat32 {
        type Output = nat32;
        fn sub(self, other: Self) -> Self {
            nat32(self.0 - other.0)
        }
    }

    impl Mul
        for nat32 {
        type Output = nat32;
        fn mul(self, other: Self) -> Self {
            nat32(self.0 * other.0)
        }
    }

    impl Div
        for nat32 {
        type Output = nat32;
        fn div(self, other: Self) -> Self {
            nat32(self.0 / other.0)
        }
    }

    impl PartialOrd
        for nat32 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(35,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct nat64(pub u64);

    impl nat64 {
        /// Constraint check
        pub fn is(_source: u64) -> bool {
            let mut x: DafnyInt = int!(_source.clone());
            return int!(0) <= x.clone() && x.clone() < int!(b"9223372036854775808");
        }
    }

    impl Default
        for nat64 {
        /// An element of nat64
        fn default() -> Self {
            nat64(Default::default())
        }
    }

    impl DafnyPrint
        for nat64 {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for nat64 {
        type Target = u64;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl nat64 {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &u64) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for nat64 {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for nat64 {
        type Output = nat64;
        fn add(self, other: Self) -> Self {
            nat64(self.0 + other.0)
        }
    }

    impl Sub
        for nat64 {
        type Output = nat64;
        fn sub(self, other: Self) -> Self {
            nat64(self.0 - other.0)
        }
    }

    impl Mul
        for nat64 {
        type Output = nat64;
        fn mul(self, other: Self) -> Self {
            nat64(self.0 * other.0)
        }
    }

    impl Div
        for nat64 {
        type Output = nat64;
        fn div(self, other: Self) -> Self {
            nat64(self.0 / other.0)
        }
    }

    impl PartialOrd
        for nat64 {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }

    /// ../mpl/libraries/src/BoundedInts.dfy(58,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct opt_byte(pub i16);

    impl opt_byte {
        /// Constraint check
        pub fn is(_source: i16) -> bool {
            let mut c: DafnyInt = int!(_source.clone());
            return int!(-1) <= c.clone() && c.clone() < _default::TWO_TO_THE_8();
        }
    }

    impl Default
        for opt_byte {
        /// An element of opt_byte
        fn default() -> Self {
            opt_byte(Default::default())
        }
    }

    impl DafnyPrint
        for opt_byte {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for opt_byte {
        type Target = i16;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl opt_byte {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &i16) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for opt_byte {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for opt_byte {
        type Output = opt_byte;
        fn add(self, other: Self) -> Self {
            opt_byte(self.0 + other.0)
        }
    }

    impl Sub
        for opt_byte {
        type Output = opt_byte;
        fn sub(self, other: Self) -> Self {
            opt_byte(self.0 - other.0)
        }
    }

    impl Mul
        for opt_byte {
        type Output = opt_byte;
        fn mul(self, other: Self) -> Self {
            opt_byte(self.0 * other.0)
        }
    }

    impl Div
        for opt_byte {
        type Output = opt_byte;
        fn div(self, other: Self) -> Self {
            opt_byte(self.0 / other.0)
        }
    }

    impl PartialOrd
        for opt_byte {
        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(7,1)
pub mod _CMM_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use ::dafny_runtime::itertools::Itertools;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use ::dafny_runtime::Map;
    pub use ::dafny_runtime::map;
    pub use ::dafny_runtime::Any;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::UpcastObject;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(76,3)
        pub fn _RequiredEncryptionContextKeys_q(requiredEncryptionContextKeys: &Arc<Option<Sequence<ValidUTF8Bytes>>>, encryptionMaterials: &Arc<EncryptionMaterials>) -> bool {
            Itertools::unique((&requiredEncryptionContextKeys.UnwrapOr(&(seq![] as Sequence<ValidUTF8Bytes>))).iter()).all(({
                    let mut encryptionMaterials = encryptionMaterials.clone();
                    let mut requiredEncryptionContextKeys = requiredEncryptionContextKeys.clone();
                    Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{
                            let mut k: ValidUTF8Bytes = __forall_var_0.clone();
                            if {
                                    let i: Sequence<u8> = k.clone();
                                    crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                } {
                                !requiredEncryptionContextKeys.UnwrapOr(&(seq![] as Sequence<ValidUTF8Bytes>)).contains(&k) || encryptionMaterials.requiredEncryptionContextKeys().contains(&k)
                            } else {
                                true
                            }
                        })
                }).as_ref())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(81,3)
        pub fn EncryptionContextComplete(input: &Arc<DecryptMaterialsInput>, decryptionMaterials: &Arc<DecryptionMaterials>) -> bool {
            let mut reproducedEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = input.reproducedEncryptionContext().UnwrapOr(&map![]);
            (&reproducedEncryptionContext).keys().iter().all(({
                    let mut decryptionMaterials = decryptionMaterials.clone();
                    let mut reproducedEncryptionContext = reproducedEncryptionContext.clone();
                    Arc::new(move |__forall_var_0: &ValidUTF8Bytes| -> bool{
                            let mut k: Sequence<u8> = __forall_var_0.clone();
                            !reproducedEncryptionContext.contains(&k) || decryptionMaterials.encryptionContext().contains(&k) && decryptionMaterials.encryptionContext().get(&k) == reproducedEncryptionContext.get(&k)
                        })
                }).as_ref())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(89,3)
        pub fn _ReproducedEncryptionContext_q(input: &Arc<DecryptMaterialsInput>) -> bool {
            let mut reproducedEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = input.reproducedEncryptionContext().UnwrapOr(&map![]);
            (&reproducedEncryptionContext).keys().iter().all(({
                    let mut reproducedEncryptionContext = reproducedEncryptionContext.clone();
                    let mut input = input.clone();
                    Arc::new(move |__forall_var_0: &ValidUTF8Bytes| -> bool{
                            let mut k: Sequence<u8> = __forall_var_0.clone();
                            !(reproducedEncryptionContext.contains(&k) && input.encryptionContext().contains(&k)) || input.encryptionContext().get(&k) == reproducedEncryptionContext.get(&k)
                        })
                }).as_ref())
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMM.dfy(12,3)
    pub trait VerifiableInterface: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> + ICryptographicMaterialsManager + UpcastObject<dyn ICryptographicMaterialsManager> {}
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/CacheConstants.dfy(6,1)
pub mod _CacheConstants_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::seq;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/CacheConstants.dfy(13,3)
        pub fn NULL_BYTE() -> Sequence<u8> {
            seq![0]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/CacheConstants.dfy(16,3)
        pub fn RESOURCE_ID_CACHING_CMM() -> Sequence<u8> {
            seq![1]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/CacheConstants.dfy(17,3)
        pub fn RESOURCE_ID_HIERARCHICAL_KEYRING() -> Sequence<u8> {
            seq![2]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/CacheConstants.dfy(20,3)
        pub fn SCOPE_ID_ENCRYPT() -> Sequence<u8> {
            seq![1]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/CacheConstants.dfy(21,3)
        pub fn SCOPE_ID_DECRYPT() -> Sequence<u8> {
            seq![2]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/CacheConstants.dfy(22,3)
        pub fn SCOPE_ID_SEARCHABLE_ENCRYPTION() -> Sequence<u8> {
            seq![3]
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CanonicalEncryptionContext.dfy(6,1)
pub mod _CanonicalEncryptionContext_Compile {
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::seq;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CanonicalEncryptionContext.dfy(23,3)
        pub fn EncryptionContextToAAD(encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(encryptionContext.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Encryption Context is too large")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Sequence<u8>>()
            } else {
                let mut keys: Sequence<Sequence<u8>> = crate::implementation_from_dafny::SortedSets::_default::SetToOrderedSequence2::<u8>(&encryptionContext.keys(), &(Arc::new(move |x0: &u8,x1: &u8| crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt8Less(x0.clone(), x1.clone())) as Arc<dyn ::std::ops::Fn(&_, &_) -> _ + Sync + Send>));
                if truncate!(keys.cardinality(), u16) == 0 {
                    Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: seq![] as Sequence<u8>
                        })
                } else {
                    let mut KeyIntoPairBytes: Arc<dyn ::std::ops::Fn(&Sequence<u8>) -> Arc<Result<Sequence<u8>, Arc<Error>>> + Sync + Send> = {
                            let encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = encryptionContext.clone();
                            {
                                let mut encryptionContext = encryptionContext.clone();
                                Arc::new(move |k: &Sequence<u8>| -> Arc<Result<Sequence<u8>, Arc<Error>>>{
                                        {
                                            let __pat_let3_0: ValidUTF8Bytes = encryptionContext.get(k);
                                            {
                                                let v: ValidUTF8Bytes = __pat_let3_0.clone();
                                                {
                                                    let __pat_let4_0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint16Len::<u8>(k) && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint16Len::<u8>(&v), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                                                    message: string_utf16_of("Unable to serialize encryption context")
                                                                }));
                                                    {
                                                        let valueOrError1: Arc<Outcome<Arc<Error>>> = __pat_let4_0.clone();
                                                        if valueOrError1.IsFailure() {
                                                            valueOrError1.PropagateFailure::<Sequence<u8>>()
                                                        } else {
                                                            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                                                                    value: crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt16ToSeq(truncate!(k.cardinality(), u16)).concat(k).concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt16ToSeq(truncate!(v.cardinality(), u16))).concat(&v)
                                                                })
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    })
                            }
                        };
                    let mut valueOrError2: Arc<Result<Sequence<Sequence<u8>>, Arc<Error>>> = crate::implementation_from_dafny::_Seq_Compile::_default::MapWithResult::<Sequence<u8>, Sequence<u8>, Arc<Error>>(&KeyIntoPairBytes, &keys);
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Sequence<u8>>()
                    } else {
                        let mut pairsBytes: Sequence<Sequence<u8>> = valueOrError2.Extract();
                        let mut allBytes: Sequence<u8> = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt16ToSeq(truncate!(keys.cardinality(), u16)).concat(&crate::implementation_from_dafny::_Seq_Compile::_default::Flatten::<u8>(&pairsBytes));
                        Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                                value: allBytes.clone()
                            })
                    }
                }
            }
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Commitment.dfy(11,1)
pub mod _Commitment_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::_AlgorithmSuites_Compile::AlgorithmSuite;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DBECommitmentPolicy;

    pub struct _default {}

    impl _default {
        /// Failure: Commitment policy forbids encrypting with commitment but the
        /// algorithm provides it
        /// = aws-encryption-sdk-specification/framework/commitment-policy.md#esdk-forbid-encrypt-allow-decrypt
        /// = type=test
        /// # - [Get Encryption Materials](./cmm-interface.md#get-encryption-materials) MUST only support algorithm suites that have a [Key Commitment](./algorithm-suites.md#algorithm-suites-encryption-key-derivation-settings) value of False
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Commitment.dfy(20,3)
        pub fn ValidateCommitmentPolicyOnEncrypt(algorithm: &Arc<AlgorithmSuiteId>, commitmentPolicy: &Arc<CommitmentPolicy>) -> Arc<Outcome<Arc<Error>>> {
            let mut suite: AlgorithmSuite = crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetSuite(algorithm);
            if commitmentPolicy.clone() == Arc::new(CommitmentPolicy::ESDK {
                        ESDK: Arc::new(ESDKCommitmentPolicy::FORBID_ENCRYPT_ALLOW_DECRYPT {})
                    }) && !matches!(suite.commitment().as_ref(), None{ .. }) {
                Arc::new(Outcome::<Arc<Error>>::Fail {
                        error: Arc::new(Error::InvalidAlgorithmSuiteInfoOnEncrypt {
                                    message: string_utf16_of("Configuration conflict. Commitment policy requires only non-committing algorithm suites")
                                })
                    })
            } else {
                if (commitmentPolicy.clone() == Arc::new(CommitmentPolicy::ESDK {
                                ESDK: Arc::new(ESDKCommitmentPolicy::REQUIRE_ENCRYPT_ALLOW_DECRYPT {})
                            }) || commitmentPolicy.clone() == Arc::new(CommitmentPolicy::ESDK {
                                ESDK: Arc::new(ESDKCommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT {})
                            }) || commitmentPolicy.clone() == Arc::new(CommitmentPolicy::DBE {
                                DBE: Arc::new(DBECommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT {})
                            })) && matches!(suite.commitment().as_ref(), None{ .. }) {
                    Arc::new(Outcome::<Arc<Error>>::Fail {
                            error: Arc::new(Error::InvalidAlgorithmSuiteInfoOnEncrypt {
                                        message: string_utf16_of("Configuration conflict. Commitment policy requires only committing algorithm suites")
                                    })
                        })
                } else {
                    Arc::new(Outcome::<Arc<Error>>::Pass {})
                }
            }
        }
        /// Failure: Commitment policy requires decrypting with commitment but the
        /// algorithm does not provide it
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Commitment.dfy(123,3)
        pub fn ValidateCommitmentPolicyOnDecrypt(algorithm: &Arc<AlgorithmSuiteId>, commitmentPolicy: &Arc<CommitmentPolicy>) -> Arc<Outcome<Arc<Error>>> {
            let mut suite: AlgorithmSuite = crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetSuite(algorithm);
            if true && (commitmentPolicy.clone() == Arc::new(CommitmentPolicy::ESDK {
                            ESDK: Arc::new(ESDKCommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT {})
                        }) || commitmentPolicy.clone() == Arc::new(CommitmentPolicy::DBE {
                            DBE: Arc::new(DBECommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT {})
                        })) && matches!(suite.commitment().as_ref(), None{ .. }) {
                Arc::new(Outcome::<Arc<Error>>::Fail {
                        error: Arc::new(Error::InvalidAlgorithmSuiteInfoOnDecrypt {
                                    message: string_utf16_of("Configuration conflict. Commitment policy requires only committing algorithm suites")
                                })
                    })
            } else {
                Arc::new(Outcome::<Arc<Error>>::Pass {})
            }
        }
    }
}
/// ../mpl/StandardLibrary/src/ConcurrentCall.dfy(26,1)
pub mod ConcurrentCall {
    pub use ::dafny_runtime::Any;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::UpcastObject;
    pub use crate::implementation_from_dafny::_dafny_externs::ConcurrentCall::*;

    /// ../mpl/StandardLibrary/src/ConcurrentCall.dfy(31,3)
    pub trait Callee: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> {
        /// ../mpl/StandardLibrary/src/ConcurrentCall.dfy(35,5)
        fn call(&self, serialPos: u32, concurrentPos: u32) -> ();
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(7,1)
pub mod _Constants_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::std::fmt::Result;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(27,3)
        pub fn ECDH_PROVIDER_INFO_RPL_INDEX() -> u32 {
            1
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(29,3)
        pub fn ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN() -> u64 {
            4
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(28,3)
        pub fn ECDH_PROVIDER_INFO_RPK_INDEX() -> u32 {
            _default::ECDH_PROVIDER_INFO_RPL_INDEX() + _default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN() as u32
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(39,3)
        pub fn ECDH_AES_256_ENC_KEY_LENGTH() -> i32 {
            32
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(40,3)
        pub fn ECDH_AES_256_ENC_TAG_LENGTH() -> i32 {
            16
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(41,3)
        pub fn ECDH_AES_256_ENC_IV_LENGTH() -> i32 {
            12
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(42,3)
        pub fn ECDH_AES_256_ENC_ALG() -> Arc<AES_GCM> {
            Arc::new(AES_GCM::AES_GCM {
                    keyLength: _default::ECDH_AES_256_ENC_KEY_LENGTH(),
                    tagLength: _default::ECDH_AES_256_ENC_TAG_LENGTH(),
                    ivLength: _default::ECDH_AES_256_ENC_IV_LENGTH()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(52,3)
        pub fn PROVIDER_ID() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![97, 119, 115, 45, 107, 109, 115];
            s.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(14,3)
        pub fn UINT32_TO_SEQ_LEN() -> u64 {
            4
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(15,3)
        pub fn KDF_SALT_LEN() -> i32 {
            32
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(16,3)
        pub fn KDF_EXPECTED_LEN() -> i32 {
            64
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(17,3)
        pub fn ECDH_COMMITMENT_KEY_LENGTH() -> u64 {
            32
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(18,3)
        pub fn ECDH_COMMITMENT_KEY_INDEX() -> u64 {
            32
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(19,3)
        pub fn ECDH_WRAPPED_KEY_MATERIAL_INDEX() -> u64 {
            64
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(20,3)
        pub fn ECDH_KDF_STRING() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("ecdh-key-derivation")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(21,3)
        pub fn ECDH_KDF_PRF_STRING() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("HMAC_SHA384")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(22,3)
        pub fn ECDH_KDF_DELIMITER() -> Sequence<u8> {
            seq![0]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(24,3)
        pub fn ECDH_PROVIDER_INFO_256_LEN() -> u32 {
            75
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(25,3)
        pub fn ECDH_PROVIDER_INFO_384_LEN() -> u32 {
            107
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(26,3)
        pub fn ECDH_PROVIDER_INFO_521_LEN() -> u32 {
            143
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(30,3)
        pub fn ECDH_PUBLIC_KEY_LEN_ECC_NIST_256() -> u64 {
            91
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(31,3)
        pub fn ECDH_PUBLIC_KEY_LEN_ECC_NIST_384() -> u64 {
            120
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(32,3)
        pub fn ECDH_PUBLIC_KEY_LEN_ECC_NIST_521() -> u64 {
            158
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(34,3)
        pub fn ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_256() -> u64 {
            33
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(35,3)
        pub fn ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_384() -> u64 {
            49
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(36,3)
        pub fn ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_521() -> u64 {
            67
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(38,3)
        pub fn CIPHERTEXT_WRAPPED_MATERIAL_INDEX() -> u64 {
            68
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(58,3)
        pub fn PROVIDER_ID_HIERARCHY() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![97, 119, 115, 45, 107, 109, 115, 45, 104, 105, 101, 114, 97, 114, 99, 104, 121];
            s.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(65,3)
        pub fn RSA_PROVIDER_ID() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![97, 119, 115, 45, 107, 109, 115, 45, 114, 115, 97];
            s.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(71,3)
        pub fn KMS_ECDH_PROVIDER_ID() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![97, 119, 115, 45, 107, 109, 115, 45, 101, 99, 100, 104];
            s.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(77,3)
        pub fn RAW_ECDH_PROVIDER_ID() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![114, 97, 119, 45, 101, 99, 100, 104];
            s.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(83,3)
        pub fn ECDH_KDF_PRF_NAME() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![72, 77, 65, 67, 95, 83, 72, 65, 51, 56, 52];
            s.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(89,3)
        pub fn ECDH_KDF_UTF8() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![101, 99, 100, 104, 45, 107, 101, 121, 45, 100, 101, 114, 105, 118, 97, 116, 105, 111, 110];
            s.clone()
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(94,3)
    pub type AwsKmsEncryptedDataKey = Arc<EncryptedDataKey>;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/Constants.dfy(106,3)
    #[derive(PartialEq, Clone)]
    pub enum AwsKmsEdkHelper {
        AwsKmsEdkHelper {
            edk: AwsKmsEncryptedDataKey,
            arn: AwsKmsArn
        }
    }

    impl AwsKmsEdkHelper {
        /// Returns a borrow of the field edk
        pub fn edk(&self) -> &AwsKmsEncryptedDataKey {
            match self {
                AwsKmsEdkHelper::AwsKmsEdkHelper{edk, arn, } => edk,
            }
        }
        /// Returns a borrow of the field arn
        pub fn arn(&self) -> &AwsKmsArn {
            match self {
                AwsKmsEdkHelper::AwsKmsEdkHelper{edk, arn, } => arn,
            }
        }
    }

    impl Debug
        for AwsKmsEdkHelper {
        fn fmt(&self, f: &mut Formatter) -> Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for AwsKmsEdkHelper {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                AwsKmsEdkHelper::AwsKmsEdkHelper{edk, arn, } => {
                    write!(_formatter, "Constants_Compile.AwsKmsEdkHelper.AwsKmsEdkHelper(")?;
                    DafnyPrint::fmt_print(edk, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(arn, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for AwsKmsEdkHelper {}

    impl Hash
        for AwsKmsEdkHelper {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                AwsKmsEdkHelper::AwsKmsEdkHelper{edk, arn, } => {
                    Hash::hash(edk, _state);
                    Hash::hash(arn, _state)
                },
            }
        }
    }

    impl Default
        for AwsKmsEdkHelper {
        fn default() -> AwsKmsEdkHelper {
            AwsKmsEdkHelper::AwsKmsEdkHelper {
                edk: Default::default(),
                arn: Default::default()
            }
        }
    }

    impl AsRef<AwsKmsEdkHelper>
        for AwsKmsEdkHelper {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/CreateKeyStoreTable.dfy(7,1)
pub mod _CreateKeyStoreTable_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableDescription;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeDefinition;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchemaElement;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableOutput;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::DescribeTableInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error::ResourceNotFoundException;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateTableOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::CreateTableInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::LocalSecondaryIndex;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GlobalSecondaryIndex;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::BillingMode;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ProvisionedThroughput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::StreamSpecification;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::SSESpecification;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Tag;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TableClass;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::OnDemandThroughput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ScalarAttributeType;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeySchema;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::KeyType;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/CreateKeyStoreTable.dfy(34,3)
        pub fn _keyStoreHasExpectedConstruction_q(t: &Arc<TableDescription>) -> bool {
            matches!(t.AttributeDefinitions().as_ref(), Some{ .. }) && matches!(t.KeySchema().as_ref(), Some{ .. }) && matches!(t.TableName().as_ref(), Some{ .. }) && matches!(t.TableArn().as_ref(), Some{ .. }) && crate::implementation_from_dafny::_Seq_Compile::_default::ToSet::<Arc<AttributeDefinition>>(&_default::ATTRIBUTE_DEFINITIONS()) <= crate::implementation_from_dafny::_Seq_Compile::_default::ToSet::<Arc<AttributeDefinition>>(t.AttributeDefinitions().value()) && crate::implementation_from_dafny::_Seq_Compile::_default::ToSet::<Arc<KeySchemaElement>>(&_default::KEY_SCHEMA()) <= crate::implementation_from_dafny::_Seq_Compile::_default::ToSet::<Arc<KeySchemaElement>>(t.KeySchema().value())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/CreateKeyStoreTable.dfy(43,3)
        pub fn CreateKeyStoreTable(tableName: &Sequence<DafnyCharUTF16>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>>::new();
            let mut maybeDescribeTableResponse: Arc<Result<Arc<DescribeTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<DescribeTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>> = IDynamoDBClient::DescribeTable(rd!(ddbClient.clone()), &Arc::new(DescribeTableInput::DescribeTableInput {
                            TableName: tableName.clone()
                        }));
            maybeDescribeTableResponse = _out0.clone();
            if matches!((&maybeDescribeTableResponse).as_ref(), Failure{ .. }) {
                let mut error: Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error> = maybeDescribeTableResponse.error().clone();
                if matches!((&error).as_ref(), ResourceNotFoundException{ .. }) {
                    let mut maybeCreateTableResponse: Arc<Result<Arc<CreateTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
                    let mut _out1: Arc<Result<Arc<CreateTableOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>> = IDynamoDBClient::CreateTable(rd!(ddbClient.clone()), &Arc::new(CreateTableInput::CreateTableInput {
                                    AttributeDefinitions: _default::ATTRIBUTE_DEFINITIONS(),
                                    TableName: tableName.clone(),
                                    KeySchema: _default::KEY_SCHEMA(),
                                    LocalSecondaryIndexes: Arc::new(Option::<Sequence<Arc<LocalSecondaryIndex>>>::None {}),
                                    GlobalSecondaryIndexes: Arc::new(Option::<Sequence<Arc<GlobalSecondaryIndex>>>::None {}),
                                    BillingMode: Arc::new(Option::<Arc<BillingMode>>::Some {
                                                value: Arc::new(BillingMode::PAY_PER_REQUEST {})
                                            }),
                                    ProvisionedThroughput: Arc::new(Option::<Arc<ProvisionedThroughput>>::None {}),
                                    StreamSpecification: Arc::new(Option::<Arc<StreamSpecification>>::None {}),
                                    SSESpecification: Arc::new(Option::<Arc<SSESpecification>>::None {}),
                                    Tags: Arc::new(Option::<Sequence<Arc<Tag>>>::None {}),
                                    TableClass: Arc::new(Option::<Arc<TableClass>>::None {}),
                                    DeletionProtectionEnabled: Arc::new(Option::<bool>::None {}),
                                    ResourcePolicy: Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {}),
                                    OnDemandThroughput: Arc::new(Option::<Arc<OnDemandThroughput>>::None {})
                                }));
                    maybeCreateTableResponse = _out1.clone();
                    if matches!((&maybeCreateTableResponse).as_ref(), Failure{ .. }) {
                        res = MaybePlacebo::from(Arc::new(Result::<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Failure {
                                        error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsDynamodb {
                                                    ComAmazonawsDynamodb: maybeCreateTableResponse.error().clone()
                                                })
                                    }));
                    } else {
                        let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(matches!(maybeCreateTableResponse.value().TableDescription().as_ref(), Some{ .. }) && _default::_keyStoreHasExpectedConstruction_q(maybeCreateTableResponse.value().TableDescription().value()) && crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::_default::IsValid_TableArn(maybeCreateTableResponse.value().TableDescription().value().TableArn().value()), &_default::E(&string_utf16_of("Configured table name does not conform to expected Key Store construction.")));
                        if valueOrError0.IsFailure() {
                            res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<DafnyCharUTF16>>());
                            return res.read();
                        };
                        res = MaybePlacebo::from(Arc::new(Result::<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                                        value: maybeCreateTableResponse.value().TableDescription().value().TableArn().value().clone()
                                    }));
                    }
                } else {
                    res = MaybePlacebo::from(Arc::new(Result::<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Failure {
                                    error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsDynamodb {
                                                ComAmazonawsDynamodb: error.clone()
                                            })
                                }));
                }
            } else {
                let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(matches!(maybeDescribeTableResponse.value().Table().as_ref(), Some{ .. }) && _default::_keyStoreHasExpectedConstruction_q(maybeDescribeTableResponse.value().Table().value()) && crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::_default::IsValid_TableArn(maybeDescribeTableResponse.value().Table().value().TableArn().value()), &_default::E(&string_utf16_of("Configured table name does not conform to expected Key Store construction.")));
                if valueOrError1.IsFailure() {
                    res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<DafnyCharUTF16>>());
                    return res.read();
                };
                res = MaybePlacebo::from(Arc::new(Result::<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                                value: maybeDescribeTableResponse.value().Table().value().TableArn().value().clone()
                            }));
            };
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/CreateKeyStoreTable.dfy(187,3)
        pub fn E(s: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error> {
            Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                    message: s.clone()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/CreateKeyStoreTable.dfy(16,3)
        pub fn ATTRIBUTE_DEFINITIONS() -> Sequence<Arc<AttributeDefinition>> {
            seq![Arc::new(AttributeDefinition::AttributeDefinition {
                        AttributeName: crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD(),
                        AttributeType: Arc::new(ScalarAttributeType::S {})
                    }), Arc::new(AttributeDefinition::AttributeDefinition {
                        AttributeName: crate::implementation_from_dafny::_Structure_Compile::_default::TYPE_FIELD(),
                        AttributeType: Arc::new(ScalarAttributeType::S {})
                    })]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/CreateKeyStoreTable.dfy(24,3)
        pub fn KEY_SCHEMA() -> KeySchema {
            seq![Arc::new(KeySchemaElement::KeySchemaElement {
                        AttributeName: crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD(),
                        KeyType: Arc::new(KeyType::HASH {})
                    }), Arc::new(KeySchemaElement::KeySchemaElement {
                        AttributeName: crate::implementation_from_dafny::_Structure_Compile::_default::TYPE_FIELD(),
                        KeyType: Arc::new(KeyType::RANGE {})
                    })]
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/CreateKeyStoreTable.dfy(33,3)
    pub type keyStoreDescription = Arc<TableDescription>;
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/CreateKeys.dfy(12,1)
pub mod _CreateKeys_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::Map;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::CreateKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyWithoutPlaintextResponse;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ReEncryptResponse;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemsOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::VersionKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::VersionKeyOutput;
    pub use crate::implementation_from_dafny::_Structure_Compile::ActiveBranchKeyItem;
    pub use crate::implementation_from_dafny::_Structure_Compile::BranchKeyContext;
    pub use crate::implementation_from_dafny::_Structure_Compile::VersionBranchKeyItem;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/CreateKeys.dfy(37,3)
        pub fn CreateBranchAndBeaconKeys(branchKeyIdentifier: &Sequence<DafnyCharUTF16>, customEncryptionContext: &Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, timestamp: &Sequence<DafnyCharUTF16>, branchKeyVersion: &Sequence<DafnyCharUTF16>, ddbTableName: &Sequence<DafnyCharUTF16>, logicalKeyStoreName: &Sequence<DafnyCharUTF16>, kmsConfiguration: &Arc<KMSConfiguration>, grantTokens: &GrantTokenList, kmsClient: &Object<dyn IKMSClient>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<Result<Arc<CreateKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<CreateKeyOutput>, Arc<Error>>>>::new();
            let mut decryptOnlyEncryptionContext: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_Structure_Compile::_default::DecryptOnlyBranchKeyEncryptionContext(branchKeyIdentifier, branchKeyVersion, timestamp, logicalKeyStoreName, &crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::GetKeyId(kmsConfiguration), customEncryptionContext);
            let mut activeEncryptionContext: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_Structure_Compile::_default::ActiveBranchKeyEncryptionContext(&decryptOnlyEncryptionContext);
            let mut beaconEncryptionContext: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_Structure_Compile::_default::BeaconKeyEncryptionContext(&decryptOnlyEncryptionContext);
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::_AttemptKmsOperation_q(kmsConfiguration, &decryptOnlyEncryptionContext), &Arc::new(Error::KeyStoreException {
                            message: string_utf16_of("Invalid KMS Key ARN configured for GenerateDataKeyWithoutPlaintext in CreateBranchAndBeaconKeys.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut valueOrError1: Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<Error>>>;
            let mut _out0: Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<Error>>> = crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::GenerateKey(&decryptOnlyEncryptionContext, kmsConfiguration, grantTokens, kmsClient);
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut wrappedDecryptOnlyBranchKey: Arc<GenerateDataKeyWithoutPlaintextResponse> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::_AttemptKmsOperation_q(kmsConfiguration, &activeEncryptionContext), &Arc::new(Error::KeyStoreException {
                            message: string_utf16_of("Invalid KMS Key ARN configured for ReEncrypt in CreateBranchAndBeaconKeys.")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut valueOrError3: Arc<Result<Arc<ReEncryptResponse>, Arc<Error>>>;
            let mut _out1: Arc<Result<Arc<ReEncryptResponse>, Arc<Error>>> = crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::ReEncryptKey(wrappedDecryptOnlyBranchKey.CiphertextBlob().value(), &decryptOnlyEncryptionContext, &activeEncryptionContext, kmsConfiguration, grantTokens, kmsClient);
            valueOrError3 = _out1.clone();
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut wrappedActiveBranchKey: Arc<ReEncryptResponse> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::_AttemptKmsOperation_q(kmsConfiguration, &beaconEncryptionContext), &Arc::new(Error::KeyStoreException {
                            message: string_utf16_of("Invalid KMS Key ARN configured for GenerateDataKeyWithoutPlaintext(beacon key) in CreateBranchAndBeaconKeys.")
                        }));
            if valueOrError4.IsFailure() {
                output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut valueOrError5: Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<Error>>>;
            let mut _out2: Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<Error>>> = crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::GenerateKey(&beaconEncryptionContext, kmsConfiguration, grantTokens, kmsClient);
            valueOrError5 = _out2.clone();
            if valueOrError5.IsFailure() {
                output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut wrappedBeaconKey: Arc<GenerateDataKeyWithoutPlaintextResponse> = valueOrError5.Extract();
            let mut decryptOnlyBranchKeyItem: Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>> = crate::implementation_from_dafny::_Structure_Compile::_default::ToAttributeMap(&decryptOnlyEncryptionContext, wrappedDecryptOnlyBranchKey.CiphertextBlob().value());
            let mut activeBranchKeyItem: Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>> = crate::implementation_from_dafny::_Structure_Compile::_default::ToAttributeMap(&activeEncryptionContext, wrappedActiveBranchKey.CiphertextBlob().value());
            let mut beaconKeyItem: Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>> = crate::implementation_from_dafny::_Structure_Compile::_default::ToAttributeMap(&beaconEncryptionContext, wrappedBeaconKey.CiphertextBlob().value());
            let mut valueOrError6: Arc<Result<Arc<TransactWriteItemsOutput>, Arc<Error>>>;
            let mut _out3: Arc<Result<Arc<TransactWriteItemsOutput>, Arc<Error>>> = crate::implementation_from_dafny::_DDBKeystoreOperations_Compile::_default::WriteNewKeyToStore(&decryptOnlyBranchKeyItem, &activeBranchKeyItem, &beaconKeyItem, ddbTableName, ddbClient);
            valueOrError6 = _out3.clone();
            if valueOrError6.IsFailure() {
                output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<CreateKeyOutput>>());
                return output.read();
            };
            let mut _v0: Arc<TransactWriteItemsOutput> = valueOrError6.Extract();
            output = MaybePlacebo::from(Arc::new(Result::<Arc<CreateKeyOutput>, Arc<Error>>::Success {
                            value: Arc::new(CreateKeyOutput::CreateKeyOutput {
                                        branchKeyIdentifier: branchKeyIdentifier.clone()
                                    })
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/CreateKeys.dfy(295,3)
        pub fn VersionActiveBranchKey(input: &Arc<VersionKeyInput>, timestamp: &Sequence<DafnyCharUTF16>, branchKeyVersion: &Sequence<DafnyCharUTF16>, ddbTableName: &Sequence<DafnyCharUTF16>, logicalKeyStoreName: &Sequence<DafnyCharUTF16>, kmsConfiguration: &Arc<KMSConfiguration>, grantTokens: &GrantTokenList, kmsClient: &Object<dyn IKMSClient>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<Result<Arc<VersionKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<VersionKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Result<ActiveBranchKeyItem, Arc<Error>>>;
            let mut _out0: Arc<Result<ActiveBranchKeyItem, Arc<Error>>> = crate::implementation_from_dafny::_DDBKeystoreOperations_Compile::_default::GetActiveBranchKeyItem(input.branchKeyIdentifier(), ddbTableName, ddbClient);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<VersionKeyOutput>>());
                return output.read();
            };
            let mut oldActiveItem: ActiveBranchKeyItem = valueOrError0.Extract();
            let mut oldActiveEncryptionContext: BranchKeyContext = crate::implementation_from_dafny::_Structure_Compile::_default::ToBranchKeyContext(&oldActiveItem, logicalKeyStoreName);
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(true && crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::_AttemptKmsOperation_q(kmsConfiguration, &oldActiveEncryptionContext), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::VERSION_KEY_KMS_KEY_ARN_DISAGREEMENT()
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<VersionKeyOutput>>());
                return output.read();
            };
            let mut valueOrError2: Arc<Result<Arc<ReEncryptResponse>, Arc<Error>>>;
            let mut _out1: Arc<Result<Arc<ReEncryptResponse>, Arc<Error>>> = crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::ReEncryptKey(oldActiveItem.get(&crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_FIELD()).B(), &oldActiveEncryptionContext, &oldActiveEncryptionContext, kmsConfiguration, grantTokens, kmsClient);
            valueOrError2 = _out1.clone();
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<VersionKeyOutput>>());
                return output.read();
            };
            let mut _v1: Arc<ReEncryptResponse> = valueOrError2.Extract();
            let mut decryptOnlyEncryptionContext: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_Structure_Compile::_default::NewVersionFromActiveBranchKeyEncryptionContext(&oldActiveEncryptionContext, branchKeyVersion, timestamp);
            let mut activeEncryptionContext: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = crate::implementation_from_dafny::_Structure_Compile::_default::ActiveBranchKeyEncryptionContext(&decryptOnlyEncryptionContext);
            let mut valueOrError3: Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<Error>>>;
            let mut _out2: Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<Error>>> = crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::GenerateKey(&decryptOnlyEncryptionContext, kmsConfiguration, grantTokens, kmsClient);
            valueOrError3 = _out2.clone();
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<VersionKeyOutput>>());
                return output.read();
            };
            let mut wrappedDecryptOnlyBranchKey: Arc<GenerateDataKeyWithoutPlaintextResponse> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Arc<ReEncryptResponse>, Arc<Error>>>;
            let mut _out3: Arc<Result<Arc<ReEncryptResponse>, Arc<Error>>> = crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::ReEncryptKey(wrappedDecryptOnlyBranchKey.CiphertextBlob().value(), &decryptOnlyEncryptionContext, &activeEncryptionContext, kmsConfiguration, grantTokens, kmsClient);
            valueOrError4 = _out3.clone();
            if valueOrError4.IsFailure() {
                output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<VersionKeyOutput>>());
                return output.read();
            };
            let mut wrappedActiveBranchKey: Arc<ReEncryptResponse> = valueOrError4.Extract();
            let mut decryptOnlyBranchKeyItem: VersionBranchKeyItem = crate::implementation_from_dafny::_Structure_Compile::_default::ToAttributeMap(&decryptOnlyEncryptionContext, wrappedDecryptOnlyBranchKey.CiphertextBlob().value());
            let mut activeBranchKeyItem: ActiveBranchKeyItem = crate::implementation_from_dafny::_Structure_Compile::_default::ToAttributeMap(&activeEncryptionContext, wrappedActiveBranchKey.CiphertextBlob().value());
            let mut valueOrError5: Arc<Result<Arc<TransactWriteItemsOutput>, Arc<Error>>>;
            let mut _out4: Arc<Result<Arc<TransactWriteItemsOutput>, Arc<Error>>> = crate::implementation_from_dafny::_DDBKeystoreOperations_Compile::_default::WriteNewBranchKeyVersionToKeystore(&decryptOnlyBranchKeyItem, &activeBranchKeyItem, ddbTableName, ddbClient);
            valueOrError5 = _out4.clone();
            if valueOrError5.IsFailure() {
                output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<VersionKeyOutput>>());
                return output.read();
            };
            let mut _v2: Arc<TransactWriteItemsOutput> = valueOrError5.Extract();
            output = MaybePlacebo::from(Arc::new(Result::<Arc<VersionKeyOutput>, Arc<Error>>::Success {
                            value: Arc::new(VersionKeyOutput::VersionKeyOutput {})
                        }));
            return output.read();
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(7,1)
pub mod _DDBKeystoreOperations_Compile {
    pub use crate::implementation_from_dafny::_Structure_Compile::VersionBranchKeyItem;
    pub use crate::implementation_from_dafny::_Structure_Compile::ActiveBranchKeyItem;
    pub use crate::implementation_from_dafny::_Structure_Compile::BeaconKeyItem;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemsOutput;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemList;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItemsInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnConsumedCapacity;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnItemCollectionMetrics;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue;
    pub use ::dafny_runtime::map;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GetItemInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeNameList;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::GetItemOutput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::TransactWriteItem;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ConditionCheck;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Put;
    pub use crate::implementation_from_dafny::_DDBKeystoreOperations_Compile::ConditionExpression::BRANCH_KEY_NOT_EXIST;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::ReturnValuesOnConditionCheckFailure;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Delete;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Update;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(30,3)
        pub fn WriteNewKeyToStore(versionBranchKeyItem: &VersionBranchKeyItem, activeBranchKeyItem: &ActiveBranchKeyItem, beaconKeyItem: &BeaconKeyItem, tableName: &Sequence<DafnyCharUTF16>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>>::new();
            let mut items: TransactWriteItemList = seq![_default::CreateTransactWritePutItem(versionBranchKeyItem, tableName, &Arc::new(ConditionExpression::BRANCH_KEY_NOT_EXIST {})), _default::CreateTransactWritePutItem(activeBranchKeyItem, tableName, &Arc::new(ConditionExpression::BRANCH_KEY_NOT_EXIST {})), _default::CreateTransactWritePutItem(beaconKeyItem, tableName, &Arc::new(ConditionExpression::BRANCH_KEY_NOT_EXIST {}))];
            let mut transactRequest: Arc<TransactWriteItemsInput> = Arc::new(TransactWriteItemsInput::TransactWriteItemsInput {
                        TransactItems: items.clone(),
                        ReturnConsumedCapacity: Arc::new(Option::<Arc<ReturnConsumedCapacity>>::None {}),
                        ReturnItemCollectionMetrics: Arc::new(Option::<Arc<ReturnItemCollectionMetrics>>::None {}),
                        ClientRequestToken: Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {})
                    });
            let mut maybeTransactWriteResponse: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>> = IDynamoDBClient::TransactWriteItems(rd!(ddbClient.clone()), &transactRequest);
            maybeTransactWriteResponse = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeTransactWriteResponse.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsDynamodb {
                                        ComAmazonawsDynamodb: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<TransactWriteItemsOutput>>());
                return output.read();
            };
            let mut transactWriteItemsResponse: Arc<TransactWriteItemsOutput> = valueOrError0.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                            value: transactWriteItemsResponse.clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(92,3)
        pub fn WriteNewBranchKeyVersionToKeystore(versionBranchKeyItem: &VersionBranchKeyItem, activeBranchKeyItem: &ActiveBranchKeyItem, tableName: &Sequence<DafnyCharUTF16>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>>::new();
            let mut items: TransactWriteItemList = seq![_default::CreateTransactWritePutItem(versionBranchKeyItem, tableName, &Arc::new(ConditionExpression::BRANCH_KEY_NOT_EXIST {})), _default::CreateTransactWritePutItem(activeBranchKeyItem, tableName, &Arc::new(ConditionExpression::BRANCH_KEY_EXISTS {}))];
            let mut transactRequest: Arc<TransactWriteItemsInput> = Arc::new(TransactWriteItemsInput::TransactWriteItemsInput {
                        TransactItems: items.clone(),
                        ReturnConsumedCapacity: Arc::new(Option::<Arc<ReturnConsumedCapacity>>::None {}),
                        ReturnItemCollectionMetrics: Arc::new(Option::<Arc<ReturnItemCollectionMetrics>>::None {}),
                        ClientRequestToken: Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {})
                    });
            let mut maybeTransactWriteResponse: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>> = IDynamoDBClient::TransactWriteItems(rd!(ddbClient.clone()), &transactRequest);
            maybeTransactWriteResponse = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeTransactWriteResponse.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsDynamodb {
                                        ComAmazonawsDynamodb: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<TransactWriteItemsOutput>>());
                return output.read();
            };
            let mut transactWriteItemsResponse: Arc<TransactWriteItemsOutput> = valueOrError0.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<TransactWriteItemsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                            value: transactWriteItemsResponse.clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(146,3)
        pub fn GetActiveBranchKeyItem(branchKeyIdentifier: &Sequence<DafnyCharUTF16>, tableName: &Sequence<DafnyCharUTF16>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ActiveBranchKeyItem, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ActiveBranchKeyItem, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>>::new();
            let mut dynamoDbKey: Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>> = map![(crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD()) => (Arc::new(AttributeValue::S {
                                S: branchKeyIdentifier.clone()
                            })), (crate::implementation_from_dafny::_Structure_Compile::_default::TYPE_FIELD()) => (Arc::new(AttributeValue::S {
                                S: crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_ACTIVE_TYPE()
                            }))];
            let mut ItemRequest: Arc<GetItemInput> = Arc::new(GetItemInput::GetItemInput {
                        TableName: tableName.clone(),
                        Key: dynamoDbKey.clone(),
                        AttributesToGet: Arc::new(Option::<AttributeNameList>::None {}),
                        ConsistentRead: Arc::new(Option::<bool>::None {}),
                        ReturnConsumedCapacity: Arc::new(Option::<Arc<ReturnConsumedCapacity>>::None {}),
                        ProjectionExpression: Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {}),
                        ExpressionAttributeNames: Arc::new(Option::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>::None {})
                    });
            let mut maybeGetItem: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>> = IDynamoDBClient::GetItem(rd!(ddbClient.clone()), &ItemRequest);
            maybeGetItem = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeGetItem.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsDynamodb {
                                        ComAmazonawsDynamodb: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<ActiveBranchKeyItem>());
                return output.read();
            };
            let mut getItemResponse: Arc<GetItemOutput> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(matches!(getItemResponse.Item().as_ref(), Some{ .. }) && truncate!(getItemResponse.Item().value().cardinality(), u64) >= 1, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::NO_CORRESPONDING_BRANCH_KEY()
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<ActiveBranchKeyItem>());
                return output.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(crate::implementation_from_dafny::_Structure_Compile::_default::_ActiveBranchKeyItem_q(getItemResponse.Item().value()) && getItemResponse.Item().value().get(&crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD()).S().clone() == branchKeyIdentifier.clone(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: string_utf16_of("Item found is not a valid active branch key.")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<ActiveBranchKeyItem>());
                return output.read();
            };
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                            value: getItemResponse.Item().value().clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(215,3)
        pub fn GetVersionBranchKeyItem(branchKeyIdentifier: &Sequence<DafnyCharUTF16>, branchKeyVersion: &Sequence<DafnyCharUTF16>, tableName: &Sequence<DafnyCharUTF16>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<VersionBranchKeyItem, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<VersionBranchKeyItem, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>>::new();
            let mut dynamoDbKey: Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>> = map![(crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD()) => (Arc::new(AttributeValue::S {
                                S: branchKeyIdentifier.clone()
                            })), (crate::implementation_from_dafny::_Structure_Compile::_default::TYPE_FIELD()) => (Arc::new(AttributeValue::S {
                                S: crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_TYPE_PREFIX().concat(branchKeyVersion)
                            }))];
            let mut ItemRequest: Arc<GetItemInput> = Arc::new(GetItemInput::GetItemInput {
                        TableName: tableName.clone(),
                        Key: dynamoDbKey.clone(),
                        AttributesToGet: Arc::new(Option::<AttributeNameList>::None {}),
                        ConsistentRead: Arc::new(Option::<bool>::None {}),
                        ReturnConsumedCapacity: Arc::new(Option::<Arc<ReturnConsumedCapacity>>::None {}),
                        ProjectionExpression: Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {}),
                        ExpressionAttributeNames: Arc::new(Option::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>::None {})
                    });
            let mut maybeGetItem: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>> = IDynamoDBClient::GetItem(rd!(ddbClient.clone()), &ItemRequest);
            maybeGetItem = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeGetItem.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsDynamodb {
                                        ComAmazonawsDynamodb: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<VersionBranchKeyItem>());
                return output.read();
            };
            let mut getItemResponse: Arc<GetItemOutput> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(matches!(getItemResponse.Item().as_ref(), Some{ .. }) && truncate!(getItemResponse.Item().value().cardinality(), u64) >= 1, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::NO_CORRESPONDING_BRANCH_KEY()
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<VersionBranchKeyItem>());
                return output.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(crate::implementation_from_dafny::_Structure_Compile::_default::_VersionBranchKeyItem_q(getItemResponse.Item().value()) && getItemResponse.Item().value().get(&crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD()).S().clone() == branchKeyIdentifier.clone() && getItemResponse.Item().value().get(&crate::implementation_from_dafny::_Structure_Compile::_default::TYPE_FIELD()).S().clone() == crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_TYPE_PREFIX().concat(branchKeyVersion), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: string_utf16_of("Item found is not a valid branch key version.")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<VersionBranchKeyItem>());
                return output.read();
            };
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                            value: getItemResponse.Item().value().clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(284,3)
        pub fn GetBeaconKeyItem(branchKeyIdentifier: &Sequence<DafnyCharUTF16>, tableName: &Sequence<DafnyCharUTF16>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<BeaconKeyItem, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<BeaconKeyItem, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>>::new();
            let mut dynamoDbKey: Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>> = map![(crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD()) => (Arc::new(AttributeValue::S {
                                S: branchKeyIdentifier.clone()
                            })), (crate::implementation_from_dafny::_Structure_Compile::_default::TYPE_FIELD()) => (Arc::new(AttributeValue::S {
                                S: crate::implementation_from_dafny::_Structure_Compile::_default::BEACON_KEY_TYPE_VALUE()
                            }))];
            let mut ItemRequest: Arc<GetItemInput> = Arc::new(GetItemInput::GetItemInput {
                        TableName: tableName.clone(),
                        Key: dynamoDbKey.clone(),
                        AttributesToGet: Arc::new(Option::<AttributeNameList>::None {}),
                        ConsistentRead: Arc::new(Option::<bool>::None {}),
                        ReturnConsumedCapacity: Arc::new(Option::<Arc<ReturnConsumedCapacity>>::None {}),
                        ProjectionExpression: Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {}),
                        ExpressionAttributeNames: Arc::new(Option::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>::None {})
                    });
            let mut maybeGetItem: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>> = IDynamoDBClient::GetItem(rd!(ddbClient.clone()), &ItemRequest);
            maybeGetItem = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetItemOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeGetItem.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsDynamodb {
                                        ComAmazonawsDynamodb: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<BeaconKeyItem>());
                return output.read();
            };
            let mut getItemResponse: Arc<GetItemOutput> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(matches!(getItemResponse.Item().as_ref(), Some{ .. }) && truncate!(getItemResponse.Item().value().cardinality(), u64) >= 1, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::NO_CORRESPONDING_BRANCH_KEY()
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<BeaconKeyItem>());
                return output.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(crate::implementation_from_dafny::_Structure_Compile::_default::_BeaconKeyItem_q(getItemResponse.Item().value()) && getItemResponse.Item().value().get(&crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD()).S().clone() == branchKeyIdentifier.clone(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: string_utf16_of("Item found is not a valid beacon key.")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<BeaconKeyItem>());
                return output.read();
            };
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                            value: getItemResponse.Item().value().clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(354,3)
        pub fn CreateTransactWritePutItem(item: &Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>, tableName: &Sequence<DafnyCharUTF16>, conditionExpression: &Arc<ConditionExpression>) -> Arc<TransactWriteItem> {
            Arc::new(TransactWriteItem::TransactWriteItem {
                    ConditionCheck: Arc::new(Option::<Arc<ConditionCheck>>::None {}),
                    Put: Arc::new(Option::<Arc<Put>>::Some {
                                value: Arc::new(Put::Put {
                                            Item: item.clone(),
                                            TableName: tableName.clone(),
                                            ConditionExpression: Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                                        value: (&({
                                                                Arc::new(move |_source0: &Arc<ConditionExpression>| -> Sequence<DafnyCharUTF16>{
                                                                        if matches!(_source0.as_ref(), BRANCH_KEY_NOT_EXIST{ .. }) {
                                                                            _default::BRANCH_KEY_NOT_EXIST_CONDITION()
                                                                        } else {
                                                                            _default::BRANCH_KEY_EXISTS_CONDITION()
                                                                        }
                                                                    })
                                                            }))(conditionExpression)
                                                    }),
                                            ExpressionAttributeNames: Arc::new(Option::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>>::Some {
                                                        value: _default::BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAMES()
                                                    }),
                                            ExpressionAttributeValues: Arc::new(Option::<Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>>::None {}),
                                            ReturnValuesOnConditionCheckFailure: Arc::new(Option::<Arc<ReturnValuesOnConditionCheckFailure>>::None {})
                                        })
                            }),
                    Delete: Arc::new(Option::<Arc<Delete>>::None {}),
                    Update: Arc::new(Option::<Arc<Update>>::None {})
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(18,3)
        pub fn BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAME() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("#BranchKeyIdentifierField")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(19,3)
        pub fn BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAMES() -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> {
            map![(_default::BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAME()) => (crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_IDENTIFIER_FIELD())]
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(23,3)
        pub fn BRANCH_KEY_NOT_EXIST_CONDITION() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("attribute_not_exists(").concat(&_default::BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAME()).concat(&string_utf16_of(")"))
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(24,3)
        pub fn BRANCH_KEY_EXISTS_CONDITION() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("attribute_exists(").concat(&_default::BRANCH_KEY_EXISTS_EXPRESSION_ATTRIBUTE_NAME()).concat(&string_utf16_of(")"))
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/DDBKeystoreOperations.dfy(26,3)
    #[derive(PartialEq, Clone)]
    pub enum ConditionExpression {
        BRANCH_KEY_NOT_EXIST {},
        BRANCH_KEY_EXISTS {}
    }

    impl ConditionExpression {}

    impl Debug
        for ConditionExpression {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for ConditionExpression {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                ConditionExpression::BRANCH_KEY_NOT_EXIST{} => {
                    write!(_formatter, "DDBKeystoreOperations_Compile.ConditionExpression.BRANCH__KEY__NOT__EXIST")?;
                    Ok(())
                },
                ConditionExpression::BRANCH_KEY_EXISTS{} => {
                    write!(_formatter, "DDBKeystoreOperations_Compile.ConditionExpression.BRANCH__KEY__EXISTS")?;
                    Ok(())
                },
            }
        }
    }

    impl ConditionExpression {
        /// Enumerates all possible values of ConditionExpression
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ConditionExpression>> {
            seq![Arc::new(ConditionExpression::BRANCH_KEY_NOT_EXIST {}), Arc::new(ConditionExpression::BRANCH_KEY_EXISTS {})].iter()
        }
    }

    impl Eq
        for ConditionExpression {}

    impl Hash
        for ConditionExpression {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                ConditionExpression::BRANCH_KEY_NOT_EXIST{} => {

                },
                ConditionExpression::BRANCH_KEY_EXISTS{} => {

                },
            }
        }
    }

    impl Default
        for ConditionExpression {
        fn default() -> ConditionExpression {
            ConditionExpression::BRANCH_KEY_NOT_EXIST {}
        }
    }

    impl AsRef<ConditionExpression>
        for ConditionExpression {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// Implements mutable maps by interfacing with external code, e.g. "MutableMap.java".
/// ../mpl/libraries/src/MutableMap/MutableMap.dfy(14,1)
pub mod DafnyLibraries {
    pub use ::dafny_runtime::DafnyTypeEq;
    pub use ::dafny_runtime::Any;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::Map;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::DafnyInt;
    pub use crate::implementation_from_dafny::_dafny_externs::DafnyLibraries::*;

    /// NOTE: Only here because of #2500; once resolved import "../../examples/MutableMap/
    ///  MutableMapTrait.dfy".
    /// ../mpl/libraries/src/MutableMap/MutableMap.dfy(21,3)
    pub trait MutableMapTrait<K, V>: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send>
        where
        K: DafnyTypeEq,
        V: DafnyTypeEq {
        /// ../mpl/libraries/src/MutableMap/MutableMap.dfy(22,5)
        fn content(&self) -> Map<K, V>;
        /// ../mpl/libraries/src/MutableMap/MutableMap.dfy(25,5)
        fn Put(&self, k: &K, v: &V) -> ();
        /// ../mpl/libraries/src/MutableMap/MutableMap.dfy(31,5)
        fn Keys(&self) -> Set<K>;
        /// ../mpl/libraries/src/MutableMap/MutableMap.dfy(35,5)
        fn HasKey(&self, k: &K) -> bool;
        /// ../mpl/libraries/src/MutableMap/MutableMap.dfy(39,5)
        fn Values(&self) -> Set<V>;
        /// ../mpl/libraries/src/MutableMap/MutableMap.dfy(43,5)
        fn Items(&self) -> Set<(K, V)>;
        /// ../mpl/libraries/src/MutableMap/MutableMap.dfy(48,5)
        fn Select(&self, k: &K) -> V;
        /// ../mpl/libraries/src/MutableMap/MutableMap.dfy(54,5)
        fn Remove(&self, k: &K) -> ();
        /// ../mpl/libraries/src/MutableMap/MutableMap.dfy(59,5)
        fn Size(&self) -> DafnyInt;
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(13,1)
pub mod _DefaultCMM_Compile {
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_CMM_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsOutput;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeEncryptionMaterialsInput;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::_MultiKeyring_Compile::MultiKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsOutput;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeDecryptionMaterialsInput;
    pub use ::dafny_runtime::map;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(33,3)
    pub struct DefaultCMM {
        pub __i_keyring: Object<dyn IKeyring>,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>
    }

    impl DefaultCMM {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(52,5)
        pub fn OfKeyring(this: &Object<DefaultCMM>, k: &Object<dyn IKeyring>, c: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_keyring: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            update_field_uninit_object!(this.clone(), __i_keyring, _set___i_keyring, k.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, c.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(50,5)
        pub fn keyring(&self) -> Object<dyn IKeyring> {
            self.__i_keyring.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(36,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
    }

    impl UpcastObject<DynAny>
        for DefaultCMM {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for DefaultCMM {}

    impl UpcastObject<dyn VerifiableInterface>
        for DefaultCMM {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl ICryptographicMaterialsManager
        for DefaultCMM {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(107,5)
        fn _GetEncryptionMaterials_k(&self, input: &Arc<GetEncryptionMaterialsInput>) -> Arc<Result<Arc<GetEncryptionMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<GetEncryptionMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(!input.encryptionContext().contains(&crate::implementation_from_dafny::_Materials_Compile::_default::EC_PUBLIC_KEY_FIELD()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Reserved Field found in EncryptionContext keys.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                return output.read();
            };
            let mut algorithmId: Arc<AlgorithmSuiteId>;
            if matches!(input.algorithmSuiteId().as_ref(), Some{ .. }) {
                algorithmId = input.algorithmSuiteId().value().clone();
            } else {
                algorithmId = crate::implementation_from_dafny::_Defaults_Compile::_default::GetAlgorithmSuiteForCommitmentPolicy(input.commitmentPolicy());
            };
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Commitment_Compile::_default::ValidateCommitmentPolicyOnEncrypt(&algorithmId, input.commitmentPolicy());
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                return output.read();
            };
            let mut suite: Arc<AlgorithmSuiteInfo> = crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetSuite(&algorithmId);
            let mut signingKey: Arc<Option<Sequence<u8>>>;
            let mut verificationKey: Arc<Option<Sequence<u8>>>;
            if matches!(suite.signature().as_ref(), ECDSA{ .. }) {
                let mut maybeECDSAPair: Arc<Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                let mut _out0: Arc<Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateECDSASignatureKey(rd!(self.cryptoPrimitives().clone()), &Arc::new(GenerateECDSASignatureKeyInput::GenerateECDSASignatureKeyInput {
                                signatureAlgorithm: suite.signature().ECDSA().curve().clone()
                            }));
                maybeECDSAPair = _out0.clone();
                let mut valueOrError2: Arc<Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeECDSAPair.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                            AwsCryptographyPrimitives: e.clone()
                                        })
                                })
                        }));
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                    return output.read();
                };
                let mut pair: Arc<GenerateECDSASignatureKeyOutput> = valueOrError2.Extract();
                signingKey = Arc::new(Option::<Sequence<u8>>::Some {
                            value: pair.signingKey().clone()
                        });
                verificationKey = Arc::new(Option::<Sequence<u8>>::Some {
                            value: pair.verificationKey().clone()
                        });
            } else {
                signingKey = Arc::new(Option::<Sequence<u8>>::None {});
                verificationKey = Arc::new(Option::<Sequence<u8>>::None {});
            };
            let mut valueOrError3: Arc<Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::InitializeEncryptionMaterials(&Arc::new(InitializeEncryptionMaterialsInput::InitializeEncryptionMaterialsInput {
                            algorithmSuiteId: algorithmId.clone(),
                            encryptionContext: input.encryptionContext().clone(),
                            requiredEncryptionContextKeys: input.requiredEncryptionContextKeys().UnwrapOr(&(seq![] as Sequence<ValidUTF8Bytes>)),
                            signingKey: signingKey.clone(),
                            verificationKey: verificationKey.clone()
                        }));
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                return output.read();
            };
            let mut materials: Arc<EncryptionMaterials> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IKeyring::OnEncrypt(rd!(self.keyring().clone()), &Arc::new(OnEncryptInput::OnEncryptInput {
                            materials: materials.clone()
                        }));
            valueOrError4 = _out1.clone();
            if valueOrError4.IsFailure() {
                output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                return output.read();
            };
            let mut result: Arc<OnEncryptOutput> = valueOrError4.Extract();
            let mut encryptionMaterialsOutput: Arc<GetEncryptionMaterialsOutput> = Arc::new(GetEncryptionMaterialsOutput::GetEncryptionMaterialsOutput {
                        encryptionMaterials: result.materials().clone()
                    });
            if !(crate::implementation_from_dafny::_MultiKeyring_Compile::_default::_Verified_q(&self.keyring().clone()) || ({
                        let __is_5: Object<dyn IKeyring> = self.keyring().clone();
                        __is_5.clone().is_instance_of::<MultiKeyring>()
                    })) {
                let mut valueOrError5: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(encryptionMaterialsOutput.encryptionMaterials()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Could not retrieve materials required for encryption")
                            }));
                if valueOrError5.IsFailure() {
                    output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                    return output.read();
                };
                let mut valueOrError6: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(&materials, encryptionMaterialsOutput.encryptionMaterials()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Keyring returned an invalid response")
                            }));
                if valueOrError6.IsFailure() {
                    output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                    return output.read();
                }
            };
            output = MaybePlacebo::from(Arc::new(Result::<Arc<GetEncryptionMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: encryptionMaterialsOutput.clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/DefaultCMM.dfy(355,5)
        fn _DecryptMaterials_k(&self, input: &Arc<DecryptMaterialsInput>) -> Arc<Result<Arc<DecryptMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<DecryptMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Commitment_Compile::_default::ValidateCommitmentPolicyOnDecrypt(input.algorithmSuiteId(), input.commitmentPolicy());
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                return output.read();
            };
            let mut requiredEncryptionContextKeys: Sequence<ValidUTF8Bytes> = seq![] as Sequence<ValidUTF8Bytes>;
            if matches!(input.reproducedEncryptionContext().as_ref(), Some{ .. }) {
                let mut keysSet: Set<ValidUTF8Bytes> = input.reproducedEncryptionContext().value().keys();
                let mut keysSeq: Sequence<ValidUTF8Bytes>;
                let mut _out0: Sequence<ValidUTF8Bytes> = crate::implementation_from_dafny::SortedSets::_default::SetToSequence::<ValidUTF8Bytes>(&keysSet);
                keysSeq = _out0.clone();
                let mut i: u64 = 0;
                while i < truncate!(keysSeq.cardinality(), u64) {
                    let mut key: ValidUTF8Bytes = keysSeq.get(&int!((&i).clone()));
                    if input.encryptionContext().contains(&key) {
                        let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(input.reproducedEncryptionContext().value().get(&key) == input.encryptionContext().get(&key), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                        message: string_utf16_of("Encryption context does not match reproduced encryption context.")
                                    }));
                        if valueOrError1.IsFailure() {
                            output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                            return output.read();
                        }
                    } else {
                        requiredEncryptionContextKeys = requiredEncryptionContextKeys.concat(&seq![key.clone()]);
                    };
                    i = i + 1;
                }
            };
            let mut valueOrError2: Arc<Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::InitializeDecryptionMaterials(&Arc::new(InitializeDecryptionMaterialsInput::InitializeDecryptionMaterialsInput {
                            algorithmSuiteId: input.algorithmSuiteId().clone(),
                            encryptionContext: input.encryptionContext().merge(&input.reproducedEncryptionContext().UnwrapOr(&map![])),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                return output.read();
            };
            let mut materials: Arc<DecryptionMaterials> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IKeyring::OnDecrypt(rd!(self.keyring().clone()), &Arc::new(OnDecryptInput::OnDecryptInput {
                            materials: materials.clone(),
                            encryptedDataKeys: input.encryptedDataKeys().clone()
                        }));
            valueOrError3 = _out1.clone();
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                return output.read();
            };
            let mut result: Arc<OnDecryptOutput> = valueOrError3.Extract();
            if !(crate::implementation_from_dafny::_MultiKeyring_Compile::_default::_Verified_q(&self.keyring().clone()) || ({
                        let __is_6: Object<dyn IKeyring> = self.keyring().clone();
                        __is_6.clone().is_instance_of::<MultiKeyring>()
                    })) {
                let mut valueOrError4: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsTransitionIsValid(&materials, result.materials()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Keyring.OnDecrypt failed to decrypt the plaintext data key.")
                            }));
                if valueOrError4.IsFailure() {
                    output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                    return output.read();
                }
            };
            output = MaybePlacebo::from(Arc::new(Result::<Arc<DecryptMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(DecryptMaterialsOutput::DecryptMaterialsOutput {
                                        decryptionMaterials: result.materials().clone()
                                    })
                        }));
            return output.read();
        }
    }

    impl UpcastObject<dyn ICryptographicMaterialsManager>
        for DefaultCMM {
        UpcastObjectFn!(dyn ICryptographicMaterialsManager);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/DefaultClientSupplier.dfy(6,1)
pub mod _DefaultClientSupplier_Compile {
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::_default;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/DefaultClientSupplier.dfy(13,3)
    pub struct DefaultClientSupplier {}

    impl DefaultClientSupplier {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/DefaultClientSupplier.dfy(22,5)
        pub fn _ctor(this: &Object<DefaultClientSupplier>) -> () {
            return ();
        }
    }

    impl UpcastObject<DynAny>
        for DefaultClientSupplier {
        UpcastObjectFn!(DynAny);
    }

    impl IClientSupplier
        for DefaultClientSupplier {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/DefaultClientSupplier.dfy(32,5)
        fn _GetClient_k(&self, input: &Arc<GetClientInput>) -> Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut maybeClient: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = _default::KMSClientForRegion(input.region());
            maybeClient = _out0.clone();
            output = maybeClient.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::ComAmazonawsKms {
                                        ComAmazonawsKms: e.clone()
                                    })
                            })
                    }));
            return output.clone();
        }
    }

    impl UpcastObject<dyn IClientSupplier>
        for DefaultClientSupplier {
        UpcastObjectFn!(dyn IClientSupplier);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Defaults.dfy(6,1)
pub mod _Defaults_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy::ESDK;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy::FORBID_ENCRYPT_ALLOW_DECRYPT;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy::REQUIRE_ENCRYPT_ALLOW_DECRYPT;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DBECommitmentPolicy;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DBEAlgorithmSuiteId;

    pub struct _default {}

    impl _default {
        /// = aws-encryption-sdk-specification/framework/commitment-policy.md#esdk-forbid-encrypt-allow-decrypt
        /// = type=implication
        /// # - `ESDK.ALG_AES_256_GCM_IV12_TAG16_NO_KDF` MUST be the default algorithm suite
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Defaults.dfy(10,3)
        pub fn GetAlgorithmSuiteForCommitmentPolicy(commitmentPolicy: &Arc<CommitmentPolicy>) -> Arc<AlgorithmSuiteId> {
            let mut _source0: Arc<CommitmentPolicy> = commitmentPolicy.clone();
            if matches!((&_source0).as_ref(), ESDK{ .. }) {
                let mut ___mcc_h0: Arc<ESDKCommitmentPolicy> = _source0.ESDK().clone();
                let mut c: Arc<ESDKCommitmentPolicy> = ___mcc_h0.clone();
                let mut _source1: Arc<ESDKCommitmentPolicy> = c.clone();
                if matches!((&_source1).as_ref(), FORBID_ENCRYPT_ALLOW_DECRYPT{ .. }) {
                    Arc::new(AlgorithmSuiteId::ESDK {
                            ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_IV12_TAG16_HKDF_SHA384_ECDSA_P384 {})
                        })
                } else {
                    if matches!((&_source1).as_ref(), REQUIRE_ENCRYPT_ALLOW_DECRYPT{ .. }) {
                        Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384 {})
                            })
                    } else {
                        Arc::new(AlgorithmSuiteId::ESDK {
                                ESDK: Arc::new(ESDKAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384 {})
                            })
                    }
                }
            } else {
                let mut ___mcc_h1: Arc<DBECommitmentPolicy> = _source0.DBE().clone();
                Arc::new(AlgorithmSuiteId::DBE {
                        DBE: Arc::new(DBEAlgorithmSuiteId::ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_ECDSA_P384_SYMSIG_HMAC_SHA384 {})
                    })
            }
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(6,1)
pub mod _Digest_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm::SHA_512;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm::SHA_384;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(14,3)
        pub fn Length(digestAlgorithm: &Arc<DigestAlgorithm>) -> u64 {
            let mut _source0: Arc<DigestAlgorithm> = digestAlgorithm.clone();
            if matches!((&_source0).as_ref(), SHA_512{ .. }) {
                64
            } else {
                if matches!((&_source0).as_ref(), SHA_384{ .. }) {
                    48
                } else {
                    32
                }
            }
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(22,3)
        pub fn Digest(input: &Arc<DigestInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<Error>>>>::new();
            let mut __let_tmp_rhs0: Arc<DigestInput> = input.clone();
            let mut digestAlgorithm: Arc<DigestAlgorithm> = __let_tmp_rhs0.digestAlgorithm().clone();
            let mut message: Sequence<u8> = __let_tmp_rhs0.message().clone();
            let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::ExternDigest::_default::Digest(&digestAlgorithm, &message);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut value: Sequence<u8> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(value.cardinality(), u64) == _default::Length(&digestAlgorithm), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("Incorrect length digest from ExternDigest.")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: value.clone()
                        }));
            return res.read();
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/DiscoveryMultiKeyring.dfy(12,1)
pub mod _DiscoveryMultiKeyring_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_MultiKeyring_Compile::MultiKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use crate::implementation_from_dafny::_AwsKmsDiscoveryKeyring_Compile::AwsKmsDiscoveryKeyring;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use ::dafny_runtime::upcast_object;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/DiscoveryMultiKeyring.dfy(35,3)
        pub fn DiscoveryMultiKeyring(regions: &Sequence<Sequence<DafnyCharUTF16>>, discoveryFilter: &Arc<Option<Arc<DiscoveryFilter>>>, clientSupplier: &Object<dyn IClientSupplier>, grantTokens: &Arc<Option<GrantTokenList>>) -> Arc<Result<Object<MultiKeyring>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Object<MultiKeyring>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(0 < truncate!(regions.cardinality(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("No regions passed.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<MultiKeyring>>());
                return output.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!((&crate::implementation_from_dafny::_Seq_Compile::_default::IndexOfOption::<Sequence<DafnyCharUTF16>>(regions, &string_utf16_of(""))).as_ref(), None{ .. }), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Empty string is not a valid region.")
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<MultiKeyring>>());
                return output.read();
            };
            let mut children: Sequence<Object<AwsKmsDiscoveryKeyring>> = seq![] as Sequence<Object<AwsKmsDiscoveryKeyring>>;
            let mut _hi0: u64 = truncate!(regions.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut region: Sequence<DafnyCharUTF16> = regions.get(&int!((&i).clone()));
                let mut valueOrError2: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>>;
                let mut _out0: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput {
                                region: region.clone()
                            }));
                valueOrError2 = _out0.clone();
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<MultiKeyring>>());
                    return output.read();
                };
                let mut client: Object<dyn IKMSClient> = valueOrError2.Extract();
                let mut keyring: Object<AwsKmsDiscoveryKeyring>;
                let mut _nw0: Object<AwsKmsDiscoveryKeyring> = AwsKmsDiscoveryKeyring::_allocate_object();
                AwsKmsDiscoveryKeyring::_ctor(&_nw0, &client, discoveryFilter, &grantTokens.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>)));
                keyring = _nw0.clone();
                children = children.concat(&seq![keyring.clone()]);
            }
            let mut keyring: Object<MultiKeyring>;
            let mut _nw1: Object<MultiKeyring> = MultiKeyring::_allocate_object();
            MultiKeyring::_ctor(&_nw1, &Arc::new(Option::<Object<dyn IKeyring>>::None {}), &Sequence::<Object<AwsKmsDiscoveryKeyring>>::coerce(upcast_object::<AwsKmsDiscoveryKeyring, dyn IKeyring>())(children.clone()));
            keyring = _nw1.clone();
            output = MaybePlacebo::from(Arc::new(Result::<Object<MultiKeyring>, Arc<Error>>::Success {
                            value: keyring.clone()
                        }));
            return output.read();
        }
    }
}
/// ../mpl/libraries/src/NonlinearArithmetic/Internals/DivInternals.dfy(24,1)
pub mod _DivInternals_Compile {
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::int;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/NonlinearArithmetic/Internals/DivInternals.dfy(33,3)
        pub fn DivPos(x: &DafnyInt, d: &DafnyInt) -> DafnyInt {
            let mut _accumulator: DafnyInt = int!(0);
            let mut _r0 = x.clone();
            let mut _r1 = d.clone();
            'TAIL_CALL_START: loop {
                let x = _r0;
                let d = _r1;
                if x.clone() < int!(0) {
                    _accumulator = _accumulator.clone() + int!(-1);
                    let mut _in0: DafnyInt = x.clone() + d.clone();
                    let mut _in1: DafnyInt = d.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                } else {
                    if x.clone() < d.clone() {
                        return int!(0) + _accumulator.clone();
                    } else {
                        _accumulator = _accumulator.clone() + int!(1);
                        let mut _in2: DafnyInt = x.clone() - d.clone();
                        let mut _in3: DafnyInt = d.clone();
                        _r0 = _in2.clone();
                        _r1 = _in3.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/libraries/src/NonlinearArithmetic/Internals/DivInternals.dfy(46,3)
        pub fn DivRecursive(x: &DafnyInt, d: &DafnyInt) -> DafnyInt {
            if int!(0) < d.clone() {
                _default::DivPos(x, d)
            } else {
                int!(-1) * _default::DivPos(x, &(int!(-1) * d.clone()))
            }
        }
    }
}
/// *****************************************************************************
///  Original: Copyright (c) Microsoft Corporation
///  SPDX-License-Identifier: MIT
///
///  Modifications and Extensions: Copyright by the contributors to the Dafny Project
///  SPDX-License-Identifier: MIT
/// *****************************************************************************
/// ../mpl/libraries/src/NonlinearArithmetic/Internals/DivInternalsNonlinear.dfy(11,1)
pub mod _DivInternalsNonlinear_Compile {

}
/// ../mpl/libraries/src/NonlinearArithmetic/DivMod.dfy(19,1)
pub mod _DivMod_Compile {

}
/// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(6,1)
pub mod ECDH {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_dafny_externs::ECDH::KeyGeneration;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetPublicKeyFromPrivateKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetPublicKeyFromPrivateKeyOutput;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::_dafny_externs::ECDH::ECCUtils;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DeriveSharedSecretInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DeriveSharedSecretOutput;
    pub use crate::implementation_from_dafny::_dafny_externs::ECDH::DeriveSharedSecret;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ParsePublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ParsePublicKeyOutput;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(13,3)
        pub fn GenerateEccKeyPair(input: &Arc<GenerateECCKeyPairInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateECCKeyPairOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateECCKeyPairOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EccKeyPair>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EccKeyPair>, Arc<Error>>> = KeyGeneration::GenerateKeyPair(input.eccCurve());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GenerateECCKeyPairOutput>>());
                return output.read();
            };
            let mut keyPair: Arc<EccKeyPair> = valueOrError0.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GenerateECCKeyPairOutput>, Arc<Error>>::Success {
                            value: Arc::new(GenerateECCKeyPairOutput::GenerateECCKeyPairOutput {
                                        eccCurve: input.eccCurve().clone(),
                                        privateKey: Arc::new(ECCPrivateKey::ECCPrivateKey {
                                                    pem: keyPair.privateKey().clone()
                                                }),
                                        publicKey: Arc::new(ECCPublicKey::ECCPublicKey {
                                                    der: keyPair.publicKey().clone()
                                                })
                                    })
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(26,3)
        pub fn GetPublicKeyFromPrivate(input: &Arc<GetPublicKeyFromPrivateKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = ECCUtils::GetPublicKey(input.eccCurve(), input.privateKey());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GetPublicKeyFromPrivateKeyOutput>>());
                return output.read();
            };
            let mut publicKey: Sequence<u8> = valueOrError0.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<Error>>::Success {
                            value: Arc::new(GetPublicKeyFromPrivateKeyOutput::GetPublicKeyFromPrivateKeyOutput {
                                        eccCurve: input.eccCurve().clone(),
                                        privateKey: input.privateKey().clone(),
                                        publicKey: publicKey.clone()
                                    })
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(42,3)
        pub fn ValidatePublicKey(input: &Arc<ValidatePublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ValidatePublicKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ValidatePublicKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<Error>>> = ECCUtils::ValidatePublicKey(input.eccCurve(), input.publicKey());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<ValidatePublicKeyOutput>>());
                return output.read();
            };
            let mut result: bool = valueOrError0.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<ValidatePublicKeyOutput>, Arc<Error>>::Success {
                            value: Arc::new(ValidatePublicKeyOutput::ValidatePublicKeyOutput {
                                        success: result
                                    })
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(56,3)
        pub fn DeriveSharedSecret(input: &Arc<DeriveSharedSecretInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DeriveSharedSecretOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DeriveSharedSecretOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = DeriveSharedSecret::CalculateSharedSecret(input.eccCurve(), input.privateKey(), input.publicKey());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<DeriveSharedSecretOutput>>());
                return output.read();
            };
            let mut derivedSharedSecret: Sequence<u8> = valueOrError0.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<DeriveSharedSecretOutput>, Arc<Error>>::Success {
                            value: Arc::new(DeriveSharedSecretOutput::DeriveSharedSecretOutput {
                                        sharedSecret: derivedSharedSecret.clone()
                                    })
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(70,3)
        pub fn CompressPublicKey(input: &Arc<CompressPublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CompressPublicKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CompressPublicKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = ECCUtils::CompressPublicKey(input.publicKey().der(), input.eccCurve());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<CompressPublicKeyOutput>>());
                return output.read();
            };
            let mut compressedPublicKey: Sequence<u8> = valueOrError0.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<CompressPublicKeyOutput>, Arc<Error>>::Success {
                            value: Arc::new(CompressPublicKeyOutput::CompressPublicKeyOutput {
                                        compressedPublicKey: compressedPublicKey.clone()
                                    })
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(84,3)
        pub fn DecompressPublicKey(input: &Arc<DecompressPublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecompressPublicKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecompressPublicKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = ECCUtils::DecompressPublicKey(input.compressedPublicKey(), input.eccCurve());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<DecompressPublicKeyOutput>>());
                return output.read();
            };
            let mut decompressedPublicKey: Sequence<u8> = valueOrError0.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<DecompressPublicKeyOutput>, Arc<Error>>::Success {
                            value: Arc::new(DecompressPublicKeyOutput::DecompressPublicKeyOutput {
                                        publicKey: Arc::new(ECCPublicKey::ECCPublicKey {
                                                    der: decompressedPublicKey.clone()
                                                })
                                    })
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(98,3)
        pub fn ParsePublicKey(input: &Arc<ParsePublicKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ParsePublicKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ParsePublicKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> = ECCUtils::ParsePublicKey(input.publicKey());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<ParsePublicKeyOutput>>());
                return output.read();
            };
            let mut derPublicKey: Sequence<u8> = valueOrError0.Extract();
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<ParsePublicKeyOutput>, Arc<Error>>::Success {
                            value: Arc::new(ParsePublicKeyOutput::ParsePublicKeyOutput {
                                        publicKey: Arc::new(ECCPublicKey::ECCPublicKey {
                                                    der: derPublicKey.clone()
                                                })
                                    })
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(162,3)
        pub fn CreateExternEccKeyGenSuccess(output: &Arc<EccKeyPair>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EccKeyPair>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<EccKeyPair>, Arc<Error>>::Success {
                    value: output.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(166,3)
        pub fn CreateExternEccKeyGenFailure(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EccKeyPair>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<EccKeyPair>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(170,3)
        pub fn CreateExternGetPublicKeyFromPrivateSuccess(output: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: output.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(174,3)
        pub fn CreateExternGetPublicKeyFromPrivateError(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(178,3)
        pub fn CreateExternValidatePublicKeySuccess(output: bool) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Arc<Error>>::Success {
                    value: output
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(182,3)
        pub fn CreateExternValidatePublicKeyError(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(186,3)
        pub fn CreateExternDerivesharedSecretSuccess(output: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: output.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(190,3)
        pub fn CreateExternDerivesharedSecretError(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(194,3)
        pub fn CreateExternCompressPublicKeyError(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(198,3)
        pub fn CreateExternCompressPublicKeySuccess(output: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: output.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(202,3)
        pub fn CreateExternDecompressPublicKeyError(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(206,3)
        pub fn CreateExternDecompressPublicKeySuccess(output: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: output.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(210,3)
        pub fn CreateExternParsePublicKeyError(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(214,3)
        pub fn CreateExternParsePublicKeySuccess(output: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: output.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(218,3)
        pub fn CreateGetInfinityPublicKeyError(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(222,3)
        pub fn CreateGetInfinityPublicKeySuccess(output: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: output.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(226,3)
        pub fn CreateGetOutOfBoundsPublicKeyError(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(230,3)
        pub fn CreateGetOutOfBoundsPublicKeySuccess(output: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: output.clone()
                })
        }
    }

    /// ../mpl/AwsCryptographyPrimitives/src/ECDH.dfy(11,3)
    #[derive(PartialEq, Clone)]
    pub enum EccKeyPair {
        EccKeyPair {
            privateKey: Sequence<u8>,
            publicKey: Sequence<u8>
        }
    }

    impl EccKeyPair {
        /// Returns a borrow of the field privateKey
        pub fn privateKey(&self) -> &Sequence<u8> {
            match self {
                EccKeyPair::EccKeyPair{privateKey, publicKey, } => privateKey,
            }
        }
        /// Returns a borrow of the field publicKey
        pub fn publicKey(&self) -> &Sequence<u8> {
            match self {
                EccKeyPair::EccKeyPair{privateKey, publicKey, } => publicKey,
            }
        }
    }

    impl Debug
        for EccKeyPair {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for EccKeyPair {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                EccKeyPair::EccKeyPair{privateKey, publicKey, } => {
                    write!(_formatter, "ECDH.EccKeyPair.EccKeyPair(")?;
                    DafnyPrint::fmt_print(privateKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(publicKey, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for EccKeyPair {}

    impl Hash
        for EccKeyPair {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                EccKeyPair::EccKeyPair{privateKey, publicKey, } => {
                    Hash::hash(privateKey, _state);
                    Hash::hash(publicKey, _state)
                },
            }
        }
    }

    impl Default
        for EccKeyPair {
        fn default() -> EccKeyPair {
            EccKeyPair::EccKeyPair {
                privateKey: Default::default(),
                publicKey: Default::default()
            }
        }
    }

    impl AsRef<EccKeyPair>
        for EccKeyPair {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(11,1)
pub mod _EcdhEdkWrapping_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::KdfCtrInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec::ECC_NIST_P256;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec::ECC_NIST_P384;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec::ECC_NIST_P521;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::dafny_runtime::seq;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use ::dafny_runtime::allocate_object;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapOutput;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::Zero;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(464,3)
        pub fn DeriveSharedKeyingMaterial(sharedSecret: &Sequence<u8>, fixedInfo: &Sequence<u8>, salt: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybeDerivedKeyingMaterial: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::KdfCounterMode(rd!(crypto.clone()), &Arc::new(KdfCtrInput::KdfCtrInput {
                            digestAlgorithm: Arc::new(DigestAlgorithm::SHA_384 {}),
                            ikm: sharedSecret.clone(),
                            expectedLength: crate::implementation_from_dafny::_Constants_Compile::_default::KDF_EXPECTED_LEN(),
                            purpose: Arc::new(Option::<Sequence<u8>>::Some {
                                        value: fixedInfo.clone()
                                    }),
                            nonce: Arc::new(Option::<Sequence<u8>>::Some {
                                        value: salt.clone()
                                    })
                        }));
            maybeDerivedKeyingMaterial = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeDerivedKeyingMaterial.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut derivedKeyingMaterial: Sequence<u8> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: derivedKeyingMaterial.clone()
                        }));
            return res.read();
        }
        /// = aws-encryption-sdk-specification/framework/key-agreement-schemas.md#key-derivation
        /// = type=implication
        /// # The FixedInfo field MUST be serialized in the following order:
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(513,3)
        pub fn SerializeFixedInfo(ecdhKeyDerivationUtf8: &ValidUTF8Bytes, curveSpecUtf8: &ValidUTF8Bytes, senderPublicKey: &Sequence<u8>, recipientPublicKey: &Sequence<u8>, canonicalizedEC: &Sequence<u8>, keyringVersion: &Sequence<u8>) -> Sequence<u8> {
            ecdhKeyDerivationUtf8.concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMITER()).concat(curveSpecUtf8).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMITER()).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_PRF_NAME()).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMITER()).concat(senderPublicKey).concat(recipientPublicKey).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMITER()).concat(keyringVersion).concat(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_DELIMITER()).concat(canonicalizedEC)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(574,3)
        pub fn CurveSpecTypeToString(c: &Arc<ECDHCurveSpec>) -> Sequence<DafnyCharUTF16> {
            let mut _source0: Arc<ECDHCurveSpec> = c.clone();
            if matches!((&_source0).as_ref(), ECC_NIST_P256{ .. }) {
                string_utf16_of("p256")
            } else {
                if matches!((&_source0).as_ref(), ECC_NIST_P384{ .. }) {
                    string_utf16_of("p384")
                } else {
                    if matches!((&_source0).as_ref(), ECC_NIST_P521{ .. }) {
                        string_utf16_of("p521")
                    } else {
                        string_utf16_of("sm2")
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(584,3)
        pub fn E(s: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error> {
            Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                    message: s.clone()
                })
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(27,3)
    #[derive(PartialEq, Clone)]
    pub enum EcdhUnwrapInfo {
        EcdhUnwrapInfo {}
    }

    impl EcdhUnwrapInfo {}

    impl Debug
        for EcdhUnwrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for EcdhUnwrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                EcdhUnwrapInfo::EcdhUnwrapInfo{} => {
                    write!(_formatter, "EcdhEdkWrapping_Compile.EcdhUnwrapInfo.EcdhUnwrapInfo")?;
                    Ok(())
                },
            }
        }
    }

    impl EcdhUnwrapInfo {
        /// Enumerates all possible values of EcdhUnwrapInfo
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<EcdhUnwrapInfo>> {
            seq![Arc::new(EcdhUnwrapInfo::EcdhUnwrapInfo {})].iter()
        }
    }

    impl Eq
        for EcdhUnwrapInfo {}

    impl Hash
        for EcdhUnwrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                EcdhUnwrapInfo::EcdhUnwrapInfo{} => {

                },
            }
        }
    }

    impl Default
        for EcdhUnwrapInfo {
        fn default() -> EcdhUnwrapInfo {
            EcdhUnwrapInfo::EcdhUnwrapInfo {}
        }
    }

    impl AsRef<EcdhUnwrapInfo>
        for EcdhUnwrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(28,3)
    #[derive(PartialEq, Clone)]
    pub enum EcdhWrapInfo {
        EcdhWrapInfo {}
    }

    impl EcdhWrapInfo {}

    impl Debug
        for EcdhWrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for EcdhWrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                EcdhWrapInfo::EcdhWrapInfo{} => {
                    write!(_formatter, "EcdhEdkWrapping_Compile.EcdhWrapInfo.EcdhWrapInfo")?;
                    Ok(())
                },
            }
        }
    }

    impl EcdhWrapInfo {
        /// Enumerates all possible values of EcdhWrapInfo
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<EcdhWrapInfo>> {
            seq![Arc::new(EcdhWrapInfo::EcdhWrapInfo {})].iter()
        }
    }

    impl Eq
        for EcdhWrapInfo {}

    impl Hash
        for EcdhWrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                EcdhWrapInfo::EcdhWrapInfo{} => {

                },
            }
        }
    }

    impl Default
        for EcdhWrapInfo {
        fn default() -> EcdhWrapInfo {
            EcdhWrapInfo::EcdhWrapInfo {}
        }
    }

    impl AsRef<EcdhWrapInfo>
        for EcdhWrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(30,3)
    pub struct EcdhUnwrap {
        pub __i_senderPublicKey: Sequence<u8>,
        pub __i_recipientPublicKey: Sequence<u8>,
        pub __i_sharedSecret: Sequence<u8>,
        pub __i_keyringVersion: Sequence<u8>,
        pub __i_curveSpec: Arc<ECDHCurveSpec>,
        pub __i_crypto: Object<AtomicPrimitivesClient>
    }

    impl EcdhUnwrap {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(40,5)
        pub fn _ctor(this: &Object<EcdhUnwrap>, senderPublicKey: &Sequence<u8>, recipientPublicKey: &Sequence<u8>, sharedSecret: &Sequence<u8>, keyringVersion: &Sequence<u8>, curveSpec: &Arc<ECDHCurveSpec>, crypto: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_senderPublicKey: bool = false;
            let mut _set___i_recipientPublicKey: bool = false;
            let mut _set___i_sharedSecret: bool = false;
            let mut _set___i_keyringVersion: bool = false;
            let mut _set___i_curveSpec: bool = false;
            let mut _set___i_crypto: bool = false;
            update_field_uninit_object!(this.clone(), __i_senderPublicKey, _set___i_senderPublicKey, senderPublicKey.clone());
            update_field_uninit_object!(this.clone(), __i_recipientPublicKey, _set___i_recipientPublicKey, recipientPublicKey.clone());
            update_field_uninit_object!(this.clone(), __i_sharedSecret, _set___i_sharedSecret, sharedSecret.clone());
            update_field_uninit_object!(this.clone(), __i_keyringVersion, _set___i_keyringVersion, keyringVersion.clone());
            update_field_uninit_object!(this.clone(), __i_curveSpec, _set___i_curveSpec, curveSpec.clone());
            update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(207,5)
        pub fn commitmentKeyCheck(&self, calculatedCommitmentKey: &Sequence<u8>, serializedCommitmentKey: &Sequence<u8>) -> bool {
            let mut res: bool = <bool as Default>::default();
            let mut _diff_q: u8 = 0 as u8;
            let mut _hi0: u64 = truncate!(serializedCommitmentKey.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                _diff_q = _diff_q | calculatedCommitmentKey.get(&int!((&i).clone())) as u8 ^ serializedCommitmentKey.get(&int!((&i).clone())) as u8;
            }
            res = _diff_q == 0 as u8;
            return res;
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(33,5)
        pub fn senderPublicKey(&self) -> Sequence<u8> {
            self.__i_senderPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(34,5)
        pub fn recipientPublicKey(&self) -> Sequence<u8> {
            self.__i_recipientPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(35,5)
        pub fn sharedSecret(&self) -> Sequence<u8> {
            self.__i_sharedSecret.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(36,5)
        pub fn keyringVersion(&self) -> Sequence<u8> {
            self.__i_keyringVersion.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(37,5)
        pub fn curveSpec(&self) -> Arc<ECDHCurveSpec> {
            self.__i_curveSpec.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(38,5)
        pub fn crypto(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_crypto.clone()
        }
    }

    impl UpcastObject<DynAny>
        for EcdhUnwrap {
        UpcastObjectFn!(DynAny);
    }

    impl UnwrapMaterial<Arc<EcdhUnwrapInfo>>
        for EcdhUnwrap {}

    impl UpcastObject<dyn UnwrapMaterial<Arc<EcdhUnwrapInfo>>>
        for EcdhUnwrap {
        UpcastObjectFn!(dyn UnwrapMaterial<Arc<EcdhUnwrapInfo>>);
    }

    impl ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for EcdhUnwrap {}

    impl UpcastObject<dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for EcdhUnwrap {
        UpcastObjectFn!(dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for EcdhUnwrap {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(88,5)
        fn Invoke(&self, input: &Arc<UnwrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.algorithmSuite().clone();
            let mut wrappedMaterial: Sequence<u8> = input.wrappedMaterial().clone();
            let mut aad: Map<ValidUTF8Bytes, ValidUTF8Bytes> = input.encryptionContext().clone();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Constants_Compile::_default::CIPHERTEXT_WRAPPED_MATERIAL_INDEX() < truncate!(wrappedMaterial.cardinality(), u64), &_default::E(&string_utf16_of("Received ciphertext is shorter than expected.")));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>>());
                return res.read();
            };
            let mut KeyLength: i32 = crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite);
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX()) + int!(KeyLength) < wrappedMaterial.cardinality(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Received EDK Ciphertext of incorrect length3.")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>>());
                return res.read();
            };
            let mut kdfNonce: Sequence<u8> = wrappedMaterial.take(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_COMMITMENT_KEY_INDEX()).clone()));
            let mut iv: Sequence<u8> = {
                    let _initializer = {
                            Arc::new(move |_v0: &DafnyInt| -> u8{
                                    0
                                })
                        };
                    integer_range(Zero::zero(), int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_AES_256_ENC_ALG().ivLength().clone())).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                };
            let mut commitmentKey: Sequence<u8> = wrappedMaterial.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_COMMITMENT_KEY_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX()).clone()));
            let mut wrappedKey: Sequence<u8> = wrappedMaterial.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX()).clone()), &int!((&(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX() + KeyLength as u64)).clone()));
            let mut authTag: Sequence<u8> = wrappedMaterial.drop(&int!((&(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_WRAPPED_KEY_MATERIAL_INDEX() + KeyLength as u64)).clone()));
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&_default::CurveSpecTypeToString(&self.curveSpec().clone())).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| _default::E(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>>());
                return res.read();
            };
            let mut curveSpecUtf8: ValidUTF8Bytes = valueOrError2.Extract();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.encryptionContext());
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>>());
                return res.read();
            };
            let mut canonicalizedEC: Sequence<u8> = valueOrError3.Extract();
            let mut fixedInfo: Sequence<u8> = _default::SerializeFixedInfo(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_UTF8(), &curveSpecUtf8, &self.senderPublicKey().clone(), &self.recipientPublicKey().clone(), &canonicalizedEC, &self.keyringVersion().clone());
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DeriveSharedKeyingMaterial(&self.sharedSecret().clone(), &fixedInfo, &kdfNonce, &self.crypto().clone());
            valueOrError4 = _out0.clone();
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>>());
                return res.read();
            };
            let mut derivedKeyingMaterial: Sequence<u8> = valueOrError4.Extract();
            let mut calculatedCommitmentKey: Sequence<u8> = derivedKeyingMaterial.take(&int!((&truncate!((&int!(32)).clone(), u32)).clone()));
            let mut sharedKeyingMaterial: Sequence<u8> = derivedKeyingMaterial.drop(&int!((&truncate!((&int!(32)).clone(), u32)).clone()));
            let mut valueOrError5: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(calculatedCommitmentKey.cardinality(), u64) == truncate!(commitmentKey.cardinality(), u64), &_default::E(&string_utf16_of("Calculated commitment key length does NOT match expected commitment key length")));
            if valueOrError5.IsFailure() {
                res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>>());
                return res.read();
            };
            let mut _check_q: bool;
            let mut _out1: bool = self.commitmentKeyCheck(&calculatedCommitmentKey, &commitmentKey);
            _check_q = _out1;
            let mut valueOrError6: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(_check_q, &_default::E(&string_utf16_of("Commitment keys do not match")));
            if valueOrError6.IsFailure() {
                res = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>>());
                return res.read();
            };
            let mut maybeUnwrappedPdk: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESDecrypt(rd!(self.crypto().clone()), &Arc::new(AESDecryptInput::AESDecryptInput {
                            encAlg: crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_AES_256_ENC_ALG(),
                            key: sharedKeyingMaterial.clone(),
                            cipherTxt: wrappedKey.clone(),
                            authTag: authTag.clone(),
                            iv: iv.clone(),
                            aad: fixedInfo.clone()
                        }));
            maybeUnwrappedPdk = _out2.clone();
            let mut valueOrError7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeUnwrappedPdk.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError7.IsFailure() {
                res = MaybePlacebo::from(valueOrError7.PropagateFailure::<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>>());
                return res.read();
            };
            let mut unwrappedPdk: Sequence<u8> = valueOrError7.Extract();
            let mut valueOrError8: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(unwrappedPdk.cardinality(), u64) == crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite()) as u64, &_default::E(&string_utf16_of("Invalid Key Length")));
            if valueOrError8.IsFailure() {
                res = MaybePlacebo::from(valueOrError8.PropagateFailure::<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>>());
                return res.read();
            };
            let mut output: Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>> = Arc::new(UnwrapOutput::<Arc<EcdhUnwrapInfo>>::UnwrapOutput {
                        unwrappedMaterial: unwrappedPdk.clone(),
                        unwrapInfo: Arc::new(EcdhUnwrapInfo::EcdhUnwrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for EcdhUnwrap {
        UpcastObjectFn!(dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(229,3)
    pub struct EcdhGenerateAndWrapKeyMaterial {
        pub __i_crypto: Object<AtomicPrimitivesClient>,
        pub __i_sharedSecret: Sequence<u8>,
        pub __i_fixedInfo: Sequence<u8>
    }

    impl EcdhGenerateAndWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(236,5)
        pub fn _ctor(this: &Object<EcdhGenerateAndWrapKeyMaterial>, sharedSecret: &Sequence<u8>, fixedInfo: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_crypto: bool = false;
            let mut _set___i_sharedSecret: bool = false;
            let mut _set___i_fixedInfo: bool = false;
            update_field_uninit_object!(this.clone(), __i_sharedSecret, _set___i_sharedSecret, sharedSecret.clone());
            update_field_uninit_object!(this.clone(), __i_fixedInfo, _set___i_fixedInfo, fixedInfo.clone());
            update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(234,5)
        pub fn crypto(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_crypto.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(232,5)
        pub fn sharedSecret(&self) -> Sequence<u8> {
            self.__i_sharedSecret.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(233,5)
        pub fn fixedInfo(&self) -> Sequence<u8> {
            self.__i_fixedInfo.clone()
        }
    }

    impl UpcastObject<DynAny>
        for EcdhGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl GenerateAndWrapMaterial<Arc<EcdhWrapInfo>>
        for EcdhGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn GenerateAndWrapMaterial<Arc<EcdhWrapInfo>>>
        for EcdhGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn GenerateAndWrapMaterial<Arc<EcdhWrapInfo>>);
    }

    impl ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for EcdhGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for EcdhGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for EcdhGenerateAndWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(275,5)
        fn Invoke(&self, input: &Arc<GenerateAndWrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.algorithmSuite().clone();
            let mut pdkResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(self.crypto().clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                            length: crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite)
                        }));
            pdkResult = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = pdkResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>>());
                return res.read();
            };
            let mut pdk: Sequence<u8> = valueOrError0.Extract();
            let mut wrap: Object<EcdhWrapKeyMaterial>;
            let mut _nw0: Object<EcdhWrapKeyMaterial> = EcdhWrapKeyMaterial::_allocate_object();
            EcdhWrapKeyMaterial::_ctor(&_nw0, &self.sharedSecret().clone(), &self.fixedInfo().clone(), &self.crypto().clone());
            wrap = _nw0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = Action::<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::Invoke(rd!(wrap.clone()), &Arc::new(WrapInput::WrapInput {
                            plaintextMaterial: pdk.clone(),
                            algorithmSuite: input.algorithmSuite().clone(),
                            encryptionContext: input.encryptionContext().clone(),
                            serializedEC: input.serializedEC().clone()
                        }));
            valueOrError1 = _out1.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>>());
                return res.read();
            };
            let mut wrapOutput: Arc<WrapOutput<Arc<EcdhWrapInfo>>> = valueOrError1.Extract();
            let mut output: Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>> = Arc::new(GenerateAndWrapOutput::<Arc<EcdhWrapInfo>>::GenerateAndWrapOutput {
                        plaintextMaterial: pdk.clone(),
                        wrappedMaterial: wrapOutput.wrappedMaterial().clone(),
                        wrapInfo: wrapOutput.wrapInfo().clone()
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for EcdhGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(318,3)
    pub struct EcdhWrapKeyMaterial {
        pub __i_crypto: Object<AtomicPrimitivesClient>,
        pub __i_fixedInfo: Sequence<u8>,
        pub __i_sharedSecret: Sequence<u8>
    }

    impl EcdhWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(325,5)
        pub fn _ctor(this: &Object<EcdhWrapKeyMaterial>, sharedSecret: &Sequence<u8>, fixedInfo: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_crypto: bool = false;
            let mut _set___i_fixedInfo: bool = false;
            let mut _set___i_sharedSecret: bool = false;
            update_field_uninit_object!(this.clone(), __i_sharedSecret, _set___i_sharedSecret, sharedSecret.clone());
            update_field_uninit_object!(this.clone(), __i_fixedInfo, _set___i_fixedInfo, fixedInfo.clone());
            update_field_uninit_object!(this.clone(), __i_crypto, _set___i_crypto, crypto.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(323,5)
        pub fn crypto(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_crypto.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(322,5)
        pub fn fixedInfo(&self) -> Sequence<u8> {
            self.__i_fixedInfo.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(321,5)
        pub fn sharedSecret(&self) -> Sequence<u8> {
            self.__i_sharedSecret.clone()
        }
    }

    impl UpcastObject<DynAny>
        for EcdhWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl WrapMaterial<Arc<EcdhWrapInfo>>
        for EcdhWrapKeyMaterial {}

    impl UpcastObject<dyn WrapMaterial<Arc<EcdhWrapInfo>>>
        for EcdhWrapKeyMaterial {
        UpcastObjectFn!(dyn WrapMaterial<Arc<EcdhWrapInfo>>);
    }

    impl ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for EcdhWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for EcdhWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for EcdhWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EcdhEdkWrapping.dfy(384,5)
        fn Invoke(&self, input: &Arc<WrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.algorithmSuite().clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.encryptionContext());
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<WrapOutput<Arc<EcdhWrapInfo>>>>());
                return res.read();
            };
            let mut canonicalizedEC: Sequence<u8> = valueOrError0.Extract();
            let mut maybeSalt: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(self.crypto().clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                            length: crate::implementation_from_dafny::_Constants_Compile::_default::KDF_SALT_LEN()
                        }));
            maybeSalt = _out0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeSalt.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<WrapOutput<Arc<EcdhWrapInfo>>>>());
                return res.read();
            };
            let mut salt: Sequence<u8> = valueOrError1.Extract();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DeriveSharedKeyingMaterial(&self.sharedSecret().clone(), &self.fixedInfo().clone(), &salt, &self.crypto().clone());
            valueOrError2 = _out1.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<WrapOutput<Arc<EcdhWrapInfo>>>>());
                return res.read();
            };
            let mut derivedKeyingMaterial: Sequence<u8> = valueOrError2.Extract();
            let mut commitmentKey: Sequence<u8> = derivedKeyingMaterial.take(&int!((&truncate!((&int!(32)).clone(), u32)).clone()));
            let mut sharedKeyingMaterial: Sequence<u8> = derivedKeyingMaterial.drop(&int!((&truncate!((&int!(32)).clone(), u32)).clone()));
            let mut iv: Sequence<u8> = {
                    let _initializer = {
                            Arc::new(move |_v3: &DafnyInt| -> u8{
                                    0
                                })
                        };
                    integer_range(Zero::zero(), int!(crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_AES_256_ENC_ALG().ivLength().clone())).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                };
            let mut maybeWrappedPdk: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESEncrypt(rd!(self.crypto().clone()), &Arc::new(AESEncryptInput::AESEncryptInput {
                            encAlg: crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_AES_256_ENC_ALG(),
                            iv: iv.clone(),
                            key: sharedKeyingMaterial.clone(),
                            msg: input.plaintextMaterial().clone(),
                            aad: self.fixedInfo().clone()
                        }));
            maybeWrappedPdk = _out2.clone();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeWrappedPdk.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<WrapOutput<Arc<EcdhWrapInfo>>>>());
                return res.read();
            };
            let mut wrappedPdk: Arc<AESEncryptOutput> = valueOrError3.Extract();
            let mut output: Arc<WrapOutput<Arc<EcdhWrapInfo>>> = Arc::new(WrapOutput::<Arc<EcdhWrapInfo>>::WrapOutput {
                        wrappedMaterial: salt.concat(&commitmentKey).concat(wrappedPdk.cipherText()).concat(wrappedPdk.authTag()),
                        wrapInfo: Arc::new(EcdhWrapInfo::EcdhWrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for EcdhWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(14,1)
pub mod _EdkWrapping_Compile {
    pub use ::dafny_runtime::DafnyType;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::DIRECT_KEY_WRAPPING;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapOutput;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapInput;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EdkWrappingAlgorithm::IntermediateKeyWrapping;
    pub use crate::implementation_from_dafny::_IntermediateKeyWrapping_Compile::IntermediateWrapOutput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF;
    pub use crate::implementation_from_dafny::_IntermediateKeyWrapping_Compile::IntermediateGenerateAndWrapOutput;
    pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapInput;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::_IntermediateKeyWrapping_Compile::IntermediateUnwrapOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_IntermediateKeyWrapping_Compile::DeserializedIntermediateWrappedMaterial;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(73,3)
        pub fn WrapEdkMaterial<_T: DafnyType>(encryptionMaterials: &Arc<EncryptionMaterials>, wrap: &Object<dyn WrapMaterial<_T>>, generateAndWrap: &Object<dyn GenerateAndWrapMaterial<_T>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<_T>>, Arc<Error>>> {
            let mut ret = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<_T>>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterials(encryptionMaterials), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid materials for encryption.")
                        }));
            if valueOrError0.IsFailure() {
                ret = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<WrapEdkMaterialOutput<_T>>>());
                return ret.read();
            };
            if matches!(encryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) && matches!(encryptionMaterials.algorithmSuite().edkWrapping().as_ref(), DIRECT_KEY_WRAPPING{ .. }) {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<_T>>, Arc<Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<_T>>, Arc<Error>>> = Action::<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<_T>>, Arc<Error>>>>::Invoke(rd!(wrap.clone()), &Arc::new(WrapInput::WrapInput {
                                plaintextMaterial: encryptionMaterials.plaintextDataKey().value().clone(),
                                algorithmSuite: encryptionMaterials.algorithmSuite().clone(),
                                encryptionContext: encryptionMaterials.encryptionContext().clone(),
                                serializedEC: crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionMaterials.encryptionContext())
                            }));
                valueOrError1 = _out0.clone();
                if valueOrError1.IsFailure() {
                    ret = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<WrapEdkMaterialOutput<_T>>>());
                    return ret.read();
                };
                let mut directOutput: Arc<WrapOutput<_T>> = valueOrError1.Extract();
                ret = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<WrapEdkMaterialOutput<_T>>, Arc<Error>>::Success {
                                value: Arc::new(WrapEdkMaterialOutput::<_T>::WrapOnlyEdkMaterialOutput {
                                            wrappedMaterial: directOutput.wrappedMaterial().clone(),
                                            symmetricSigningKey: Arc::new(Option::<Sequence<u8>>::None {}),
                                            wrapInfo: directOutput.wrapInfo().clone()
                                        })
                            }));
                return ret.read();
            } else {
                if matches!(encryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) && matches!(encryptionMaterials.algorithmSuite().edkWrapping().as_ref(), IntermediateKeyWrapping{ .. }) {
                    let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateWrapOutput<_T>>, Arc<Error>>>;
                    let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateWrapOutput<_T>>, Arc<Error>>> = crate::implementation_from_dafny::_IntermediateKeyWrapping_Compile::_default::IntermediateWrap::<_T>(generateAndWrap, encryptionMaterials.plaintextDataKey().value(), encryptionMaterials.algorithmSuite(), encryptionMaterials.encryptionContext());
                    valueOrError2 = _out1.clone();
                    if valueOrError2.IsFailure() {
                        ret = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<WrapEdkMaterialOutput<_T>>>());
                        return ret.read();
                    };
                    let mut intermediateOutput: Arc<IntermediateWrapOutput<_T>> = valueOrError2.Extract();
                    ret = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<WrapEdkMaterialOutput<_T>>, Arc<Error>>::Success {
                                    value: Arc::new(WrapEdkMaterialOutput::<_T>::WrapOnlyEdkMaterialOutput {
                                                wrappedMaterial: intermediateOutput.wrappedMaterial().clone(),
                                                symmetricSigningKey: Arc::new(Option::<Sequence<u8>>::Some {
                                                            value: intermediateOutput.symmetricSigningKey().clone()
                                                        }),
                                                wrapInfo: intermediateOutput.wrapInfo().clone()
                                            })
                                }));
                    return ret.read();
                } else {
                    if matches!(encryptionMaterials.plaintextDataKey().as_ref(), None{ .. }) && matches!(encryptionMaterials.algorithmSuite().edkWrapping().as_ref(), DIRECT_KEY_WRAPPING{ .. }) {
                        let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<_T>>, Arc<Error>>>;
                        let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<_T>>, Arc<Error>>> = Action::<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<_T>>, Arc<Error>>>>::Invoke(rd!(generateAndWrap.clone()), &Arc::new(GenerateAndWrapInput::GenerateAndWrapInput {
                                        algorithmSuite: encryptionMaterials.algorithmSuite().clone(),
                                        encryptionContext: encryptionMaterials.encryptionContext().clone(),
                                        serializedEC: crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionMaterials.encryptionContext())
                                    }));
                        valueOrError3 = _out2.clone();
                        if valueOrError3.IsFailure() {
                            ret = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<WrapEdkMaterialOutput<_T>>>());
                            return ret.read();
                        };
                        let mut directOutput: Arc<GenerateAndWrapOutput<_T>> = valueOrError3.Extract();
                        ret = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<WrapEdkMaterialOutput<_T>>, Arc<Error>>::Success {
                                        value: Arc::new(WrapEdkMaterialOutput::<_T>::GenerateAndWrapEdkMaterialOutput {
                                                    plaintextDataKey: directOutput.plaintextMaterial().clone(),
                                                    wrappedMaterial: directOutput.wrappedMaterial().clone(),
                                                    symmetricSigningKey: Arc::new(Option::<Sequence<u8>>::None {}),
                                                    wrapInfo: directOutput.wrapInfo().clone()
                                                })
                                    }));
                        return ret.read();
                    } else {
                        if matches!(encryptionMaterials.plaintextDataKey().as_ref(), None{ .. }) && matches!(encryptionMaterials.algorithmSuite().edkWrapping().as_ref(), IntermediateKeyWrapping{ .. }) {
                            let mut valueOrError4: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(encryptionMaterials.algorithmSuite().commitment().as_ref(), HKDF{ .. }), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                            message: string_utf16_of("Invalid algorithm suite: suites with intermediate key wrapping must use key commitment.")
                                        }));
                            if valueOrError4.IsFailure() {
                                ret = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<WrapEdkMaterialOutput<_T>>>());
                                return ret.read();
                            };
                            let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateGenerateAndWrapOutput<_T>>, Arc<Error>>>;
                            let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateGenerateAndWrapOutput<_T>>, Arc<Error>>> = crate::implementation_from_dafny::_IntermediateKeyWrapping_Compile::_default::IntermediateGenerateAndWrap::<_T>(generateAndWrap, encryptionMaterials.algorithmSuite(), encryptionMaterials.encryptionContext());
                            valueOrError5 = _out3.clone();
                            if valueOrError5.IsFailure() {
                                ret = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<WrapEdkMaterialOutput<_T>>>());
                                return ret.read();
                            };
                            let mut intermediateOutput: Arc<IntermediateGenerateAndWrapOutput<_T>> = valueOrError5.Extract();
                            ret = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<WrapEdkMaterialOutput<_T>>, Arc<Error>>::Success {
                                            value: Arc::new(WrapEdkMaterialOutput::<_T>::GenerateAndWrapEdkMaterialOutput {
                                                        plaintextDataKey: intermediateOutput.plaintextDataKey().clone(),
                                                        wrappedMaterial: intermediateOutput.wrappedMaterial().clone(),
                                                        symmetricSigningKey: Arc::new(Option::<Sequence<u8>>::Some {
                                                                    value: intermediateOutput.symmetricSigningKey().clone()
                                                                }),
                                                        wrapInfo: intermediateOutput.wrapInfo().clone()
                                                    })
                                        }));
                            return ret.read();
                        }
                    }
                }
            };
            return ret.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(275,3)
        pub fn UnwrapEdkMaterial<_T: DafnyType>(wrappedMaterial: &Sequence<u8>, decryptionMaterials: &DecryptionMaterialsPendingPlaintextDataKey, unwrap: &Object<dyn UnwrapMaterial<_T>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<_T>>, Arc<Error>>> {
            let mut ret = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<_T>>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidDecryptionMaterials(decryptionMaterials), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid materials for decryption.")
                        }));
            if valueOrError0.IsFailure() {
                ret = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<UnwrapEdkMaterialOutput<_T>>>());
                return ret.read();
            };
            if matches!(decryptionMaterials.algorithmSuite().edkWrapping().as_ref(), DIRECT_KEY_WRAPPING{ .. }) {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<_T>>, Arc<Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<_T>>, Arc<Error>>> = Action::<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<_T>>, Arc<Error>>>>::Invoke(rd!(unwrap.clone()), &Arc::new(UnwrapInput::UnwrapInput {
                                wrappedMaterial: wrappedMaterial.clone(),
                                algorithmSuite: decryptionMaterials.algorithmSuite().clone(),
                                encryptionContext: decryptionMaterials.encryptionContext().clone(),
                                serializedEC: crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(decryptionMaterials.encryptionContext())
                            }));
                valueOrError1 = _out0.clone();
                if valueOrError1.IsFailure() {
                    ret = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<UnwrapEdkMaterialOutput<_T>>>());
                    return ret.read();
                };
                let mut directOutput: Arc<UnwrapOutput<_T>> = valueOrError1.Extract();
                ret = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<UnwrapEdkMaterialOutput<_T>>, Arc<Error>>::Success {
                                value: Arc::new(UnwrapEdkMaterialOutput::<_T>::UnwrapEdkMaterialOutput {
                                            plaintextDataKey: directOutput.unwrappedMaterial().clone(),
                                            symmetricSigningKey: Arc::new(Option::<Sequence<u8>>::None {}),
                                            unwrapInfo: directOutput.unwrapInfo().clone()
                                        })
                            }));
                return ret.read();
            } else {
                if matches!(decryptionMaterials.algorithmSuite().edkWrapping().as_ref(), IntermediateKeyWrapping{ .. }) {
                    let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(wrappedMaterial.cardinality(), u64) >= (decryptionMaterials.algorithmSuite().encrypt().AES_GCM().keyLength().clone() + decryptionMaterials.algorithmSuite().encrypt().AES_GCM().tagLength().clone()) as u64, &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Invalid material for Intermediate Unwrapping")
                                }));
                    if valueOrError2.IsFailure() {
                        ret = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<UnwrapEdkMaterialOutput<_T>>>());
                        return ret.read();
                    };
                    let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateUnwrapOutput<_T>>, Arc<Error>>>;
                    let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateUnwrapOutput<_T>>, Arc<Error>>> = crate::implementation_from_dafny::_IntermediateKeyWrapping_Compile::_default::IntermediateUnwrap::<_T>(unwrap, wrappedMaterial, decryptionMaterials.algorithmSuite(), decryptionMaterials.encryptionContext());
                    valueOrError3 = _out1.clone();
                    if valueOrError3.IsFailure() {
                        ret = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<UnwrapEdkMaterialOutput<_T>>>());
                        return ret.read();
                    };
                    let mut intermediateOutput: Arc<IntermediateUnwrapOutput<_T>> = valueOrError3.Extract();
                    ret = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<UnwrapEdkMaterialOutput<_T>>, Arc<Error>>::Success {
                                    value: Arc::new(UnwrapEdkMaterialOutput::<_T>::UnwrapEdkMaterialOutput {
                                                plaintextDataKey: intermediateOutput.plaintextDataKey().clone(),
                                                symmetricSigningKey: Arc::new(Option::<Sequence<u8>>::Some {
                                                            value: intermediateOutput.symmetricSigningKey().clone()
                                                        }),
                                                unwrapInfo: intermediateOutput.unwrapInfo().clone()
                                            })
                                }));
                    return ret.read();
                }
            };
            return ret.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(371,3)
        pub fn GetProviderWrappedMaterial(material: &Sequence<u8>, algSuite: &Arc<AlgorithmSuiteInfo>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            if matches!(algSuite.edkWrapping().as_ref(), DIRECT_KEY_WRAPPING{ .. }) {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Success {
                        value: material.clone()
                    })
            } else {
                let mut deserializedWrappedRes: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DeserializedIntermediateWrappedMaterial>, Arc<Error>>> = crate::implementation_from_dafny::_IntermediateKeyWrapping_Compile::_default::DeserializeIntermediateWrappedMaterial(material, algSuite);
                if matches!((&deserializedWrappedRes).as_ref(), Failure{ .. }) {
                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Failure {
                            error: Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                        message: string_utf16_of("Unable to deserialize Intermediate Key Wrapped material.")
                                    })
                        })
                } else {
                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: deserializedWrappedRes.value().providerWrappedIkm().clone()
                        })
                }
            }
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(28,3)
    #[derive(PartialEq, Clone)]
    pub enum WrapEdkMaterialOutput<T: DafnyType> {
        WrapOnlyEdkMaterialOutput {
            wrappedMaterial: Sequence<u8>,
            symmetricSigningKey: Arc<Option<Sequence<u8>>>,
            wrapInfo: T
        },
        GenerateAndWrapEdkMaterialOutput {
            plaintextDataKey: Sequence<u8>,
            wrappedMaterial: Sequence<u8>,
            symmetricSigningKey: Arc<Option<Sequence<u8>>>,
            wrapInfo: T
        }
    }

    impl<T: DafnyType> WrapEdkMaterialOutput<T> {
        /// Gets the field wrappedMaterial for all enum members which have it
        pub fn wrappedMaterial(&self) -> &Sequence<u8> {
            match self {
                WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => wrappedMaterial,
                WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => wrappedMaterial,
            }
        }
        /// Gets the field symmetricSigningKey for all enum members which have it
        pub fn symmetricSigningKey(&self) -> &Arc<Option<Sequence<u8>>> {
            match self {
                WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => symmetricSigningKey,
                WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => symmetricSigningKey,
            }
        }
        /// Gets the field wrapInfo for all enum members which have it
        pub fn wrapInfo(&self) -> &T {
            match self {
                WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => wrapInfo,
                WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => wrapInfo,
            }
        }
        /// Gets the field plaintextDataKey for all enum members which have it
        pub fn plaintextDataKey(&self) -> &Sequence<u8> {
            match self {
                WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => panic!("field does not exist on this variant"),
                WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => plaintextDataKey,
            }
        }
    }

    impl<T: DafnyType> Debug
        for WrapEdkMaterialOutput<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for WrapEdkMaterialOutput<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => {
                    write!(_formatter, "EdkWrapping_Compile.WrapEdkMaterialOutput.WrapOnlyEdkMaterialOutput(")?;
                    DafnyPrint::fmt_print(wrappedMaterial, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(symmetricSigningKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(wrapInfo, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
                WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => {
                    write!(_formatter, "EdkWrapping_Compile.WrapEdkMaterialOutput.GenerateAndWrapEdkMaterialOutput(")?;
                    DafnyPrint::fmt_print(plaintextDataKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(wrappedMaterial, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(symmetricSigningKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(wrapInfo, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType + Eq> Eq
        for WrapEdkMaterialOutput<T> {}

    impl<T: DafnyType + Hash> Hash
        for WrapEdkMaterialOutput<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => {
                    Hash::hash(wrappedMaterial, _state);
                    Hash::hash(symmetricSigningKey, _state);
                    Hash::hash(wrapInfo, _state)
                },
                WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => {
                    Hash::hash(plaintextDataKey, _state);
                    Hash::hash(wrappedMaterial, _state);
                    Hash::hash(symmetricSigningKey, _state);
                    Hash::hash(wrapInfo, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for WrapEdkMaterialOutput<T> {
        fn default() -> WrapEdkMaterialOutput<T> {
            WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput {
                wrappedMaterial: Default::default(),
                symmetricSigningKey: Default::default(),
                wrapInfo: Default::default()
            }
        }
    }

    impl<T: DafnyType> AsRef<WrapEdkMaterialOutput<T>>
        for WrapEdkMaterialOutput<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/EdkWrapping.dfy(52,3)
    #[derive(PartialEq, Clone)]
    pub enum UnwrapEdkMaterialOutput<T: DafnyType> {
        UnwrapEdkMaterialOutput {
            plaintextDataKey: Sequence<u8>,
            symmetricSigningKey: Arc<Option<Sequence<u8>>>,
            unwrapInfo: T
        }
    }

    impl<T: DafnyType> UnwrapEdkMaterialOutput<T> {
        /// Returns a borrow of the field plaintextDataKey
        pub fn plaintextDataKey(&self) -> &Sequence<u8> {
            match self {
                UnwrapEdkMaterialOutput::UnwrapEdkMaterialOutput{plaintextDataKey, symmetricSigningKey, unwrapInfo, } => plaintextDataKey,
            }
        }
        /// Returns a borrow of the field symmetricSigningKey
        pub fn symmetricSigningKey(&self) -> &Arc<Option<Sequence<u8>>> {
            match self {
                UnwrapEdkMaterialOutput::UnwrapEdkMaterialOutput{plaintextDataKey, symmetricSigningKey, unwrapInfo, } => symmetricSigningKey,
            }
        }
        /// Returns a borrow of the field unwrapInfo
        pub fn unwrapInfo(&self) -> &T {
            match self {
                UnwrapEdkMaterialOutput::UnwrapEdkMaterialOutput{plaintextDataKey, symmetricSigningKey, unwrapInfo, } => unwrapInfo,
            }
        }
    }

    impl<T: DafnyType> Debug
        for UnwrapEdkMaterialOutput<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for UnwrapEdkMaterialOutput<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                UnwrapEdkMaterialOutput::UnwrapEdkMaterialOutput{plaintextDataKey, symmetricSigningKey, unwrapInfo, } => {
                    write!(_formatter, "EdkWrapping_Compile.UnwrapEdkMaterialOutput.UnwrapEdkMaterialOutput(")?;
                    DafnyPrint::fmt_print(plaintextDataKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(symmetricSigningKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(unwrapInfo, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType + Eq> Eq
        for UnwrapEdkMaterialOutput<T> {}

    impl<T: DafnyType + Hash> Hash
        for UnwrapEdkMaterialOutput<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                UnwrapEdkMaterialOutput::UnwrapEdkMaterialOutput{plaintextDataKey, symmetricSigningKey, unwrapInfo, } => {
                    Hash::hash(plaintextDataKey, _state);
                    Hash::hash(symmetricSigningKey, _state);
                    Hash::hash(unwrapInfo, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for UnwrapEdkMaterialOutput<T> {
        fn default() -> UnwrapEdkMaterialOutput<T> {
            UnwrapEdkMaterialOutput::UnwrapEdkMaterialOutput {
                plaintextDataKey: Default::default(),
                symmetricSigningKey: Default::default(),
                unwrapInfo: Default::default()
            }
        }
    }

    impl<T: DafnyType> AsRef<UnwrapEdkMaterialOutput<T>>
        for UnwrapEdkMaterialOutput<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(11,1)
pub mod _EncryptDecryptHelpers_Compile {
    pub use crate::implementation_from_dafny::_MessageBody_Compile::FramedMessage;
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSAVerifyInput;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems::MoreNeeded;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IAwsCryptographicMaterialProvidersClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultCryptographicMaterialsManagerInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ESDKAlgorithmSuite;
    pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey;
    pub use crate::implementation_from_dafny::_KeyDerivation_Compile::ExpandedKeyMaterial;
    pub use crate::implementation_from_dafny::_Header_Compile::HeaderInfo;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::SetBuilder;
    pub use ::dafny_runtime::MapBuilder;
    pub use crate::implementation_from_dafny::_EncryptionContext_Compile::ESDKCanonicalEncryptionContext;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderAuth;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageType;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CommitmentPolicy;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnEncryptInput;
    pub use ::dafny_runtime::itertools::Itertools;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ValidateCommitmentPolicyOnDecryptInput;
    pub use crate::implementation_from_dafny::_Frames_Compile::FramedHeader;
    pub use crate::implementation_from_dafny::_Frames_Compile::RegularFrame;
    pub use crate::implementation_from_dafny::_Frames_Compile::NonFramedHeader;
    pub use crate::implementation_from_dafny::_Frames_Compile::NonFramed;
    pub use crate::implementation_from_dafny::_Frames_Compile::Frame;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(47,3)
        pub fn SerializeMessageWithSignature(framedMessage: &FramedMessage, signature: &Sequence<u8>, suite: &Arc<AlgorithmSuiteInfo>) -> Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut serializedSignature: Sequence<u8> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(signature);
            let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::SerializeMessageWithoutSignature(framedMessage, suite);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Sequence<u8>>()
            } else {
                let mut serializedMessage: Sequence<u8> = valueOrError0.Extract();
                Arc::new(Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                        value: serializedMessage.concat(&serializedSignature)
                    })
            }
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(66,3)
        pub fn SerializeMessageWithoutSignature(framedMessage: &FramedMessage, suite: &Arc<AlgorithmSuiteInfo>) -> Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_HeaderAuth_Compile::_default::WriteHeaderAuthTag(framedMessage.finalFrame().header().headerAuth(), suite);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Sequence<u8>>()
            } else {
                let mut headerAuth: Sequence<u8> = valueOrError0.Extract();
                Arc::new(Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                        value: framedMessage.finalFrame().header().rawHeader().concat(&headerAuth).concat(&crate::implementation_from_dafny::_MessageBody_Compile::_default::WriteFramedMessageBody(framedMessage))
                    })
            }
        }
        /// DecryptionMaterialsWithPlaintextDataKey ensures that the materials and the suite match.
        /// requires Client.Materials.DecryptionMaterialsWithPlaintextDataKey(decMat)
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(90,3)
        pub fn VerifySignature(buffer: &Arc<ReadableBuffer>, msg: &Sequence<u8>, decMat: &Arc<DecryptionMaterials>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<Arc<ReadableBuffer>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<ReadableBuffer>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            if matches!(decMat.verificationKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) {
                res = MaybePlacebo::from(Arc::new(Result::<Arc<ReadableBuffer>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                                value: buffer.clone()
                            }));
                return res.read();
            };
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<seq16<u8>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadShortLengthSeq(buffer).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&_default::MapSerializeFailure(&string_utf16_of(": ReadShortLengthSeq")));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<ReadableBuffer>>());
                return res.read();
            };
            let mut signature: Arc<SuccessfulRead<seq16<u8>>> = valueOrError0.Extract();
            let mut ecdsaParams: Arc<ECDSASignatureAlgorithm> = decMat.algorithmSuite().signature().ECDSA().curve().clone();
            let mut maybeSignatureVerifiedResult: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::ECDSAVerify(rd!(crypto.clone()), &Arc::new(ECDSAVerifyInput::ECDSAVerifyInput {
                            signatureAlgorithm: ecdsaParams.clone(),
                            verificationKey: decMat.verificationKey().value().clone(),
                            message: msg.clone(),
                            signature: signature.data().clone()
                        }));
            maybeSignatureVerifiedResult = _out0.clone();
            let mut valueOrError1: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeSignatureVerifiedResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<ReadableBuffer>>());
                return res.read();
            };
            let mut signatureVerifiedResult: bool = valueOrError1.Extract();
            if !signatureVerifiedResult {
                res = MaybePlacebo::from(Arc::new(Result::<Arc<ReadableBuffer>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                            message: string_utf16_of("Invalid signature")
                                        })
                            }));
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<Arc<ReadableBuffer>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: signature.tail().clone()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(218,3)
        pub fn MapSerializeFailure(s: &Sequence<DafnyCharUTF16>) -> Arc<dyn ::std::ops::Fn(&Arc<ReadProblems>) -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error> + Sync + Send> {
            {
                let s: Sequence<DafnyCharUTF16> = s.clone();
                {
                    let mut s = s.clone();
                    Arc::new(move |e: &Arc<ReadProblems>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                            (&({
                                let mut s = s.clone();
                                Arc::new(move |_source0: &Arc<ReadProblems>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                        if matches!(_source0.as_ref(), MoreNeeded{ .. }) {
                                            let mut ___mcc_h0: u64 = _source0.pos().clone();
                                            Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                                    message: string_utf16_of("Incomplete message").concat(&s)
                                                })
                                        } else {
                                            let mut ___mcc_h1: Sequence<DafnyCharUTF16> = _source0.message().clone();
                                            let mut e: Sequence<DafnyCharUTF16> = ___mcc_h1.clone();
                                            Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                                    message: e.clone()
                                                })
                                        }
                                    })
                            }))(e)
                        })
                }
            }
        }
        /// = compliance/client-apis/encrypt.txt#2.4.2
        /// = type=implication
        /// # The prefix "aws-crypto-" is reserved for internal use by the AWS
        /// # Encryption SDK; see the the Default CMM spec (default-cmm.md) for one
        /// # such use.
        /// # If the input encryption context contains any entries with
        /// # a key beginning with this prefix, the encryption operation MUST fail.
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(225,3)
        pub fn ValidateEncryptionContext(input: &Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>>) -> Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            if matches!(input.as_ref(), Some{ .. }) && (&input.value().keys()).iter().any(({
                        let mut input = input.clone();
                        Arc::new(move |__exists_var_0: &ValidUTF8Bytes| -> bool{
                                let mut key: ValidUTF8Bytes = __exists_var_0.clone();
                                if {
                                        let i: Sequence<u8> = key.clone();
                                        crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                    } {
                                    input.value().keys().contains(&key) && _default::RESERVED_ENCRYPTION_CONTEXT() <= key.clone()
                                } else {
                                    false
                                }
                            })
                    }).as_ref()) {
                Arc::new(Outcome::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Fail {
                        error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                    message: string_utf16_of("Encryption context keys cannot contain reserved prefix 'aws-crypto-'")
                                })
                    })
            } else {
                Arc::new(Outcome::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Pass {})
            }
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(255,3)
        pub fn CreateCmmFromInput(inputCmm: &Arc<Option<Object<dyn ICryptographicMaterialsManager>>>, inputKeyring: &Arc<Option<Object<dyn IKeyring>>>) -> Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(matches!(inputCmm.as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) || matches!(inputKeyring.as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Cannot provide both a keyring and a CMM")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<dyn ICryptographicMaterialsManager>>());
                return res.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(matches!(inputCmm.as_ref(), Some{ .. }) || matches!(inputKeyring.as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Must provide either a keyring or a CMM")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<dyn ICryptographicMaterialsManager>>());
                return res.read();
            };
            let mut cmm: Object<dyn ICryptographicMaterialsManager>;
            if matches!(inputCmm.as_ref(), Some{ .. }) {
                res = MaybePlacebo::from(Arc::new(Result::<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                                value: inputCmm.value().clone()
                            }));
                return res.read();
            } else {
                let mut maybeMaterialsProviders: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out0: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
                maybeMaterialsProviders = _out0.clone();
                let mut valueOrError2: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeMaterialsProviders.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                            AwsCryptographyMaterialProviders: e.clone()
                                        })
                                })
                        }));
                if valueOrError2.IsFailure() {
                    res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<dyn ICryptographicMaterialsManager>>());
                    return res.read();
                };
                let mut materialProviders: Object<MaterialProvidersClient> = valueOrError2.Extract();
                let mut maybeCmm: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out1: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(materialProviders.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                                keyring: inputKeyring.value().clone()
                            }));
                maybeCmm = _out1.clone();
                res = MaybePlacebo::from(maybeCmm.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                                Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                        Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                                AwsCryptographyMaterialProviders: e.clone()
                                            })
                                    })
                            })));
                return res.read();
            };
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(349,3)
        pub fn ValidateMaxEncryptedDataKeys(maxEncryptedDataKeys: &Arc<Option<CountingNumbers>>, edks: &Sequence<Arc<EncryptedDataKey>>) -> Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            if matches!(maxEncryptedDataKeys.as_ref(), Some{ .. }) && (maxEncryptedDataKeys.value().clone() as u64) < truncate!(edks.cardinality(), u64) {
                Arc::new(Outcome::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Fail {
                        error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                    message: string_utf16_of("Encrypted data keys exceed maxEncryptedDataKeys")
                                })
                    })
            } else {
                Arc::new(Outcome::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Pass {})
            }
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(376,3)
        pub fn GenerateMessageId(suite: &Arc<AlgorithmSuiteInfo>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<MessageId, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<MessageId, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut maybeId: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            if suite.messageVersion().clone() == 1 {
                let mut _out0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(crypto.clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                                length: crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V1() as i32
                            }));
                maybeId = _out0.clone();
            } else {
                let mut _out1: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(crypto.clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                                length: crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V2() as i32
                            }));
                maybeId = _out1.clone();
            };
            let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeId.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<MessageId>());
                return res.read();
            };
            let mut id: Sequence<u8> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: id.clone()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(413,3)
        pub fn BuildHeaderForEncrypt(messageId: &MessageId, suite: &ESDKAlgorithmSuite, encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>, requiredEncryptionContextKeys: &Sequence<ValidUTF8Bytes>, encryptedDataKeys: &seq16<ESDKEncryptedDataKey>, frameLength: u32, derivedDataKeys: &Arc<ExpandedKeyMaterial>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<Arc<HeaderInfo>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<HeaderInfo>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut reqKeySet: Set<ValidUTF8Bytes> = (&({
                    let mut requiredEncryptionContextKeys = requiredEncryptionContextKeys.clone();
                    Arc::new(move || -> Set<ValidUTF8Bytes>{
                            let mut _coll0: SetBuilder<ValidUTF8Bytes> = SetBuilder::<ValidUTF8Bytes>::new();
                            for __compr_0 in (&requiredEncryptionContextKeys).iter() {
                                let mut k: ValidUTF8Bytes = __compr_0.clone();
                                if {
                                        let i: Sequence<u8> = k.clone();
                                        crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                    } {
                                    if requiredEncryptionContextKeys.contains(&k) {
                                        _coll0.add(&k)
                                    }
                                }
                            }
                            _coll0.build()
                        })
                }))();
            let mut storedEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = (&({
                    let mut encryptionContext = encryptionContext.clone();
                    let mut reqKeySet = reqKeySet.clone();
                    Arc::new(move || -> Map<ValidUTF8Bytes, ValidUTF8Bytes>{
                            let mut _coll1: MapBuilder<ValidUTF8Bytes, ValidUTF8Bytes> = MapBuilder::<ValidUTF8Bytes, ValidUTF8Bytes>::new();
                            for __compr_1 in (&encryptionContext.subtract(&reqKeySet)).keys().iter().cloned() {
                                let mut f: ValidUTF8Bytes = __compr_1.clone();
                                if {
                                        let i: Sequence<u8> = f.clone();
                                        crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                    } {
                                    if encryptionContext.subtract(&reqKeySet).contains(&f) {
                                        _coll1.add(&f, &encryptionContext.get(&f))
                                    }
                                }
                            }
                            _coll1.build()
                        })
                }))();
            let mut canonicalStoredEncryptionContext: ESDKCanonicalEncryptionContext = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::GetCanonicalEncryptionContext(&storedEncryptionContext);
            let mut body: Arc<HeaderBody>;
            let mut _out0: Arc<HeaderBody> = _default::BuildHeaderBody(messageId, suite, &canonicalStoredEncryptionContext, encryptedDataKeys, frameLength, derivedDataKeys.commitmentKey());
            body = _out0.clone();
            let mut requiredEncryptionContextMap: Map<ValidUTF8Bytes, ValidUTF8Bytes> = (&({
                    let mut encryptionContext = encryptionContext.clone();
                    let mut reqKeySet = reqKeySet.clone();
                    Arc::new(move || -> Map<ValidUTF8Bytes, ValidUTF8Bytes>{
                            let mut _coll2: MapBuilder<ValidUTF8Bytes, ValidUTF8Bytes> = MapBuilder::<ValidUTF8Bytes, ValidUTF8Bytes>::new();
                            for __compr_2 in (&reqKeySet).iter().cloned() {
                                let mut r: ValidUTF8Bytes = __compr_2.clone();
                                if {
                                        let i: Sequence<u8> = r.clone();
                                        crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                    } {
                                    if reqKeySet.contains(&r) {
                                        _coll2.add(&r, &encryptionContext.get(&r))
                                    }
                                }
                            }
                            _coll2.build()
                        })
                }))();
            let mut canonicalReqEncryptionContext: ESDKCanonicalEncryptionContext = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::GetCanonicalEncryptionContext(&requiredEncryptionContextMap);
            let mut serializedReqEncryptionContext: Sequence<u8> = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::WriteEmptyEcOrWriteAAD(&canonicalReqEncryptionContext);
            let mut rawHeader: Sequence<u8> = crate::implementation_from_dafny::_Header_Compile::_default::WriteHeaderBody(&body);
            let mut valueOrError0: Arc<Result<Arc<HeaderAuth>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Arc<HeaderAuth>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::BuildHeaderAuthTag(suite, derivedDataKeys.dataKey(), &rawHeader, &serializedReqEncryptionContext, crypto);
            valueOrError0 = _out1.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<HeaderInfo>>());
                return res.read();
            };
            let mut headerAuth: Arc<HeaderAuth> = valueOrError0.Extract();
            let mut header: Arc<HeaderInfo> = Arc::new(HeaderInfo::HeaderInfo {
                        body: body.clone(),
                        rawHeader: rawHeader.clone(),
                        encryptionContext: encryptionContext.clone(),
                        suite: suite.clone(),
                        headerAuth: headerAuth.clone()
                    });
            res = MaybePlacebo::from(Arc::new(Result::<Arc<HeaderInfo>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: header.clone()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(505,3)
        pub fn BuildHeaderBody(messageId: &MessageId, suite: &ESDKAlgorithmSuite, encryptionContext: &ESDKCanonicalEncryptionContext, encryptedDataKeys: &seq16<ESDKEncryptedDataKey>, frameLength: u32, suiteData: &Arc<Option<Sequence<u8>>>) -> Arc<HeaderBody> {
            let mut res: Arc<HeaderBody>;
            let mut contentType: Arc<ContentType> = Arc::new(ContentType::Framed {});
            let mut _source0: Arc<DerivationAlgorithm> = suite.commitment().clone();
            if matches!((&_source0).as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) {
                let mut ___mcc_h0: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::HKDF> = _source0.HKDF().clone();
                res = Arc::new(HeaderBody::V2HeaderBody {
                            algorithmSuite: suite.clone(),
                            messageId: messageId.clone(),
                            encryptionContext: encryptionContext.clone(),
                            encryptedDataKeys: encryptedDataKeys.clone(),
                            contentType: contentType.clone(),
                            frameLength: frameLength,
                            suiteData: suiteData.value().clone()
                        });
                return res.clone();
            } else {
                let mut ___mcc_h2: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None> = _source0._None().clone();
                res = Arc::new(HeaderBody::V1HeaderBody {
                            messageType: Arc::new(MessageType::TYPE_CUSTOMER_AED {}),
                            algorithmSuite: suite.clone(),
                            messageId: messageId.clone(),
                            encryptionContext: encryptionContext.clone(),
                            encryptedDataKeys: encryptedDataKeys.clone(),
                            contentType: contentType.clone(),
                            headerIvLength: crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite) as u64,
                            frameLength: frameLength
                        });
                return res.clone();
            };
            return res.clone();
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(590,3)
        pub fn BuildHeaderAuthTag(suite: &Arc<AlgorithmSuiteInfo>, dataKey: &Sequence<u8>, rawHeader: &Sequence<u8>, serializedReqEncryptionContext: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<Arc<HeaderAuth>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<HeaderAuth>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut keyLength: i32 = crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(suite);
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(truncate!(dataKey.cardinality(), u64) == keyLength as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Incorrect data key length")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<HeaderAuth>>());
                return res.read();
            };
            let mut iv: Sequence<u8> = crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLengthZeros(suite);
            let mut maybeEncryptionOutput: Arc<Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESEncrypt(rd!(crypto.clone()), &Arc::new(AESEncryptInput::AESEncryptInput {
                            encAlg: suite.encrypt().AES_GCM().clone(),
                            iv: iv.clone(),
                            key: dataKey.clone(),
                            msg: seq![] as Sequence<u8>,
                            aad: rawHeader.concat(serializedReqEncryptionContext)
                        }));
            maybeEncryptionOutput = _out0.clone();
            let mut valueOrError1: Arc<Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeEncryptionOutput.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<HeaderAuth>>());
                return res.read();
            };
            let mut encryptionOutput: Arc<AESEncryptOutput> = valueOrError1.Extract();
            let mut headerAuth: Arc<HeaderAuth> = Arc::new(HeaderAuth::AESMac {
                        headerIv: iv.clone(),
                        headerAuthTag: encryptionOutput.authTag().clone()
                    });
            res = MaybePlacebo::from(Arc::new(Result::<Arc<HeaderAuth>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: headerAuth.clone()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(642,3)
        pub fn GetEncryptionMaterials(cmm: &Object<dyn ICryptographicMaterialsManager>, algorithmSuiteId: &Arc<Option<Arc<AlgorithmSuiteId>>>, encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>, maxPlaintextLength: i64, commitmentPolicy: &Arc<ESDKCommitmentPolicy>, mpl: &Object<MaterialProvidersClient>) -> Arc<Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut encMatRequest: Arc<GetEncryptionMaterialsInput> = Arc::new(GetEncryptionMaterialsInput::GetEncryptionMaterialsInput {
                        encryptionContext: encryptionContext.clone(),
                        commitmentPolicy: Arc::new(CommitmentPolicy::ESDK {
                                    ESDK: commitmentPolicy.clone()
                                }),
                        algorithmSuiteId: algorithmSuiteId.clone(),
                        maxPlaintextLength: Arc::new(Option::<i64>::Some {
                                    value: maxPlaintextLength
                                }),
                        requiredEncryptionContextKeys: Arc::new(Option::<Sequence<ValidUTF8Bytes>>::None {})
                    });
            let mut getEncMatResult: Arc<Result<Arc<GetEncryptionMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<GetEncryptionMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = ICryptographicMaterialsManager::GetEncryptionMaterials(rd!(cmm.clone()), &encMatRequest);
            getEncMatResult = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<GetEncryptionMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = getEncMatResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                        AwsCryptographyMaterialProviders: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<EncryptionMaterials>>());
                return res.read();
            };
            let mut output: Arc<GetEncryptionMaterialsOutput> = valueOrError0.Extract();
            let mut materials: Arc<EncryptionMaterials> = output.encryptionMaterials().clone();
            let mut valueOrError1: Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::ValidateCommitmentPolicyOnEncrypt(rd!(mpl.clone()), &Arc::new(ValidateCommitmentPolicyOnEncryptInput::ValidateCommitmentPolicyOnEncryptInput {
                            algorithm: materials.algorithmSuite().id().clone(),
                            commitmentPolicy: Arc::new(CommitmentPolicy::ESDK {
                                        ESDK: commitmentPolicy.clone()
                                    })
                        })).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                        AwsCryptographyMaterialProviders: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<EncryptionMaterials>>());
                return res.read();
            };
            let mut _v3: () = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::EncryptionMaterialsHasPlaintextDataKey(rd!(mpl.clone()), &materials).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                        AwsCryptographyMaterialProviders: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<EncryptionMaterials>>());
                return res.read();
            };
            let mut _v4: () = valueOrError2.Extract();
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::IsESDKEncryptionContext(materials.encryptionContext()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("CMM failed to return serializable encryption materials.")
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<EncryptionMaterials>>());
                return res.read();
            };
            let mut valueOrError4: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint16Len::<Arc<EncryptedDataKey>>(materials.encryptedDataKeys()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("CMM returned EDKs that exceed the allowed maximum.")
                        }));
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<EncryptionMaterials>>());
                return res.read();
            };
            let mut valueOrError5: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(Itertools::unique(materials.encryptedDataKeys().iter()).all(({
                            let mut materials = materials.clone();
                            Arc::new(move |__forall_var_0: Arc<EncryptedDataKey>| -> bool{
                                    let mut edk: Arc<EncryptedDataKey> = __forall_var_0.clone();
                                    !materials.encryptedDataKeys().contains(&edk) || crate::implementation_from_dafny::_SerializableTypes_Compile::_default::IsESDKEncryptedDataKey(&edk)
                                })
                        }).as_ref()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("CMM returned non-serializable encrypted data key.")
                        }));
            if valueOrError5.IsFailure() {
                res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<EncryptionMaterials>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: materials.clone()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(719,3)
        pub fn GetDecryptionMaterials(cmm: &Object<dyn ICryptographicMaterialsManager>, algorithmSuiteId: &Arc<AlgorithmSuiteId>, headerBody: &Arc<HeaderBody>, reproducedEncryptionContext: &Arc<Option<Map<ValidUTF8Bytes, ValidUTF8Bytes>>>, commitmentPolicy: &Arc<ESDKCommitmentPolicy>, mpl: &Object<MaterialProvidersClient>) -> Arc<Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::GetEncryptionContext(headerBody.encryptionContext());
            let mut decMatRequest: Arc<DecryptMaterialsInput> = Arc::new(DecryptMaterialsInput::DecryptMaterialsInput {
                        algorithmSuiteId: algorithmSuiteId.clone(),
                        commitmentPolicy: Arc::new(CommitmentPolicy::ESDK {
                                    ESDK: commitmentPolicy.clone()
                                }),
                        encryptedDataKeys: headerBody.encryptedDataKeys().clone(),
                        encryptionContext: encryptionContext.clone(),
                        reproducedEncryptionContext: reproducedEncryptionContext.clone()
                    });
            let mut decMatResult: Arc<Result<Arc<DecryptMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<DecryptMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = ICryptographicMaterialsManager::DecryptMaterials(rd!(cmm.clone()), &decMatRequest);
            decMatResult = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<DecryptMaterialsOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = decMatResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                        AwsCryptographyMaterialProviders: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<DecryptionMaterials>>());
                return res.read();
            };
            let mut output: Arc<DecryptMaterialsOutput> = valueOrError0.Extract();
            let mut materials: Arc<DecryptionMaterials> = output.decryptionMaterials().clone();
            let mut valueOrError1: Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::ValidateCommitmentPolicyOnDecrypt(rd!(mpl.clone()), &Arc::new(ValidateCommitmentPolicyOnDecryptInput::ValidateCommitmentPolicyOnDecryptInput {
                            algorithm: materials.algorithmSuite().id().clone(),
                            commitmentPolicy: Arc::new(CommitmentPolicy::ESDK {
                                        ESDK: commitmentPolicy.clone()
                                    })
                        })).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                        AwsCryptographyMaterialProviders: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<DecryptionMaterials>>());
                return res.read();
            };
            let mut _v5: () = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::DecryptionMaterialsWithPlaintextDataKey(rd!(mpl.clone()), &materials).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyMaterialProviders {
                                        AwsCryptographyMaterialProviders: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<DecryptionMaterials>>());
                return res.read();
            };
            let mut _v6: () = valueOrError2.Extract();
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::IsESDKEncryptionContext(materials.encryptionContext()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("CMM failed to return serializable encryption materials.")
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<DecryptionMaterials>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: materials.clone()
                        }));
            return res.read();
        }
        /// Validating suite data is only relevant for suites with commitment
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(796,3)
        pub fn ValidateSuiteData(suite: &Arc<AlgorithmSuiteInfo>, header: &Arc<HeaderBody>, expectedSuiteData: &Sequence<u8>) -> Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(truncate!(header.suiteData().cardinality(), u64) == suite.commitment().HKDF().outputKeyLength().clone() as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Commitment key is invalid")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<()>());
                return res.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(expectedSuiteData.clone() == header.suiteData().clone(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                            message: string_utf16_of("Commitment key does not match")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<()>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<(), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: ()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(837,3)
        pub fn ReadAndDecryptFramedMessageBody(buffer: &Arc<ReadableBuffer>, header: &FramedHeader, key: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<(Sequence<u8>, Arc<ReadableBuffer>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<(Sequence<u8>, Arc<ReadableBuffer>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<FramedMessage>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_MessageBody_Compile::_default::ReadFramedMessageBody(buffer, header, &(seq![] as Sequence<RegularFrame>), buffer).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&_default::MapSerializeFailure(&string_utf16_of(": ReadFramedMessageBody")));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<(Sequence<u8>, Arc<ReadableBuffer>)>());
                return res.read();
            };
            let mut messageBody: Arc<SuccessfulRead<FramedMessage>> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_MessageBody_Compile::_default::DecryptFramedMessageBody(messageBody.data(), key, crypto);
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<(Sequence<u8>, Arc<ReadableBuffer>)>());
                return res.read();
            };
            let mut plaintext: Sequence<u8> = valueOrError1.Extract();
            let mut messageBodyTail: Arc<ReadableBuffer> = messageBody.tail().clone();
            res = MaybePlacebo::from(Arc::new(Result::<(Sequence<u8>, Arc<ReadableBuffer>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: (
                                    plaintext.clone(),
                                    messageBodyTail.clone()
                                )
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(873,3)
        pub fn ReadAndDecryptNonFramedMessageBody(buffer: &Arc<ReadableBuffer>, header: &NonFramedHeader, key: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<(Sequence<u8>, Arc<ReadableBuffer>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<(Sequence<u8>, Arc<ReadableBuffer>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<NonFramed>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_MessageBody_Compile::_default::ReadNonFramedMessageBody(buffer, header).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&_default::MapSerializeFailure(&string_utf16_of(": ReadNonFramedMessageBody")));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<(Sequence<u8>, Arc<ReadableBuffer>)>());
                return res.read();
            };
            let mut messageBody: Arc<SuccessfulRead<NonFramed>> = valueOrError0.Extract();
            let mut frame: Arc<Frame> = messageBody.data().clone();
            let mut valueOrError1: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_MessageBody_Compile::_default::DecryptFrame(&frame, key, crypto);
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<(Sequence<u8>, Arc<ReadableBuffer>)>());
                return res.read();
            };
            let mut plaintext: Sequence<u8> = valueOrError1.Extract();
            let mut messageBodyTail: Arc<ReadableBuffer> = messageBody.tail().clone();
            res = MaybePlacebo::from(Arc::new(Result::<(Sequence<u8>, Arc<ReadableBuffer>), Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: (
                                    plaintext.clone(),
                                    messageBodyTail.clone()
                                )
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(37,3)
        pub fn DEFAULT_FRAME_LENGTH() -> FrameLength {
            4096
        }
        /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(40,3)
        pub fn RESERVED_ENCRYPTION_CONTEXT() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![97, 119, 115, 45, 99, 114, 121, 112, 116, 111, 45];
            s.clone()
        }
    }

    /// dafny/AwsEncryptionSdk/src/EncryptDecrypt.dfy(31,3)
    pub type FrameLength = i64;
}
/// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(8,1)
pub mod _EncryptedDataKeys_Compile {
    pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::truncate;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(18,3)
        pub fn WriteEncryptedDataKey(edk: &ESDKEncryptedDataKey) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(edk.keyProviderId()).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(edk.keyProviderInfo())).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(edk.ciphertext()))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(27,3)
        pub fn WriteEncryptedDataKeys(edks: &seq16<ESDKEncryptedDataKey>) -> Sequence<u8> {
            let mut _accumulator: Sequence<u8> = seq![] as Sequence<u8>;
            let mut _r0 = edks.clone();
            'TAIL_CALL_START: loop {
                let edks = _r0;
                if truncate!(edks.cardinality(), u64) == 0 {
                    return (seq![] as Sequence<u8>).concat(&_accumulator);
                } else {
                    _accumulator = _default::WriteEncryptedDataKey(&crate::implementation_from_dafny::_Seq_Compile::_default::Last::<ESDKEncryptedDataKey>(&edks)).concat(&_accumulator);
                    let mut _in0: Sequence<ESDKEncryptedDataKey> = crate::implementation_from_dafny::_Seq_Compile::_default::DropLast::<ESDKEncryptedDataKey>(&edks);
                    _r0 = _in0.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(44,3)
        pub fn WriteEncryptedDataKeysSection(edks: &seq16<ESDKEncryptedDataKey>) -> Sequence<u8> {
            crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt16ToSeq(truncate!(edks.cardinality(), u16)).concat(&_default::WriteEncryptedDataKeys(edks))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(52,3)
        pub fn ReadEncryptedDataKey(buffer: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<ESDKEncryptedDataKey>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<seq16<u8>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadShortLengthSeq(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<ESDKEncryptedDataKey>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<seq16<u8>>> = valueOrError0.Extract();
                let mut providerId: seq16<u8> = __let_tmp_rhs0.data().clone();
                let mut providerIdPos: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                let mut valueOrError1: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&providerId), &Arc::new(ReadProblems::Error {
                                message: string_utf16_of("Invalid providerID")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<ESDKEncryptedDataKey>>>()
                } else {
                    let mut valueOrError2: Arc<Result<Arc<SuccessfulRead<seq16<u8>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadShortLengthSeq(&providerIdPos);
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<SuccessfulRead<ESDKEncryptedDataKey>>>()
                    } else {
                        let mut __let_tmp_rhs1: Arc<SuccessfulRead<seq16<u8>>> = valueOrError2.Extract();
                        let mut providerInfo: seq16<u8> = __let_tmp_rhs1.data().clone();
                        let mut providerInfoPos: Arc<ReadableBuffer> = __let_tmp_rhs1.tail().clone();
                        let mut valueOrError3: Arc<Result<Arc<SuccessfulRead<seq16<u8>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadShortLengthSeq(&providerInfoPos);
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<SuccessfulRead<ESDKEncryptedDataKey>>>()
                        } else {
                            let mut __let_tmp_rhs2: Arc<SuccessfulRead<seq16<u8>>> = valueOrError3.Extract();
                            let mut cipherText: seq16<u8> = __let_tmp_rhs2.data().clone();
                            let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs2.tail().clone();
                            let mut edk: ESDKEncryptedDataKey = Arc::new(EncryptedDataKey::EncryptedDataKey {
                                        keyProviderId: providerId.clone(),
                                        keyProviderInfo: providerInfo.clone(),
                                        ciphertext: cipherText.clone()
                                    });
                            Arc::new(Result::<Arc<SuccessfulRead<ESDKEncryptedDataKey>>, Arc<ReadProblems>>::Success {
                                    value: Arc::new(SuccessfulRead::<ESDKEncryptedDataKey>::SuccessfulRead {
                                                data: edk.clone(),
                                                tail: tail.clone()
                                            })
                                })
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(74,3)
        pub fn ReadEncryptedDataKeys(buffer: &Arc<ReadableBuffer>, accumulator: &seq16<ESDKEncryptedDataKey>, count: u16, nextEdkStart: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>, Arc<ReadProblems>>> {
            let mut _r0 = buffer.clone();
            let mut _r1 = accumulator.clone();
            let mut _r2 = count;
            let mut _r3 = nextEdkStart.clone();
            'TAIL_CALL_START: loop {
                let buffer = _r0;
                let accumulator = _r1;
                let count = _r2;
                let nextEdkStart = _r3;
                if truncate!(accumulator.cardinality(), u64) < count as u64 {
                    let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<ESDKEncryptedDataKey>>, Arc<ReadProblems>>> = _default::ReadEncryptedDataKey(&nextEdkStart);
                    if valueOrError0.IsFailure() {
                        return valueOrError0.PropagateFailure::<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>>();
                    } else {
                        let mut __let_tmp_rhs0: Arc<SuccessfulRead<ESDKEncryptedDataKey>> = valueOrError0.Extract();
                        let mut edk: ESDKEncryptedDataKey = __let_tmp_rhs0.data().clone();
                        let mut newPos: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                        let mut nextAcc: Sequence<ESDKEncryptedDataKey> = accumulator.concat(&seq![edk.clone()]);
                        let mut _in0: Arc<ReadableBuffer> = buffer.clone();
                        let mut _in1: Sequence<ESDKEncryptedDataKey> = nextAcc.clone();
                        let mut _in2: u16 = count;
                        let mut _in3: Arc<ReadableBuffer> = newPos.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        _r2 = _in2;
                        _r3 = _in3.clone();
                        continue 'TAIL_CALL_START;
                    }
                } else {
                    return Arc::new(Result::<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>, Arc<ReadProblems>>::Success {
                                value: Arc::new(SuccessfulRead::<seq16<ESDKEncryptedDataKey>>::SuccessfulRead {
                                            data: accumulator.clone(),
                                            tail: nextEdkStart.clone()
                                        })
                            });
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptedDataKeys.dfy(98,3)
        pub fn ReadEncryptedDataKeysSection(buffer: &Arc<ReadableBuffer>, maxEdks: &Arc<Option<CountingNumbers>>) -> Arc<Result<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<u16>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt16(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<u16>> = valueOrError0.Extract();
                let mut count: u16 = __let_tmp_rhs0.data().clone();
                let mut edkStart: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                if matches!(maxEdks.as_ref(), Some{ .. }) && maxEdks.value().clone() < count as i64 {
                    Arc::new(Result::<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>, Arc<ReadProblems>>::Failure {
                            error: Arc::new(ReadProblems::Error {
                                        message: string_utf16_of("Ciphertext encrypted data keys exceed maxEncryptedDataKeys")
                                    })
                        })
                } else {
                    let mut valueOrError1: Arc<Result<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>, Arc<ReadProblems>>> = _default::ReadEncryptedDataKeys(&edkStart, &(seq![] as Sequence<ESDKEncryptedDataKey>), count, &edkStart);
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>>()
                    } else {
                        let mut __let_tmp_rhs1: Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>> = valueOrError1.Extract();
                        let mut edks: seq16<ESDKEncryptedDataKey> = __let_tmp_rhs1.data().clone();
                        let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs1.tail().clone();
                        Arc::new(Result::<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>, Arc<ReadProblems>>::Success {
                                value: Arc::new(SuccessfulRead::<seq16<ESDKEncryptedDataKey>>::SuccessfulRead {
                                            data: edks.clone(),
                                            tail: tail.clone()
                                        })
                            })
                    }
                }
            }
        }
    }
}
/// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(8,1)
pub mod _EncryptionContext_Compile {
    pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptionContext;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::MapBuilder;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::std::convert::Into;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_SerializableTypes_Compile::Pair;
    pub use ::dafny_runtime::Set;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded;
    pub use ::dafny_runtime::DafnyTypeEq;
    pub use ::dafny_runtime::SetBuilder;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(55,3)
        pub fn GetCanonicalEncryptionContext(encryptionContext: &ESDKEncryptionContext) -> ESDKCanonicalEncryptionContext {
            crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetCanonicalLinearPairs(encryptionContext)
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(65,3)
        pub fn GetEncryptionContext(canonicalEncryptionContext: &ESDKCanonicalEncryptionContext) -> Map<ValidUTF8Bytes, ValidUTF8Bytes> {
            (&({
                let mut canonicalEncryptionContext = canonicalEncryptionContext.clone();
                Arc::new(move || -> Map<ValidUTF8Bytes, ValidUTF8Bytes>{
                        let mut _coll0: MapBuilder<ValidUTF8Bytes, ValidUTF8Bytes> = MapBuilder::<ValidUTF8Bytes, ValidUTF8Bytes>::new();
                        for __compr_0 in integer_range(int!(0), canonicalEncryptionContext.cardinality()) {
                            let mut i: DafnyInt = __compr_0.clone();
                            if int!(0) <= i.clone() && i.clone() < canonicalEncryptionContext.cardinality() {
                                _coll0.add(canonicalEncryptionContext.get(&i).key(), canonicalEncryptionContext.get(&i).value())
                            }
                        }
                        _coll0.build()
                    })
            }))()
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(291,3)
        pub fn WriteAADSection(ec: &ESDKCanonicalEncryptionContext) -> Sequence<u8> {
            if truncate!(ec.cardinality(), u64) == 0 {
                crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint16(0)
            } else {
                let mut aad: Sequence<u8> = _default::WriteAAD(ec);
                crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint16(truncate!(aad.cardinality(), u16)).concat(&aad)
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(342,3)
        pub fn WriteEmptyEcOrWriteAAD(ec: &ESDKCanonicalEncryptionContext) -> Sequence<u8> {
            if truncate!(ec.cardinality(), u64) == 0 {
                seq![] as Sequence<u8>
            } else {
                _default::WriteAAD(ec)
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(376,3)
        pub fn WriteAAD(ec: &ESDKCanonicalEncryptionContext) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint16(truncate!(ec.cardinality(), u16)).concat(&_default::WriteAADPairs(ec))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(394,3)
        pub fn WriteAADPairs(ec: &ESDKCanonicalEncryptionContext) -> Sequence<u8> {
            let mut ret = MaybePlacebo::<Sequence<u8>>::new();
            let mut result: Sequence<u8> = seq![] as Sequence<u8>;
            let mut _hi0: u64 = truncate!(ec.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                result = result.concat(&_default::WriteAADPair(&ec.get(&int!((&i).clone()))));
            }
            ret = MaybePlacebo::from(result.clone());
            return ret.read();
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(457,3)
        pub fn WriteAADPair(pair: &ESDKEncryptionContextPair) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(pair.key()).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteShortLengthSeq(pair.value()))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(466,3)
        pub fn ReadAADPair(buffer: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<ESDKEncryptionContextPair>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<seq16<u8>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadShortLengthSeq(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<ESDKEncryptionContextPair>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<seq16<u8>>> = valueOrError0.Extract();
                let mut key: seq16<u8> = __let_tmp_rhs0.data().clone();
                let mut keyEnd: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                let mut valueOrError1: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&key), &Arc::new(ReadProblems::Error {
                                message: string_utf16_of("Invalid Encryption Context key")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<ESDKEncryptionContextPair>>>()
                } else {
                    let mut valueOrError2: Arc<Result<Arc<SuccessfulRead<seq16<u8>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadShortLengthSeq(&keyEnd);
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<SuccessfulRead<ESDKEncryptionContextPair>>>()
                    } else {
                        let mut __let_tmp_rhs1: Arc<SuccessfulRead<seq16<u8>>> = valueOrError2.Extract();
                        let mut value: seq16<u8> = __let_tmp_rhs1.data().clone();
                        let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs1.tail().clone();
                        let mut valueOrError3: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&value), &Arc::new(ReadProblems::Error {
                                        message: string_utf16_of("Invalid Encryption Context value")
                                    }));
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<SuccessfulRead<ESDKEncryptionContextPair>>>()
                        } else {
                            let mut pair: ESDKEncryptionContextPair = Arc::new(Pair::<Sequence<u8>, Sequence<u8>>::Pair {
                                        key: key.clone(),
                                        value: value.clone()
                                    });
                            Arc::new(Result::<Arc<SuccessfulRead<ESDKEncryptionContextPair>>, Arc<ReadProblems>>::Success {
                                    value: Arc::new(SuccessfulRead::<ESDKEncryptionContextPair>::SuccessfulRead {
                                                data: pair.clone(),
                                                tail: tail.clone()
                                            })
                                })
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(489,3)
        pub fn ReadAADPairs(buffer: &Arc<ReadableBuffer>, accumulator: &ESDKCanonicalEncryptionContext, keys: &Set<ValidUTF8Bytes>, count: u16, nextPair: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>> {
            let mut _r0 = buffer.clone();
            let mut _r1 = accumulator.clone();
            let mut _r2 = keys.clone();
            let mut _r3 = count;
            let mut _r4 = nextPair.clone();
            'TAIL_CALL_START: loop {
                let buffer = _r0;
                let accumulator = _r1;
                let keys = _r2;
                let count = _r3;
                let nextPair = _r4;
                if truncate!(accumulator.cardinality(), u16) < count {
                    let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<ESDKEncryptionContextPair>>, Arc<ReadProblems>>> = _default::ReadAADPair(&nextPair);
                    if valueOrError0.IsFailure() {
                        return valueOrError0.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>();
                    } else {
                        let mut __let_tmp_rhs0: Arc<SuccessfulRead<ESDKEncryptionContextPair>> = valueOrError0.Extract();
                        let mut pair: ESDKEncryptionContextPair = __let_tmp_rhs0.data().clone();
                        let mut newPos: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                        let mut valueOrError1: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(!keys.contains(pair.key()), &Arc::new(ReadProblems::Error {
                                        message: string_utf16_of("Duplicate Encryption Context key value.")
                                    }));
                        if valueOrError1.IsFailure() {
                            return valueOrError1.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>();
                        } else {
                            let mut valueOrError2: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(newPos.start().clone() >= buffer.start().clone() && newPos.start().clone() - buffer.start().clone() < crate::implementation_from_dafny::_SerializableTypes_Compile::_default::ESDK_CANONICAL_ENCRYPTION_CONTEXT_MAX_LENGTH(), &Arc::new(ReadProblems::Error {
                                            message: string_utf16_of("Encryption Context exceeds maximum length.")
                                        }));
                            if valueOrError2.IsFailure() {
                                return valueOrError2.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>();
                            } else {
                                let mut nextAcc: Sequence<ESDKEncryptionContextPair> = accumulator.concat(&seq![pair.clone()]);
                                let mut nextKeys: Set<ValidUTF8Bytes> = keys.merge(&_default::KeysToSet::<ValidUTF8Bytes, ValidUTF8Bytes>(&seq![pair.clone()]));
                                let mut _in0: Arc<ReadableBuffer> = buffer.clone();
                                let mut _in1: Sequence<ESDKEncryptionContextPair> = nextAcc.clone();
                                let mut _in2: Set<ValidUTF8Bytes> = nextKeys.clone();
                                let mut _in3: u16 = count;
                                let mut _in4: Arc<ReadableBuffer> = newPos.clone();
                                _r0 = _in0.clone();
                                _r1 = _in1.clone();
                                _r2 = _in2.clone();
                                _r3 = _in3;
                                _r4 = _in4.clone();
                                continue 'TAIL_CALL_START;
                            }
                        }
                    }
                } else {
                    return Arc::new(Result::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>::Success {
                                value: Arc::new(SuccessfulRead::<ESDKCanonicalEncryptionContext>::SuccessfulRead {
                                            data: accumulator.clone(),
                                            tail: nextPair.clone()
                                        })
                            });
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(537,3)
        pub fn ReadAAD(buffer: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<u16>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt16(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<u16>> = valueOrError0.Extract();
                let mut count: u16 = __let_tmp_rhs0.data().clone();
                let mut ecPos: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                if count == 0 {
                    let mut edks: ESDKCanonicalEncryptionContext = seq![] as Sequence<ESDKEncryptionContextPair>;
                    Arc::new(Result::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>::Success {
                            value: Arc::new(SuccessfulRead::<ESDKCanonicalEncryptionContext>::SuccessfulRead {
                                        data: edks.clone(),
                                        tail: ecPos.clone()
                                    })
                        })
                } else {
                    let mut accumulator: Sequence<ESDKEncryptionContextPair> = seq![] as Sequence<ESDKEncryptionContextPair>;
                    let mut keys: Set<ValidUTF8Bytes> = _default::KeysToSet::<ValidUTF8Bytes, ValidUTF8Bytes>(&accumulator);
                    let mut valueOrError1: Arc<Result<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>> = _default::ReadAADPairs(&ecPos, &accumulator, &keys, count, &ecPos);
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>()
                    } else {
                        let mut __let_tmp_rhs1: Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>> = valueOrError1.Extract();
                        let mut pairs: ESDKCanonicalEncryptionContext = __let_tmp_rhs1.data().clone();
                        let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs1.tail().clone();
                        Arc::new(Result::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>::Success {
                                value: Arc::new(SuccessfulRead::<ESDKCanonicalEncryptionContext>::SuccessfulRead {
                                            data: pairs.clone(),
                                            tail: tail.clone()
                                        })
                            })
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(556,3)
        pub fn ReadAADSection(buffer: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<u16>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt16(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>()
            } else {
                let mut length: Arc<SuccessfulRead<u16>> = valueOrError0.Extract();
                if length.data().clone() == 0 {
                    let mut empty: ESDKCanonicalEncryptionContext = seq![] as Sequence<ESDKEncryptionContextPair>;
                    Arc::new(Result::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>::Success {
                            value: Arc::new(SuccessfulRead::<ESDKCanonicalEncryptionContext>::SuccessfulRead {
                                        data: empty.clone(),
                                        tail: length.tail().clone()
                                    })
                        })
                } else {
                    let mut valueOrError1: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(length.tail().start().clone(), length.data().clone() as u64) <= truncate!(length.tail().bytes().cardinality(), u64), &Arc::new(ReadProblems::MoreNeeded {
                                    pos: crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(length.tail().start().clone(), length.data().clone() as u64)
                                }));
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>()
                    } else {
                        let mut valueOrError2: Arc<Result<Arc<SuccessfulRead<u16>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt16(length.tail());
                        if valueOrError2.IsFailure() {
                            valueOrError2.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>()
                        } else {
                            let mut verifyCount: Arc<SuccessfulRead<u16>> = valueOrError2.Extract();
                            if length.data().clone() == 2 {
                                let mut valueOrError3: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(verifyCount.data().clone() == 0, &Arc::new(ReadProblems::Error {
                                                message: string_utf16_of("Encryption Context pairs count can not exceed byte length")
                                            }));
                                if valueOrError3.IsFailure() {
                                    valueOrError3.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>()
                                } else {
                                    let mut empty: ESDKCanonicalEncryptionContext = seq![] as Sequence<ESDKEncryptionContextPair>;
                                    Arc::new(Result::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>::Success {
                                            value: Arc::new(SuccessfulRead::<ESDKCanonicalEncryptionContext>::SuccessfulRead {
                                                        data: empty.clone(),
                                                        tail: verifyCount.tail().clone()
                                                    })
                                        })
                                }
                            } else {
                                let mut valueOrError4: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(0 < verifyCount.data().clone(), &Arc::new(ReadProblems::Error {
                                                message: string_utf16_of("Encryption Context byte length exceeds pairs count.")
                                            }));
                                if valueOrError4.IsFailure() {
                                    valueOrError4.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>()
                                } else {
                                    let mut valueOrError5: Arc<Result<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>> = _default::ReadAAD(length.tail());
                                    if valueOrError5.IsFailure() {
                                        valueOrError5.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>()
                                    } else {
                                        let mut aad: Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>> = valueOrError5.Extract();
                                        let mut valueOrError6: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(aad.tail().start().clone() >= length.tail().start().clone() && aad.tail().start().clone() - length.tail().start().clone() == length.data().clone() as u64, &Arc::new(ReadProblems::Error {
                                                        message: string_utf16_of("AAD Length did not match stored length.")
                                                    }));
                                        if valueOrError6.IsFailure() {
                                            valueOrError6.PropagateFailure::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>>()
                                        } else {
                                            Arc::new(Result::<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>::Success {
                                                    value: aad.clone()
                                                })
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(610,3)
        pub fn KeysToSet<_K: DafnyTypeEq, _V: DafnyTypeEq>(pairs: &Sequence<Arc<Pair<_K, _V>>>) -> Set<_K> {
            (&({
                let mut pairs = pairs.clone();
                Arc::new(move || -> Set<_K>{
                        let mut _coll0: SetBuilder<_K> = SetBuilder::<_K>::new();
                        for __compr_0 in (&pairs).iter() {
                            let mut p: Arc<Pair<_K, _V>> = __compr_0.clone();
                            if pairs.contains(&p) {
                                _coll0.add(p.key())
                            }
                        }
                        _coll0.build()
                    })
            }))()
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(25,3)
    pub type ESDKEncryptionContextPair = Arc<Pair<ValidUTF8Bytes, ValidUTF8Bytes>>;

    /// dafny/AwsEncryptionSdk/src/Serialize/EncryptionContext.dfy(31,3)
    pub type ESDKCanonicalEncryptionContext = Sequence<ESDKEncryptionContextPair>;
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(6,1)
pub mod _ErrorMessages_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(23,3)
        pub fn IncorrectRawDataKeys(datakey: &Sequence<DafnyCharUTF16>, keyringName: &Sequence<DafnyCharUTF16>, keyProviderId: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            string_utf16_of("EncryptedDataKey ").concat(datakey).concat(&string_utf16_of(" did not match ")).concat(keyringName).concat(&string_utf16_of(". ")).concat(&string_utf16_of("Expected: keyProviderId: ")).concat(keyProviderId).concat(&string_utf16_of(".\n"))
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(33,3)
        pub fn IncorrectDataKeys(encryptedDataKeys: &Sequence<Arc<EncryptedDataKey>>, material: &Arc<AlgorithmSuiteInfo>, errMsg: &Sequence<DafnyCharUTF16>) -> Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> {
            let mut valueOrError0: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = _default::IncorrectDataKeysExpectedValues(encryptedDataKeys, material, errMsg);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Sequence<DafnyCharUTF16>>()
            } else {
                let mut expectedValue: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
                Arc::new(Result::<Sequence<DafnyCharUTF16>, Arc<Error>>::Success {
                        value: string_utf16_of("Unable to decrypt data key: No Encrypted Data Keys found to match. \n Expected: \n").concat(&expectedValue)
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(40,3)
        pub fn IncorrectDataKeysExpectedValues(encryptedDataKeys: &Sequence<Arc<EncryptedDataKey>>, material: &Arc<AlgorithmSuiteInfo>, errMsg: &Sequence<DafnyCharUTF16>) -> Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> {
            let mut _r0 = encryptedDataKeys.clone();
            let mut _r1 = material.clone();
            let mut _r2 = errMsg.clone();
            'TAIL_CALL_START: loop {
                let encryptedDataKeys = _r0;
                let material = _r1;
                let errMsg = _r2;
                if truncate!(encryptedDataKeys.cardinality(), u64) == 0 {
                    return Arc::new(Result::<Sequence<DafnyCharUTF16>, Arc<Error>>::Success {
                                value: errMsg.clone()
                            });
                } else {
                    let mut encryptedDataKey: Arc<EncryptedDataKey> = encryptedDataKeys.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()));
                    let mut valueOrError0: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(encryptedDataKey.keyProviderId()).MapFailure::<Arc<Error>>(&({
                                Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                        Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                                message: e.clone()
                                            })
                                    })
                            }));
                    if valueOrError0.IsFailure() {
                        return valueOrError0.PropagateFailure::<Sequence<DafnyCharUTF16>>();
                    } else {
                        let mut extractedKeyProviderId: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
                        let mut valueOrError1: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(encryptedDataKey.keyProviderInfo()).MapFailure::<Arc<Error>>(&({
                                    Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                            Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                                    message: e.clone()
                                                })
                                        })
                                }));
                        if valueOrError1.IsFailure() {
                            return valueOrError1.PropagateFailure::<Sequence<DafnyCharUTF16>>();
                        } else {
                            let mut extractedKeyProviderInfo: Sequence<DafnyCharUTF16> = valueOrError1.Extract();
                            if extractedKeyProviderId.clone() != string_utf16_of("aws-kms-hierarchy") {
                                let mut _in0: Sequence<Arc<EncryptedDataKey>> = encryptedDataKeys.drop(&int!((&truncate!((&int!(1)).clone(), u32)).clone()));
                                let mut _in1: Arc<AlgorithmSuiteInfo> = material.clone();
                                let mut _in2: Sequence<DafnyCharUTF16> = errMsg.concat(&string_utf16_of("KeyProviderId: ")).concat(&extractedKeyProviderId).concat(&string_utf16_of(", KeyProviderInfo: ")).concat(&extractedKeyProviderInfo).concat(&string_utf16_of("\n"));
                                _r0 = _in0.clone();
                                _r1 = _in1.clone();
                                _r2 = _in2.clone();
                                continue 'TAIL_CALL_START;
                            } else {
                                let mut valueOrError2: Arc<Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::GetProviderWrappedMaterial(encryptedDataKey.ciphertext(), &material);
                                if valueOrError2.IsFailure() {
                                    return valueOrError2.PropagateFailure::<Sequence<DafnyCharUTF16>>();
                                } else {
                                    let mut providerWrappedMaterial: Sequence<u8> = valueOrError2.Extract();
                                    let mut EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX: u64 = _default::SALT_LENGTH() + _default::IV_LENGTH();
                                    let mut EDK_CIPHERTEXT_VERSION_INDEX: u64 = EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX + _default::VERSION_LENGTH();
                                    let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX < EDK_CIPHERTEXT_VERSION_INDEX, &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                                    message: string_utf16_of("Wrong branch key version index.")
                                                }));
                                    if valueOrError3.IsFailure() {
                                        return valueOrError3.PropagateFailure::<Sequence<DafnyCharUTF16>>();
                                    } else {
                                        let mut valueOrError4: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(providerWrappedMaterial.cardinality(), u64) >= EDK_CIPHERTEXT_VERSION_INDEX, &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                                        message: string_utf16_of("Incorrect ciphertext structure.")
                                                    }));
                                        if valueOrError4.IsFailure() {
                                            return valueOrError4.PropagateFailure::<Sequence<DafnyCharUTF16>>();
                                        } else {
                                            let mut branchKeyVersionUuid: Sequence<u8> = providerWrappedMaterial.slice(&int!((&EDK_CIPHERTEXT_BRANCH_KEY_VERSION_INDEX).clone()), &int!((&EDK_CIPHERTEXT_VERSION_INDEX).clone()));
                                            let mut valueOrError5: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::UUID::_default::FromByteArray(&branchKeyVersionUuid).MapFailure::<Arc<Error>>(&({
                                                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                                                Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                                                        message: e.clone()
                                                                    })
                                                            })
                                                    }));
                                            if valueOrError5.IsFailure() {
                                                return valueOrError5.PropagateFailure::<Sequence<DafnyCharUTF16>>();
                                            } else {
                                                let mut branchVersion: Sequence<DafnyCharUTF16> = valueOrError5.Extract();
                                                let mut _in3: Sequence<Arc<EncryptedDataKey>> = encryptedDataKeys.drop(&int!((&truncate!((&int!(1)).clone(), u32)).clone()));
                                                let mut _in4: Arc<AlgorithmSuiteInfo> = material.clone();
                                                let mut _in5: Sequence<DafnyCharUTF16> = errMsg.concat(&string_utf16_of("KeyProviderId: ")).concat(&extractedKeyProviderId).concat(&string_utf16_of(", KeyProviderInfo: ")).concat(&extractedKeyProviderInfo).concat(&string_utf16_of(", BranchKeyVersion: ")).concat(&branchVersion).concat(&string_utf16_of("\n"));
                                                _r0 = _in3.clone();
                                                _r1 = _in4.clone();
                                                _r2 = _in5.clone();
                                                continue 'TAIL_CALL_START;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(15,3)
        pub fn SALT_LENGTH() -> u64 {
            16
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(16,3)
        pub fn IV_LENGTH() -> u64 {
            12
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(17,3)
        pub fn VERSION_LENGTH() -> u64 {
            16
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(19,3)
        pub fn KMS_ECDH_DISCOVERY_ENCRYPT_ERROR() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("KmsPublicKeyDiscovery Key Agreement Scheme is forbidden on encrypt.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(20,3)
        pub fn RAW_ECDH_DISCOVERY_ENCRYPT_ERROR() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("PublicKeyDiscovery Key Agreement Scheme is forbidden on encrypt.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/ErrorMessages.dfy(21,3)
        pub fn RAW_ECDH_EPHEMERAL_DECRYPT_ERROR() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("EphemeralPrivateKeyToStaticPublicKey Key Agreement Scheme is forbidden on decrypt.")
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(37,1)
pub mod ExternDigest {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(50,3)
        pub fn CreateDigestSuccess(bytes: &Sequence<u8>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: bytes.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Digest.dfy(54,3)
        pub fn CreateDigestFailure(error: &Arc<Error>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(29,1)
pub mod ExternRandom {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(41,3)
        pub fn CreateGenerateBytesSuccess(bytes: &Sequence<u8>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: bytes.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(45,3)
        pub fn CreateGenerateBytesFailure(error: &Arc<Error>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
    }
}
/// This module provides basic file I/O operations: reading and writing bytes from/to a file.
/// The provided API is intentionally limited in scope and will be expanded later.
///
/// Where the API accepts file paths as strings, there are some limitations.
/// File paths containing only ASCII characters work identically across languages and platforms;
/// non-ASCII Unicode codepoints may cause different language- or platform-specific behavior.
///
/// File path symbols including . and .. are allowed.
/// ../mpl/libraries/src/FileIO/FileIO.dfy(21,1)
pub mod _FileIO_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_dafny_externs::DafnyLibraries::FileIO;

    pub struct _default {}

    impl _default {
        /// Attempts to read all bytes from the file at the given file path.
        /// If an error occurs, a `Result.Failure` value is returned containing an implementation-specific
        /// error message (which may also contain a stack trace).
        ///
        /// NOTE: See the module description for limitations on the path argument.
        /// ../mpl/libraries/src/FileIO/FileIO.dfy(38,3)
        pub fn ReadBytesFromFile(path: &Sequence<DafnyCharUTF16>) -> Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>> {
            let mut res: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>>;
            let mut isError: bool;
            let mut bytesRead: Sequence<u8>;
            let mut errorMsg: Sequence<DafnyCharUTF16>;
            let mut _out0: bool;
            let mut _out1: Sequence<u8>;
            let mut _out2: Sequence<DafnyCharUTF16>;
            let _x = FileIO::INTERNAL_ReadBytesFromFile(path);
            _out0 = _x.0;
            _out1 = _x.1;
            _out2 = _x.2;
            isError = _out0;
            bytesRead = _out1.clone();
            errorMsg = _out2.clone();
            if isError {
                res = Arc::new(Result::<Sequence<u8>, Sequence<DafnyCharUTF16>>::Failure {
                            error: errorMsg.clone()
                        });
            } else {
                res = Arc::new(Result::<Sequence<u8>, Sequence<DafnyCharUTF16>>::Success {
                            value: bytesRead.clone()
                        });
            };
            return res.clone();
        }
        /// Attempts to write the given bytes to the file at the given file path,
        /// creating nonexistent parent directories as necessary.
        /// If an error occurs, a `Result.Failure` value is returned containing an implementation-specific
        /// error message (which may also contain a stack trace).
        ///
        /// NOTE: See the module description for limitations on the path argument.
        /// ../mpl/libraries/src/FileIO/FileIO.dfy(51,3)
        pub fn WriteBytesToFile(path: &Sequence<DafnyCharUTF16>, bytes: &Sequence<u8>) -> Arc<Result<(), Sequence<DafnyCharUTF16>>> {
            let mut res: Arc<Result<(), Sequence<DafnyCharUTF16>>>;
            let mut isError: bool;
            let mut errorMsg: Sequence<DafnyCharUTF16>;
            let mut _out0: bool;
            let mut _out1: Sequence<DafnyCharUTF16>;
            let _x = FileIO::INTERNAL_WriteBytesToFile(path, bytes);
            _out0 = _x.0;
            _out1 = _x.1;
            isError = _out0;
            errorMsg = _out1.clone();
            if isError {
                res = Arc::new(Result::<(), Sequence<DafnyCharUTF16>>::Failure {
                            error: errorMsg.clone()
                        });
            } else {
                res = Arc::new(Result::<(), Sequence<DafnyCharUTF16>>::Success {
                            value: ()
                        });
            };
            return res.clone();
        }
        /// Attempts to append the given bytes to the file at the given file path,
        /// creating nonexistent parent directories as necessary.
        /// If an error occurs, a `Result.Failure` value is returned containing an implementation-specific
        /// error message (which may also contain a stack trace).
        ///
        /// NOTE: See the module description for limitations on the path argument.
        /// ../mpl/libraries/src/FileIO/FileIO.dfy(65,3)
        pub fn AppendBytesToFile(path: &Sequence<DafnyCharUTF16>, bytes: &Sequence<u8>) -> Arc<Result<(), Sequence<DafnyCharUTF16>>> {
            let mut res: Arc<Result<(), Sequence<DafnyCharUTF16>>>;
            let mut isError: bool;
            let mut errorMsg: Sequence<DafnyCharUTF16>;
            let mut _out0: bool;
            let mut _out1: Sequence<DafnyCharUTF16>;
            let _x = FileIO::INTERNAL_AppendBytesToFile(path, bytes);
            _out0 = _x.0;
            _out1 = _x.1;
            isError = _out0;
            errorMsg = _out1.clone();
            if isError {
                res = Arc::new(Result::<(), Sequence<DafnyCharUTF16>>::Failure {
                            error: errorMsg.clone()
                        });
            } else {
                res = Arc::new(Result::<(), Sequence<DafnyCharUTF16>>::Success {
                            value: ()
                        });
            };
            return res.clone();
        }
    }
}
/// dafny/AwsEncryptionSdk/test/Fixtures.dfy(6,1)
pub mod _Fixtures_Compile {
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_Fixtures_Compile::SmallEncryptionContextVariation::Empty;
    pub use ::dafny_runtime::map;
    pub use crate::implementation_from_dafny::_Fixtures_Compile::SmallEncryptionContextVariation::A;
    pub use crate::implementation_from_dafny::_Fixtures_Compile::SmallEncryptionContextVariation::B;
    pub use crate::implementation_from_dafny::_Fixtures_Compile::SmallEncryptionContextVariation::AB;
    pub use crate::implementation_from_dafny::_Fixtures_Compile::SmallEncryptionContextVariation::BA;
    pub use crate::implementation_from_dafny::_Fixtures_Compile::SmallEncryptionContextVariation::C;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::_System::nat;
    pub use ::dafny_runtime::NumCast;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBitsToGenerate;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRSAKeyPairOutput;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::upcast_object;
    pub use ::dafny_runtime::cast_object;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRSAKeyPairInput;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(33,3)
        pub fn SmallEncryptionContext(v: &Arc<SmallEncryptionContextVariation>) -> Map<ValidUTF8Bytes, ValidUTF8Bytes> {
            let mut encryptionContext = MaybePlacebo::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyA"));
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut keyA: ValidUTF8Bytes = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("valA"));
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut valA: ValidUTF8Bytes = valueOrError1.Extract();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyB"));
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut keyB: ValidUTF8Bytes = valueOrError2.Extract();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("valB"));
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut valB: ValidUTF8Bytes = valueOrError3.Extract();
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyC"));
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            let mut keyC: ValidUTF8Bytes = valueOrError4.Extract();
            let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("valC"));
            if !(!valueOrError5.IsFailure()) {
                panic!("Halt")
            };
            let mut valC: ValidUTF8Bytes = valueOrError5.Extract();
            let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyD"));
            if !(!valueOrError6.IsFailure()) {
                panic!("Halt")
            };
            let mut keyD: ValidUTF8Bytes = valueOrError6.Extract();
            let mut valueOrError7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("valD"));
            if !(!valueOrError7.IsFailure()) {
                panic!("Halt")
            };
            let mut valD: ValidUTF8Bytes = valueOrError7.Extract();
            let mut _source0: Arc<SmallEncryptionContextVariation> = v.clone();
            if matches!((&_source0).as_ref(), Empty{ .. }) {
                encryptionContext = MaybePlacebo::from(map![]);
            } else {
                if matches!((&_source0).as_ref(), A{ .. }) {
                    encryptionContext = MaybePlacebo::from(map![(keyA.clone()) => (valA.clone())]);
                } else {
                    if matches!((&_source0).as_ref(), B{ .. }) {
                        encryptionContext = MaybePlacebo::from(map![(keyB.clone()) => (valB.clone())]);
                    } else {
                        if matches!((&_source0).as_ref(), AB{ .. }) {
                            encryptionContext = MaybePlacebo::from(map![(keyA.clone()) => (valA.clone()), (keyB.clone()) => (valB.clone())]);
                        } else {
                            if matches!((&_source0).as_ref(), BA{ .. }) {
                                encryptionContext = MaybePlacebo::from(map![(keyB.clone()) => (valB.clone()), (keyA.clone()) => (valA.clone())]);
                            } else {
                                if matches!((&_source0).as_ref(), C{ .. }) {
                                    encryptionContext = MaybePlacebo::from(map![(keyC.clone()) => (valC.clone())]);
                                } else {
                                    let mut CE: Arc<SmallEncryptionContextVariation> = v.clone();
                                    encryptionContext = MaybePlacebo::from(map![(keyC.clone()) => (valC.clone()), (keyD.clone()) => (valD.clone())]);
                                }
                            }
                        }
                    }
                }
            };
            return encryptionContext.read();
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(64,3)
        pub fn GetResrvedECMap() -> Map<ValidUTF8Bytes, ValidUTF8Bytes> {
            let mut encryptionContext = MaybePlacebo::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("aws-crypto-public-key"));
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut reservedKey: ValidUTF8Bytes = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("not a real public key"));
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut val: ValidUTF8Bytes = valueOrError1.Extract();
            encryptionContext = MaybePlacebo::from(map![(reservedKey.clone()) => (val.clone())]);
            return encryptionContext.read();
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(73,3)
        pub fn SmallEncryptionContextKeys(v: &Arc<SmallEncryptionContextVariation>) -> Sequence<ValidUTF8Bytes> {
            let mut encryptionContextKeys = MaybePlacebo::<Sequence<ValidUTF8Bytes>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyA"));
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut keyA: ValidUTF8Bytes = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyB"));
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut keyB: ValidUTF8Bytes = valueOrError1.Extract();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyC"));
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut keyC: ValidUTF8Bytes = valueOrError2.Extract();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyD"));
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut keyD: ValidUTF8Bytes = valueOrError3.Extract();
            let mut _source0: Arc<SmallEncryptionContextVariation> = v.clone();
            if matches!((&_source0).as_ref(), Empty{ .. }) {
                encryptionContextKeys = MaybePlacebo::from(seq![] as Sequence<ValidUTF8Bytes>);
            } else {
                if matches!((&_source0).as_ref(), A{ .. }) {
                    encryptionContextKeys = MaybePlacebo::from(seq![keyA.clone()]);
                } else {
                    if matches!((&_source0).as_ref(), B{ .. }) {
                        encryptionContextKeys = MaybePlacebo::from(seq![keyB.clone()]);
                    } else {
                        if matches!((&_source0).as_ref(), AB{ .. }) {
                            encryptionContextKeys = MaybePlacebo::from(seq![keyA.clone(), keyB.clone()]);
                        } else {
                            if matches!((&_source0).as_ref(), BA{ .. }) {
                                encryptionContextKeys = MaybePlacebo::from(seq![keyB.clone(), keyA.clone()]);
                            } else {
                                if matches!((&_source0).as_ref(), C{ .. }) {
                                    encryptionContextKeys = MaybePlacebo::from(seq![keyC.clone()]);
                                } else {
                                    let mut CE: Arc<SmallEncryptionContextVariation> = v.clone();
                                    encryptionContextKeys = MaybePlacebo::from(seq![keyC.clone(), keyD.clone()]);
                                }
                            }
                        }
                    }
                }
            };
            return encryptionContextKeys.read();
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(99,3)
        pub fn SmallMismatchedEncryptionContex(v: &Arc<SmallEncryptionContextVariation>) -> Map<ValidUTF8Bytes, ValidUTF8Bytes> {
            let mut encryptionContext = MaybePlacebo::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyA"));
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut keyA: ValidUTF8Bytes = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("valA"));
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut valA: ValidUTF8Bytes = valueOrError1.Extract();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyB"));
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut keyB: ValidUTF8Bytes = valueOrError2.Extract();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("valB"));
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut valB: ValidUTF8Bytes = valueOrError3.Extract();
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyC"));
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            let mut keyC: ValidUTF8Bytes = valueOrError4.Extract();
            let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("valC"));
            if !(!valueOrError5.IsFailure()) {
                panic!("Halt")
            };
            let mut valC: ValidUTF8Bytes = valueOrError5.Extract();
            let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("keyD"));
            if !(!valueOrError6.IsFailure()) {
                panic!("Halt")
            };
            let mut keyD: ValidUTF8Bytes = valueOrError6.Extract();
            let mut valueOrError7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&string_utf16_of("valD"));
            if !(!valueOrError7.IsFailure()) {
                panic!("Halt")
            };
            let mut valD: ValidUTF8Bytes = valueOrError7.Extract();
            let mut _source0: Arc<SmallEncryptionContextVariation> = v.clone();
            if matches!((&_source0).as_ref(), Empty{ .. }) {
                encryptionContext = MaybePlacebo::from(map![]);
            } else {
                if matches!((&_source0).as_ref(), A{ .. }) {
                    encryptionContext = MaybePlacebo::from(map![(keyA.clone()) => (valB.clone())]);
                } else {
                    if matches!((&_source0).as_ref(), B{ .. }) {
                        encryptionContext = MaybePlacebo::from(map![(keyB.clone()) => (valA.clone())]);
                    } else {
                        if matches!((&_source0).as_ref(), AB{ .. }) {
                            encryptionContext = MaybePlacebo::from(map![(keyA.clone()) => (valC.clone()), (keyB.clone()) => (valD.clone())]);
                        } else {
                            if matches!((&_source0).as_ref(), BA{ .. }) {
                                encryptionContext = MaybePlacebo::from(map![(keyB.clone()) => (valA.clone()), (keyA.clone()) => (valB.clone())]);
                            } else {
                                if matches!((&_source0).as_ref(), C{ .. }) {
                                    encryptionContext = MaybePlacebo::from(map![(keyC.clone()) => (valA.clone())]);
                                } else {
                                    let mut CE: Arc<SmallEncryptionContextVariation> = v.clone();
                                    encryptionContext = MaybePlacebo::from(map![(keyC.clone()) => (valA.clone()), (keyD.clone()) => (valB.clone())]);
                                }
                            }
                        }
                    }
                }
            };
            return encryptionContext.read();
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(130,3)
        pub fn NamespaceAndName(n: &nat) -> (Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>) {
            let mut namespace: Sequence<DafnyCharUTF16>;
            let mut name: Sequence<DafnyCharUTF16>;
            let mut s: Sequence<DafnyCharUTF16> = string_utf16_of("child").concat(&seq![DafnyCharUTF16(<u16 as NumCast>::from(n.clone()).unwrap()) + DafnyCharUTF16(48 as u16)]);
            namespace = s.concat(&string_utf16_of(" Namespace"));
            name = s.concat(&string_utf16_of(" Name"));
            return (
                    namespace.clone(),
                    name.clone()
                );
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(140,3)
        pub fn GenerateKeyPair(keyModulusLength: RSAModulusLengthBitsToGenerate) -> Arc<GenerateRSAKeyPairOutput> {
            let mut keys = MaybePlacebo::<Arc<GenerateRSAKeyPairOutput>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::AtomicPrimitives(&crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::DefaultCryptoConfig());
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut cryptoX: Object<dyn IAwsCryptographicPrimitivesClient> = upcast_object::<AtomicPrimitivesClient, dyn IAwsCryptographicPrimitivesClient>()(valueOrError0.Extract());
            let mut crypto: Object<AtomicPrimitivesClient> = cast_object!(cryptoX.clone(), AtomicPrimitivesClient);
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateRSAKeyPairOutput>, Arc<Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateRSAKeyPairOutput>, Arc<Error>>> = IAwsCryptographicPrimitivesClient::GenerateRSAKeyPair(rd!(crypto.clone()), &Arc::new(GenerateRSAKeyPairInput::GenerateRSAKeyPairInput {
                            lengthBits: keyModulusLength
                        }));
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            keys = MaybePlacebo::from(valueOrError1.Extract());
            return keys.read();
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(21,3)
        pub fn branchKeyStoreName() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("KeyStoreDdbTable")
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(22,3)
        pub fn logicalKeyStoreName() -> Sequence<DafnyCharUTF16> {
            _default::branchKeyStoreName()
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(17,3)
        pub fn keyArn() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("arn:aws:kms:us-west-2:658956600833:key/b3537ef1-d8dc-4780-9f5a-55776cbb2f7f")
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(18,3)
        pub fn hierarchyKeyArn() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("arn:aws:kms:us-west-2:370957321024:key/9d989aa2-2f9c-438c-a745-cc57d3ad0126")
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(19,3)
        pub fn mkrKeyArn() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("arn:aws:kms:us-west-2:370957321024:key/mrk-63d386cb70614ea59b32ad65c9315297")
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(23,3)
        pub fn branchKeyId() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("3f43a9af-08c5-4317-b694-3d3e883dcaef")
        }
        /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(26,3)
        pub fn RESERVED_ENCRYPTION_CONTEXT() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![97, 119, 115, 45, 99, 114, 121, 112, 116, 111, 45];
            s.clone()
        }
    }

    /// dafny/AwsEncryptionSdk/test/Fixtures.dfy(31,3)
    #[derive(PartialEq, Clone)]
    pub enum SmallEncryptionContextVariation {
        Empty {},
        A {},
        B {},
        AB {},
        BA {},
        C {},
        CD {}
    }

    impl SmallEncryptionContextVariation {}

    impl Debug
        for SmallEncryptionContextVariation {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for SmallEncryptionContextVariation {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                SmallEncryptionContextVariation::Empty{} => {
                    write!(_formatter, "Fixtures_Compile.SmallEncryptionContextVariation.Empty")?;
                    Ok(())
                },
                SmallEncryptionContextVariation::A{} => {
                    write!(_formatter, "Fixtures_Compile.SmallEncryptionContextVariation.A")?;
                    Ok(())
                },
                SmallEncryptionContextVariation::B{} => {
                    write!(_formatter, "Fixtures_Compile.SmallEncryptionContextVariation.B")?;
                    Ok(())
                },
                SmallEncryptionContextVariation::AB{} => {
                    write!(_formatter, "Fixtures_Compile.SmallEncryptionContextVariation.AB")?;
                    Ok(())
                },
                SmallEncryptionContextVariation::BA{} => {
                    write!(_formatter, "Fixtures_Compile.SmallEncryptionContextVariation.BA")?;
                    Ok(())
                },
                SmallEncryptionContextVariation::C{} => {
                    write!(_formatter, "Fixtures_Compile.SmallEncryptionContextVariation.C")?;
                    Ok(())
                },
                SmallEncryptionContextVariation::CD{} => {
                    write!(_formatter, "Fixtures_Compile.SmallEncryptionContextVariation.CD")?;
                    Ok(())
                },
            }
        }
    }

    impl SmallEncryptionContextVariation {
        /// Enumerates all possible values of SmallEncryptionContextVariation
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<SmallEncryptionContextVariation>> {
            seq![Arc::new(SmallEncryptionContextVariation::Empty {}), Arc::new(SmallEncryptionContextVariation::A {}), Arc::new(SmallEncryptionContextVariation::B {}), Arc::new(SmallEncryptionContextVariation::AB {}), Arc::new(SmallEncryptionContextVariation::BA {}), Arc::new(SmallEncryptionContextVariation::C {}), Arc::new(SmallEncryptionContextVariation::CD {})].iter()
        }
    }

    impl Eq
        for SmallEncryptionContextVariation {}

    impl Hash
        for SmallEncryptionContextVariation {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                SmallEncryptionContextVariation::Empty{} => {

                },
                SmallEncryptionContextVariation::A{} => {

                },
                SmallEncryptionContextVariation::B{} => {

                },
                SmallEncryptionContextVariation::AB{} => {

                },
                SmallEncryptionContextVariation::BA{} => {

                },
                SmallEncryptionContextVariation::C{} => {

                },
                SmallEncryptionContextVariation::CD{} => {

                },
            }
        }
    }

    impl Default
        for SmallEncryptionContextVariation {
        fn default() -> SmallEncryptionContextVariation {
            SmallEncryptionContextVariation::Empty {}
        }
    }

    impl AsRef<SmallEncryptionContextVariation>
        for SmallEncryptionContextVariation {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// ../mpl/StandardLibrary/src/FloatCompare.dfy(21,1)
pub mod _FloatCompare_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::int;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::_System::nat;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::Zero;
    pub use ::std::default::Default;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::fmt::Formatter;
    pub use ::std::fmt::Result;
    pub use ::std::ops::Deref;
    pub use ::std::mem::transmute;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::ops::Add;
    pub use ::std::ops::Sub;
    pub use ::std::ops::Mul;
    pub use ::std::ops::Div;
    pub use ::std::cmp::PartialOrd;
    pub use ::std::cmp::Ordering;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(32,3)
        pub fn StrToIntInner(s: &Sequence<DafnyCharUTF16>, acc: &DafnyInt) -> DafnyInt {
            let mut _r0 = s.clone();
            let mut _r1 = acc.clone();
            'TAIL_CALL_START: loop {
                let s = _r0;
                let acc = _r1;
                if s.cardinality() == int!(0) {
                    return acc.clone();
                } else {
                    if DafnyCharUTF16(48 as u16) <= s.get(&int!(0)) && s.get(&int!(0)) <= DafnyCharUTF16(57 as u16) {
                        let mut _in0: Sequence<DafnyCharUTF16> = s.drop(&int!(1));
                        let mut _in1: DafnyInt = acc.clone() * int!(10) + int!(s.get(&int!(0)).0) - int!(DafnyCharUTF16(48 as u16).0);
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    } else {
                        let mut _in2: Sequence<DafnyCharUTF16> = s.drop(&int!(1));
                        let mut _in3: DafnyInt = acc.clone();
                        _r0 = _in2.clone();
                        _r1 = _in3.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(44,3)
        pub fn SkipLeadingSpace(val: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            let mut _r0 = val.clone();
            'TAIL_CALL_START: loop {
                let val = _r0;
                if int!(0) < val.cardinality() && val.get(&int!(0)) <= DafnyCharUTF16(32 as u16) {
                    let mut _in0: Sequence<DafnyCharUTF16> = val.drop(&int!(1));
                    _r0 = _in0.clone();
                    continue 'TAIL_CALL_START;
                } else {
                    return val.clone();
                }
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(54,3)
        pub fn StrToInt(s: &Sequence<DafnyCharUTF16>, acc: &DafnyInt) -> DafnyInt {
            let mut tmp: Sequence<DafnyCharUTF16> = _default::SkipLeadingSpace(s);
            if tmp.cardinality() == int!(0) {
                int!(0)
            } else {
                if tmp.get(&int!(0)) == DafnyCharUTF16(45 as u16) {
                    int!(0) - _default::StrToIntInner(s, &int!(0))
                } else {
                    _default::StrToIntInner(s, &int!(0))
                }
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(66,3)
        pub fn SplitE(x: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Option<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>)>> {
            let mut parts: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Option<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>)>> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::_SplitOnce_q::<DafnyCharUTF16>(x, &DafnyCharUTF16(101 as u16));
            if matches!((&parts).as_ref(), Some{ .. }) {
                parts.clone()
            } else {
                crate::implementation_from_dafny::_StandardLibrary_Compile::_default::_SplitOnce_q::<DafnyCharUTF16>(x, &DafnyCharUTF16(69 as u16))
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(76,3)
        pub fn SplitExp(x: &Sequence<DafnyCharUTF16>) -> (Sequence<DafnyCharUTF16>, DafnyInt) {
            let mut parts: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Option<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>)>> = _default::SplitE(x);
            if matches!((&parts).as_ref(), Some{ .. }) {
                (
                    parts.value().0.clone(),
                    _default::StrToInt(&parts.value().1.clone(), &int!(0))
                )
            } else {
                (
                    x.clone(),
                    int!(0)
                )
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(86,3)
        pub fn SkipLeadingZeros(val: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            let mut _r0 = val.clone();
            'TAIL_CALL_START: loop {
                let val = _r0;
                if int!(0) < val.cardinality() && val.get(&int!(0)) == DafnyCharUTF16(48 as u16) {
                    let mut _in0: Sequence<DafnyCharUTF16> = val.drop(&int!(1));
                    _r0 = _in0.clone();
                    continue 'TAIL_CALL_START;
                } else {
                    return val.clone();
                }
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(96,3)
        pub fn SkipTrailingZeros(val: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            let mut _r0 = val.clone();
            'TAIL_CALL_START: loop {
                let val = _r0;
                if int!(0) < val.cardinality() && val.get(&(val.cardinality() - int!(1))) == DafnyCharUTF16(48 as u16) {
                    let mut _in0: Sequence<DafnyCharUTF16> = val.take(&(val.cardinality() - int!(1)));
                    _r0 = _in0.clone();
                    continue 'TAIL_CALL_START;
                } else {
                    return val.clone();
                }
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(106,3)
        pub fn SplitDot(x: &Sequence<DafnyCharUTF16>) -> (Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>) {
            let mut parts: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Option<(Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>)>> = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::_SplitOnce_q::<DafnyCharUTF16>(x, &DafnyCharUTF16(46 as u16));
            if matches!((&parts).as_ref(), Some{ .. }) {
                (
                    _default::SkipLeadingZeros(&parts.value().0.clone()),
                    _default::SkipTrailingZeros(&parts.value().1.clone())
                )
            } else {
                (
                    _default::SkipLeadingZeros(x),
                    string_utf16_of("")
                )
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(116,3)
        pub fn StrCmp(x: &Sequence<DafnyCharUTF16>, y: &Sequence<DafnyCharUTF16>) -> i8 {
            let mut _r0 = x.clone();
            let mut _r1 = y.clone();
            'TAIL_CALL_START: loop {
                let x = _r0;
                let y = _r1;
                if x.cardinality() == int!(0) && y.cardinality() == int!(0) {
                    return 0;
                } else {
                    if x.cardinality() == int!(0) {
                        return -1;
                    } else {
                        if y.cardinality() == int!(0) {
                            return 1;
                        } else {
                            if x.get(&int!(0)) < y.get(&int!(0)) {
                                return -1;
                            } else {
                                if y.get(&int!(0)) < x.get(&int!(0)) {
                                    return 1;
                                } else {
                                    let mut _in0: Sequence<DafnyCharUTF16> = x.drop(&int!(1));
                                    let mut _in1: Sequence<DafnyCharUTF16> = y.drop(&int!(1));
                                    _r0 = _in0.clone();
                                    _r1 = _in1.clone();
                                    continue 'TAIL_CALL_START;
                                }
                            }
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(137,3)
        pub fn AppendZeros(x: &Sequence<DafnyCharUTF16>, newLength: &nat) -> Sequence<DafnyCharUTF16> {
            x.concat(&({
                    let _initializer = {
                            Arc::new(move |i: &DafnyInt| -> DafnyCharUTF16{
                                    DafnyCharUTF16(48 as u16)
                                })
                        };
                    integer_range(Zero::zero(), newLength.clone() - x.cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                }))
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(145,3)
        pub fn CompareFloatInner(x: &Sequence<DafnyCharUTF16>, y: &Sequence<DafnyCharUTF16>) -> i8 {
            let mut xParts: (Sequence<DafnyCharUTF16>, DafnyInt) = _default::SplitExp(x);
            let mut yParts: (Sequence<DafnyCharUTF16>, DafnyInt) = _default::SplitExp(y);
            let mut xNum: (Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>) = _default::SplitDot(&xParts.0.clone());
            let mut yNum: (Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>) = _default::SplitDot(&yParts.0.clone());
            let mut xDigits: Sequence<DafnyCharUTF16> = _default::SkipLeadingZeros(&xNum.0.clone().concat(&xNum.1.clone()));
            let mut yDigits: Sequence<DafnyCharUTF16> = _default::SkipLeadingZeros(&yNum.0.clone().concat(&yNum.1.clone()));
            let mut xExp: DafnyInt = xParts.1.clone() - xNum.1.clone().cardinality();
            let mut yExp: DafnyInt = yParts.1.clone() - yNum.1.clone().cardinality();
            let mut logX: DafnyInt = xExp.clone() + xDigits.cardinality();
            let mut logY: DafnyInt = yExp.clone() + yDigits.cardinality();
            if logY.clone() < logX.clone() {
                1
            } else {
                if logX.clone() < logY.clone() {
                    -1
                } else {
                    if xDigits.cardinality() < yDigits.cardinality() {
                        _default::StrCmp(&_default::AppendZeros(&xDigits, &yDigits.cardinality()), &yDigits)
                    } else {
                        if yDigits.cardinality() < xDigits.cardinality() {
                            _default::StrCmp(&xDigits, &_default::AppendZeros(&yDigits, &xDigits.cardinality()))
                        } else {
                            _default::StrCmp(&xDigits, &yDigits)
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(185,3)
        pub fn IsNegative(x: &Sequence<DafnyCharUTF16>) -> bool {
            int!(0) < x.cardinality() && x.get(&int!(0)) == DafnyCharUTF16(45 as u16)
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(191,3)
        pub fn SkipLeadingPlus(x: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            if int!(0) < x.cardinality() && x.get(&int!(0)) == DafnyCharUTF16(43 as u16) {
                x.drop(&int!(1))
            } else {
                x.clone()
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(201,3)
        pub fn IsZero(x: &Sequence<DafnyCharUTF16>) -> bool {
            let mut _r0 = x.clone();
            'TAIL_CALL_START: loop {
                let x = _r0;
                if x.cardinality() == int!(0) {
                    return true;
                } else {
                    if x.get(&int!(0)) == DafnyCharUTF16(48 as u16) || x.get(&int!(0)) == DafnyCharUTF16(46 as u16) {
                        let mut _in0: Sequence<DafnyCharUTF16> = x.drop(&int!(1));
                        _r0 = _in0.clone();
                        continue 'TAIL_CALL_START;
                    } else {
                        if DafnyCharUTF16(49 as u16) <= x.get(&int!(0)) && x.get(&int!(0)) <= DafnyCharUTF16(57 as u16) {
                            return false;
                        } else {
                            return true;
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(214,3)
        pub fn RecognizeZero(x: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            if _default::IsNegative(x) {
                if _default::IsZero(&x.drop(&int!(1))) {
                    string_utf16_of("0")
                } else {
                    x.clone()
                }
            } else {
                if _default::IsZero(x) {
                    string_utf16_of("0")
                } else {
                    x.clone()
                }
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(228,3)
        pub fn CleanNumber(x: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            _default::RecognizeZero(&_default::SkipLeadingPlus(&_default::SkipLeadingSpace(x)))
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(233,3)
        pub fn CompareFloat(x: &Sequence<DafnyCharUTF16>, y: &Sequence<DafnyCharUTF16>) -> i8 {
            let mut x: Sequence<DafnyCharUTF16> = _default::CleanNumber(x);
            let mut y: Sequence<DafnyCharUTF16> = _default::CleanNumber(y);
            if _default::IsNegative(&x) && _default::IsNegative(&y) {
                _default::CompareFloatInner(&y.drop(&int!(1)), &x.drop(&int!(1)))
            } else {
                if _default::IsNegative(&x) {
                    -1
                } else {
                    if _default::IsNegative(&y) {
                        1
                    } else {
                        _default::CompareFloatInner(&x, &y)
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(26,3)
        pub fn Less() -> i8 {
            -1
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(27,3)
        pub fn Equal() -> i8 {
            0
        }
        /// ../mpl/StandardLibrary/src/FloatCompare.dfy(28,3)
        pub fn Greater() -> i8 {
            1
        }
    }

    /// ../mpl/StandardLibrary/src/FloatCompare.dfy(25,3)
    #[derive(Clone, PartialEq, Copy)]
    #[repr(transparent)]
    pub struct CompareType(pub i8);

    impl CompareType {
        /// Constraint check
        pub fn is(_source: i8) -> bool {
            let mut x: DafnyInt = int!(_source.clone());
            return int!(-1) <= x.clone() && x.clone() <= int!(1);
        }
    }

    impl Default
        for CompareType {
        /// An element of CompareType
        fn default() -> Self {
            CompareType(Default::default())
        }
    }

    impl DafnyPrint
        for CompareType {
        /// For Dafny print statements
        fn fmt_print(&self, _formatter: &mut Formatter, in_seq: bool) -> Result {
            DafnyPrint::fmt_print(&self.0, _formatter, in_seq)
        }
    }

    impl Deref
        for CompareType {
        type Target = i8;
        fn deref(&self) -> &Self::Target {
            &self.0
        }
    }

    impl CompareType {
        /// SAFETY: The newtype is marked as transparent
        pub fn _from_ref(o: &i8) -> &Self {
            unsafe {
                transmute(o)
            }
        }
    }

    impl Hash
        for CompareType {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            self.0.hash(_state)
        }
    }

    impl Add
        for CompareType {
        type Output = CompareType;
        fn add(self, other: Self) -> Self {
            CompareType(self.0 + other.0)
        }
    }

    impl Sub
        for CompareType {
        type Output = CompareType;
        fn sub(self, other: Self) -> Self {
            CompareType(self.0 - other.0)
        }
    }

    impl Mul
        for CompareType {
        type Output = CompareType;
        fn mul(self, other: Self) -> Self {
            CompareType(self.0 * other.0)
        }
    }

    impl Div
        for CompareType {
        type Output = CompareType;
        fn div(self, other: Self) -> Self {
            CompareType(self.0 / other.0)
        }
    }

    impl PartialOrd
        for CompareType {
        fn partial_cmp(&self, other: &Self) -> ::std::option::Option<Ordering> {
            PartialOrd::partial_cmp(&self.0, &other.0)
        }
    }
}
/// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(11,1)
pub mod _Frames_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq32;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq64;
    pub use crate::implementation_from_dafny::_Header_Compile::HeaderInfo;
    pub use crate::implementation_from_dafny::_Header_Compile::Header;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(140,3)
        pub fn WriteRegularFrame(regularFrame: &RegularFrame) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint32(regularFrame.seqNum().clone()).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(regularFrame.iv())).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(regularFrame.encContent())).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(regularFrame.authTag()))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(157,3)
        pub fn ReadRegularFrame(buffer: &Arc<ReadableBuffer>, header: &FramedHeader) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<RegularFrame>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u32>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt32(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<RegularFrame>>>()
            } else {
                let mut sequenceNumber: Arc<SuccessfulRead<u32>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(sequenceNumber.data().clone() < _default::ENDFRAME_SEQUENCE_NUMBER(), &Arc::new(ReadProblems::Error {
                                message: string_utf16_of("Regular frame sequence number can not equal or exceed the final frame.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<RegularFrame>>>()
                } else {
                    let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(sequenceNumber.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(header.suite()) as u64);
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<SuccessfulRead<RegularFrame>>>()
                    } else {
                        let mut iv: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError2.Extract();
                        let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(iv.tail(), header.body().frameLength().clone() as u64);
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<SuccessfulRead<RegularFrame>>>()
                        } else {
                            let mut encContent: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError3.Extract();
                            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(encContent.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(header.suite()) as u64);
                            if valueOrError4.IsFailure() {
                                valueOrError4.PropagateFailure::<Arc<SuccessfulRead<RegularFrame>>>()
                            } else {
                                let mut authTag: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError4.Extract();
                                let mut regularFrame: RegularFrame = Arc::new(Frame::RegularFrame {
                                            header: header.clone(),
                                            seqNum: sequenceNumber.data().clone(),
                                            iv: iv.data().clone(),
                                            encContent: encContent.data().clone(),
                                            authTag: authTag.data().clone()
                                        });
                                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<RegularFrame>>, Arc<ReadProblems>>::Success {
                                        value: Arc::new(SuccessfulRead::<RegularFrame>::SuccessfulRead {
                                                    data: regularFrame.clone(),
                                                    tail: authTag.tail().clone()
                                                })
                                    })
                            }
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(201,3)
        pub fn WriteFinalFrame(finalFrame: &FinalFrame) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint32(_default::ENDFRAME_SEQUENCE_NUMBER()).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint32(finalFrame.seqNum().clone())).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(finalFrame.iv())).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint32Seq(finalFrame.encContent())).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(finalFrame.authTag()))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(223,3)
        pub fn ReadFinalFrame(buffer: &Arc<ReadableBuffer>, header: &FramedHeader) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<FinalFrame>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u32>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt32(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<FinalFrame>>>()
            } else {
                let mut finalFrameSignal: Arc<SuccessfulRead<u32>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(finalFrameSignal.data().clone() == _default::ENDFRAME_SEQUENCE_NUMBER(), &Arc::new(ReadProblems::Error {
                                message: string_utf16_of("Final frame sequence number MUST be the end-frame sequence number.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<FinalFrame>>>()
                } else {
                    let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u32>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt32(finalFrameSignal.tail());
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<SuccessfulRead<FinalFrame>>>()
                    } else {
                        let mut sequenceNumber: Arc<SuccessfulRead<u32>> = valueOrError2.Extract();
                        let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(sequenceNumber.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(header.suite()) as u64);
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<SuccessfulRead<FinalFrame>>>()
                        } else {
                            let mut iv: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError3.Extract();
                            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u32>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt32(iv.tail());
                            if valueOrError4.IsFailure() {
                                valueOrError4.PropagateFailure::<Arc<SuccessfulRead<FinalFrame>>>()
                            } else {
                                let mut contentLength: Arc<SuccessfulRead<u32>> = valueOrError4.Extract();
                                let mut valueOrError5: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(contentLength.data().clone() <= header.body().frameLength().clone(), &Arc::new(ReadProblems::Error {
                                                message: string_utf16_of("Content length MUST NOT exceed the frame length.")
                                            }));
                                if valueOrError5.IsFailure() {
                                    valueOrError5.PropagateFailure::<Arc<SuccessfulRead<FinalFrame>>>()
                                } else {
                                    let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<seq32<u8>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUint32Seq(iv.tail());
                                    if valueOrError6.IsFailure() {
                                        valueOrError6.PropagateFailure::<Arc<SuccessfulRead<FinalFrame>>>()
                                    } else {
                                        let mut encContent: Arc<SuccessfulRead<seq32<u8>>> = valueOrError6.Extract();
                                        let mut valueOrError7: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(encContent.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(header.suite()) as u64);
                                        if valueOrError7.IsFailure() {
                                            valueOrError7.PropagateFailure::<Arc<SuccessfulRead<FinalFrame>>>()
                                        } else {
                                            let mut authTag: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError7.Extract();
                                            let mut finalFrame: FinalFrame = Arc::new(Frame::FinalFrame {
                                                        header: header.clone(),
                                                        seqNum: sequenceNumber.data().clone(),
                                                        iv: iv.data().clone(),
                                                        encContent: encContent.data().clone(),
                                                        authTag: authTag.data().clone()
                                                    });
                                            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<FinalFrame>>, MoreNeeded>::Success {
                                                    value: Arc::new(SuccessfulRead::<FinalFrame>::SuccessfulRead {
                                                                data: finalFrame.clone(),
                                                                tail: authTag.tail().clone()
                                                            })
                                                })
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(291,3)
        pub fn ReadNonFrame(buffer: &Arc<ReadableBuffer>, header: &NonFramedHeader) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<NonFramed>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(header.suite()) as u64);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<NonFramed>>>()
            } else {
                let mut iv: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u64>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt64(iv.tail());
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<NonFramed>>>()
                } else {
                    let mut contentLength: Arc<SuccessfulRead<u64>> = valueOrError1.Extract();
                    let mut valueOrError2: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(contentLength.data().clone() < _default::SAFE_MAX_ENCRYPT(), &Arc::new(ReadProblems::Error {
                                    message: string_utf16_of("Frame exceeds AES-GCM cryptographic safety for a single key/iv.")
                                }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<SuccessfulRead<NonFramed>>>()
                    } else {
                        let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<seq64<u8>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUint64Seq(iv.tail());
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<SuccessfulRead<NonFramed>>>()
                        } else {
                            let mut encContent: Arc<SuccessfulRead<seq64<u8>>> = valueOrError3.Extract();
                            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(encContent.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(header.suite()) as u64);
                            if valueOrError4.IsFailure() {
                                valueOrError4.PropagateFailure::<Arc<SuccessfulRead<NonFramed>>>()
                            } else {
                                let mut authTag: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError4.Extract();
                                let mut nonFramed: NonFramed = Arc::new(Frame::NonFramed {
                                            header: header.clone(),
                                            iv: iv.data().clone(),
                                            encContent: encContent.data().clone(),
                                            authTag: authTag.data().clone()
                                        });
                                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<NonFramed>>, MoreNeeded>::Success {
                                        value: Arc::new(SuccessfulRead::<NonFramed>::SuccessfulRead {
                                                    data: nonFramed.clone(),
                                                    tail: authTag.tail().clone()
                                                })
                                    })
                            }
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(28,3)
        pub fn ENDFRAME_SEQUENCE_NUMBER() -> u32 {
            4294967295
        }
        /// 2^36 - 32
        /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(138,3)
        pub fn SAFE_MAX_ENCRYPT() -> u64 {
            68719476704
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(27,3)
        pub fn START_SEQUENCE_NUMBER() -> u32 {
            1
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(29,3)
        pub fn NONFRAMED_SEQUENCE_NUMBER() -> u32 {
            1
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(31,3)
    pub type FramedHeader = Arc<HeaderInfo>;

    /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(39,3)
    pub type NonFramedHeader = Arc<HeaderInfo>;

    /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(47,3)
    #[derive(PartialEq, Clone)]
    pub enum Frame {
        RegularFrame {
            header: Header,
            seqNum: u32,
            iv: Sequence<u8>,
            encContent: Sequence<u8>,
            authTag: Sequence<u8>
        },
        FinalFrame {
            header: Header,
            seqNum: u32,
            iv: Sequence<u8>,
            encContent: Sequence<u8>,
            authTag: Sequence<u8>
        },
        NonFramed {
            header: Header,
            iv: Sequence<u8>,
            encContent: Sequence<u8>,
            authTag: Sequence<u8>
        }
    }

    impl Frame {
        /// Gets the field header for all enum members which have it
        pub fn header(&self) -> &Header {
            match self {
                Frame::RegularFrame{header, seqNum, iv, encContent, authTag, } => header,
                Frame::FinalFrame{header, seqNum, iv, encContent, authTag, } => header,
                Frame::NonFramed{header, iv, encContent, authTag, } => header,
            }
        }
        /// Gets the field seqNum for all enum members which have it
        pub fn seqNum(&self) -> &u32 {
            match self {
                Frame::RegularFrame{header, seqNum, iv, encContent, authTag, } => seqNum,
                Frame::FinalFrame{header, seqNum, iv, encContent, authTag, } => seqNum,
                Frame::NonFramed{header, iv, encContent, authTag, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field iv for all enum members which have it
        pub fn iv(&self) -> &Sequence<u8> {
            match self {
                Frame::RegularFrame{header, seqNum, iv, encContent, authTag, } => iv,
                Frame::FinalFrame{header, seqNum, iv, encContent, authTag, } => iv,
                Frame::NonFramed{header, iv, encContent, authTag, } => iv,
            }
        }
        /// Gets the field encContent for all enum members which have it
        pub fn encContent(&self) -> &Sequence<u8> {
            match self {
                Frame::RegularFrame{header, seqNum, iv, encContent, authTag, } => encContent,
                Frame::FinalFrame{header, seqNum, iv, encContent, authTag, } => encContent,
                Frame::NonFramed{header, iv, encContent, authTag, } => encContent,
            }
        }
        /// Gets the field authTag for all enum members which have it
        pub fn authTag(&self) -> &Sequence<u8> {
            match self {
                Frame::RegularFrame{header, seqNum, iv, encContent, authTag, } => authTag,
                Frame::FinalFrame{header, seqNum, iv, encContent, authTag, } => authTag,
                Frame::NonFramed{header, iv, encContent, authTag, } => authTag,
            }
        }
    }

    impl Debug
        for Frame {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Frame {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Frame::RegularFrame{header, seqNum, iv, encContent, authTag, } => {
                    write!(_formatter, "Frames_Compile.Frame.RegularFrame(")?;
                    DafnyPrint::fmt_print(header, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(seqNum, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(iv, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encContent, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(authTag, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
                Frame::FinalFrame{header, seqNum, iv, encContent, authTag, } => {
                    write!(_formatter, "Frames_Compile.Frame.FinalFrame(")?;
                    DafnyPrint::fmt_print(header, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(seqNum, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(iv, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encContent, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(authTag, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
                Frame::NonFramed{header, iv, encContent, authTag, } => {
                    write!(_formatter, "Frames_Compile.Frame.NonFramed(")?;
                    DafnyPrint::fmt_print(header, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(iv, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encContent, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(authTag, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for Frame {}

    impl Hash
        for Frame {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Frame::RegularFrame{header, seqNum, iv, encContent, authTag, } => {
                    Hash::hash(header, _state);
                    Hash::hash(seqNum, _state);
                    Hash::hash(iv, _state);
                    Hash::hash(encContent, _state);
                    Hash::hash(authTag, _state)
                },
                Frame::FinalFrame{header, seqNum, iv, encContent, authTag, } => {
                    Hash::hash(header, _state);
                    Hash::hash(seqNum, _state);
                    Hash::hash(iv, _state);
                    Hash::hash(encContent, _state);
                    Hash::hash(authTag, _state)
                },
                Frame::NonFramed{header, iv, encContent, authTag, } => {
                    Hash::hash(header, _state);
                    Hash::hash(iv, _state);
                    Hash::hash(encContent, _state);
                    Hash::hash(authTag, _state)
                },
            }
        }
    }

    impl Default
        for Frame {
        fn default() -> Frame {
            Frame::RegularFrame {
                header: Default::default(),
                seqNum: Default::default(),
                iv: Default::default(),
                encContent: Default::default(),
                authTag: Default::default()
            }
        }
    }

    impl AsRef<Frame>
        for Frame {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(93,3)
    pub type RegularFrame = Arc<Frame>;

    /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(109,3)
    pub type FinalFrame = Arc<Frame>;

    /// dafny/AwsEncryptionSdk/src/Serialize/Frames.dfy(125,3)
    pub type NonFramed = Arc<Frame>;
}
/// *****************************************************************************
///  Original Copyright under the following:
///  Copyright 2018-2021 VMware, Inc., Microsoft Inc., Carnegie Mellon University,
///  ETH Zurich, and University of Washington
///  SPDX-License-Identifier: BSD-2-Clause
///
///  Copyright (c) Microsoft Corporation
///  SPDX-License-Identifier: MIT
///
///  Modifications and Extensions: Copyright by the contributors to the Dafny Project
///  SPDX-License-Identifier: MIT
/// *****************************************************************************
/// ../mpl/libraries/src/Functions.dfy(16,1)
pub mod _Functions_Compile {

}
/// *****************************************************************************
///  Original: Copyright (c) Microsoft Corporation
///  SPDX-License-Identifier: MIT
///
///  Modifications and Extensions: Copyright by the contributors to the Dafny Project
///  SPDX-License-Identifier: MIT
/// *****************************************************************************
/// ../mpl/libraries/src/NonlinearArithmetic/Internals/GeneralInternals.dfy(11,1)
pub mod _GeneralInternals_Compile {

}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/GetKeys.dfy(11,1)
pub mod _GetKeys_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyInput;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetActiveBranchKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Structure_Compile::ActiveBranchKeyItem;
    pub use crate::implementation_from_dafny::_Structure_Compile::BranchKeyContext;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptResponse;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BranchKeyMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBranchKeyVersionInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBranchKeyVersionOutput;
    pub use crate::implementation_from_dafny::_Structure_Compile::VersionBranchKeyItem;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBeaconKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::GetBeaconKeyOutput;
    pub use crate::implementation_from_dafny::_Structure_Compile::BeaconKeyItem;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BeaconKeyMaterials;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/GetKeys.dfy(27,3)
        pub fn GetActiveKeyAndUnwrap(input: &Arc<GetActiveBranchKeyInput>, tableName: &Sequence<DafnyCharUTF16>, logicalKeyStoreName: &Sequence<DafnyCharUTF16>, kmsConfiguration: &Arc<KMSConfiguration>, grantTokens: &GrantTokenList, kmsClient: &Object<dyn IKMSClient>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<Result<Arc<GetActiveBranchKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<GetActiveBranchKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Result<ActiveBranchKeyItem, Arc<Error>>>;
            let mut _out0: Arc<Result<ActiveBranchKeyItem, Arc<Error>>> = crate::implementation_from_dafny::_DDBKeystoreOperations_Compile::_default::GetActiveBranchKeyItem(input.branchKeyIdentifier(), tableName, ddbClient);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GetActiveBranchKeyOutput>>());
                return output.read();
            };
            let mut branchKeyItem: ActiveBranchKeyItem = valueOrError0.Extract();
            let mut encryptionContext: BranchKeyContext = crate::implementation_from_dafny::_Structure_Compile::_default::ToBranchKeyContext(&branchKeyItem, logicalKeyStoreName);
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KmsArn_Compile::_default::_ValidKmsArn_q(&encryptionContext.get(&crate::implementation_from_dafny::_Structure_Compile::_default::KMS_FIELD())), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::RETRIEVED_KEYSTORE_ITEM_INVALID_KMS_ARN()
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GetActiveBranchKeyOutput>>());
                return output.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::_AttemptKmsOperation_q(kmsConfiguration, &encryptionContext), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::GET_KEY_ARN_DISAGREEMENT()
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<GetActiveBranchKeyOutput>>());
                return output.read();
            };
            let mut valueOrError3: Arc<Result<Arc<DecryptResponse>, Arc<Error>>>;
            let mut _out1: Arc<Result<Arc<DecryptResponse>, Arc<Error>>> = crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::DecryptKey(&encryptionContext, &branchKeyItem, kmsConfiguration, grantTokens, kmsClient);
            valueOrError3 = _out1.clone();
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<GetActiveBranchKeyOutput>>());
                return output.read();
            };
            let mut branchKey: Arc<DecryptResponse> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Arc<BranchKeyMaterials>, Arc<Error>>> = crate::implementation_from_dafny::_Structure_Compile::_default::ToBranchKeyMaterials(&encryptionContext, branchKey.Plaintext().value());
            if valueOrError4.IsFailure() {
                output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<GetActiveBranchKeyOutput>>());
                return output.read();
            };
            let mut branchKeyMaterials: Arc<BranchKeyMaterials> = valueOrError4.Extract();
            output = MaybePlacebo::from(Arc::new(Result::<Arc<GetActiveBranchKeyOutput>, Arc<Error>>::Success {
                            value: Arc::new(GetActiveBranchKeyOutput::GetActiveBranchKeyOutput {
                                        branchKeyMaterials: branchKeyMaterials.clone()
                                    })
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/GetKeys.dfy(161,3)
        pub fn GetBranchKeyVersion(input: &Arc<GetBranchKeyVersionInput>, tableName: &Sequence<DafnyCharUTF16>, logicalKeyStoreName: &Sequence<DafnyCharUTF16>, kmsConfiguration: &Arc<KMSConfiguration>, grantTokens: &GrantTokenList, kmsClient: &Object<dyn IKMSClient>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<Result<Arc<GetBranchKeyVersionOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<GetBranchKeyVersionOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Result<VersionBranchKeyItem, Arc<Error>>>;
            let mut _out0: Arc<Result<VersionBranchKeyItem, Arc<Error>>> = crate::implementation_from_dafny::_DDBKeystoreOperations_Compile::_default::GetVersionBranchKeyItem(input.branchKeyIdentifier(), input.branchKeyVersion(), tableName, ddbClient);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GetBranchKeyVersionOutput>>());
                return output.read();
            };
            let mut branchKeyItem: VersionBranchKeyItem = valueOrError0.Extract();
            let mut encryptionContext: BranchKeyContext = crate::implementation_from_dafny::_Structure_Compile::_default::ToBranchKeyContext(&branchKeyItem, logicalKeyStoreName);
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KmsArn_Compile::_default::_ValidKmsArn_q(&encryptionContext.get(&crate::implementation_from_dafny::_Structure_Compile::_default::KMS_FIELD())), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::RETRIEVED_KEYSTORE_ITEM_INVALID_KMS_ARN()
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GetBranchKeyVersionOutput>>());
                return output.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::_AttemptKmsOperation_q(kmsConfiguration, &encryptionContext), &Arc::new(Error::KeyStoreException {
                            message: string_utf16_of("AWS KMS Key ARN does not match configured value")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<GetBranchKeyVersionOutput>>());
                return output.read();
            };
            let mut valueOrError3: Arc<Result<Arc<DecryptResponse>, Arc<Error>>>;
            let mut _out1: Arc<Result<Arc<DecryptResponse>, Arc<Error>>> = crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::DecryptKey(&encryptionContext, &branchKeyItem, kmsConfiguration, grantTokens, kmsClient);
            valueOrError3 = _out1.clone();
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<GetBranchKeyVersionOutput>>());
                return output.read();
            };
            let mut branchKey: Arc<DecryptResponse> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Arc<BranchKeyMaterials>, Arc<Error>>> = crate::implementation_from_dafny::_Structure_Compile::_default::ToBranchKeyMaterials(&encryptionContext, branchKey.Plaintext().value());
            if valueOrError4.IsFailure() {
                output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<GetBranchKeyVersionOutput>>());
                return output.read();
            };
            let mut branchKeyMaterials: Arc<BranchKeyMaterials> = valueOrError4.Extract();
            output = MaybePlacebo::from(Arc::new(Result::<Arc<GetBranchKeyVersionOutput>, Arc<Error>>::Success {
                            value: Arc::new(GetBranchKeyVersionOutput::GetBranchKeyVersionOutput {
                                        branchKeyMaterials: branchKeyMaterials.clone()
                                    })
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/GetKeys.dfy(297,3)
        pub fn GetBeaconKeyAndUnwrap(input: &Arc<GetBeaconKeyInput>, tableName: &Sequence<DafnyCharUTF16>, logicalKeyStoreName: &Sequence<DafnyCharUTF16>, kmsConfiguration: &Arc<KMSConfiguration>, grantTokens: &GrantTokenList, kmsClient: &Object<dyn IKMSClient>, ddbClient: &Object<dyn IDynamoDBClient>) -> Arc<Result<Arc<GetBeaconKeyOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<GetBeaconKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Result<BeaconKeyItem, Arc<Error>>>;
            let mut _out0: Arc<Result<BeaconKeyItem, Arc<Error>>> = crate::implementation_from_dafny::_DDBKeystoreOperations_Compile::_default::GetBeaconKeyItem(input.branchKeyIdentifier(), tableName, ddbClient);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GetBeaconKeyOutput>>());
                return output.read();
            };
            let mut branchKeyItem: BeaconKeyItem = valueOrError0.Extract();
            let mut encryptionContext: BranchKeyContext = crate::implementation_from_dafny::_Structure_Compile::_default::ToBranchKeyContext(&branchKeyItem, logicalKeyStoreName);
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KmsArn_Compile::_default::_ValidKmsArn_q(&encryptionContext.get(&crate::implementation_from_dafny::_Structure_Compile::_default::KMS_FIELD())), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::RETRIEVED_KEYSTORE_ITEM_INVALID_KMS_ARN()
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GetBeaconKeyOutput>>());
                return output.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::_AttemptKmsOperation_q(kmsConfiguration, &encryptionContext), &Arc::new(Error::KeyStoreException {
                            message: string_utf16_of("AWS KMS Key ARN does not match configured value")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<GetBeaconKeyOutput>>());
                return output.read();
            };
            let mut valueOrError3: Arc<Result<Arc<DecryptResponse>, Arc<Error>>>;
            let mut _out1: Arc<Result<Arc<DecryptResponse>, Arc<Error>>> = crate::implementation_from_dafny::_KMSKeystoreOperations_Compile::_default::DecryptKey(&encryptionContext, &branchKeyItem, kmsConfiguration, grantTokens, kmsClient);
            valueOrError3 = _out1.clone();
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<GetBeaconKeyOutput>>());
                return output.read();
            };
            let mut branchKey: Arc<DecryptResponse> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Arc<BeaconKeyMaterials>, Arc<Error>>> = crate::implementation_from_dafny::_Structure_Compile::_default::ToBeaconKeyMaterials(&encryptionContext, branchKey.Plaintext().value());
            if valueOrError4.IsFailure() {
                output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<GetBeaconKeyOutput>>());
                return output.read();
            };
            let mut branchKeyMaterials: Arc<BeaconKeyMaterials> = valueOrError4.Extract();
            output = MaybePlacebo::from(Arc::new(Result::<Arc<GetBeaconKeyOutput>, Arc<Error>>::Success {
                            value: Arc::new(GetBeaconKeyOutput::GetBeaconKeyOutput {
                                        beaconKeyMaterials: branchKeyMaterials.clone()
                                    })
                        }));
            return output.read();
        }
    }
}
/// ../mpl/StandardLibrary/src/GetOpt.dfy(109,1)
pub mod _GetOpt_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::DafnyPrintWrapper;
    pub use ::dafny_runtime::DafnyType;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::_System::nat;
    pub use ::dafny_runtime::Map;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::set;
    pub use crate::implementation_from_dafny::_GetOpt_Compile::Param::Command;
    pub use crate::implementation_from_dafny::_GetOpt_Compile::Param::Flag;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::Zero;
    pub use crate::implementation_from_dafny::_GetOpt_Compile::Param::Opt;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::map;
    pub use ::dafny_runtime::DafnyTypeEq;
    pub use ::dafny_runtime::NumCast;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::convert::AsRef;
    pub use crate::implementation_from_dafny::_GetOpt_Compile::Unused::Required;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(113,3)
        pub fn Example(args: &Sequence<Sequence<DafnyCharUTF16>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Sequence<DafnyCharUTF16>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Sequence<DafnyCharUTF16>>>>::new();
            let mut MyOptions: Sequence<Arc<Param>> = seq![Arc::new(Param::Flag {
                            name: string_utf16_of("foo"),
                            help: string_utf16_of("Does foo things"),
                            short: _default::NullChar(),
                            solo: false,
                            inherit: false,
                            vis: Arc::new(Visibility::Normal {}),
                            shortAlias: seq![] as Sequence<DafnyCharUTF16>,
                            longAlias: seq![] as Sequence<Sequence<DafnyCharUTF16>>
                        }), Arc::new(Param::Opt {
                            name: string_utf16_of("two"),
                            help: string_utf16_of("Does bar things to thingy"),
                            argName: string_utf16_of("thingy"),
                            short: DafnyCharUTF16(116 as u16),
                            unused: Arc::new(Unused::UnusedOk {}),
                            inherit: false,
                            vis: Arc::new(Visibility::Normal {}),
                            shortAlias: seq![] as Sequence<DafnyCharUTF16>,
                            longAlias: seq![] as Sequence<Sequence<DafnyCharUTF16>>,
                            positional: Arc::new(Tri::No {})
                        }), Arc::new(Param::Command {
                            options: Arc::new(Options::Options {
                                        name: string_utf16_of("command"),
                                        help: string_utf16_of("Does command stuff"),
                                        params: seq![Arc::new(Param::Opt {
                                                        name: string_utf16_of("two"),
                                                        help: string_utf16_of("Does bar things to thingy"),
                                                        argName: string_utf16_of("thingy"),
                                                        short: DafnyCharUTF16(116 as u16),
                                                        unused: Arc::new(Unused::UnusedOk {}),
                                                        inherit: false,
                                                        vis: Arc::new(Visibility::Normal {}),
                                                        shortAlias: seq![] as Sequence<DafnyCharUTF16>,
                                                        longAlias: seq![] as Sequence<Sequence<DafnyCharUTF16>>,
                                                        positional: Arc::new(Tri::No {})
                                                    }), Arc::new(Param::Flag {
                                                        name: string_utf16_of("foo"),
                                                        help: string_utf16_of("Does foo things"),
                                                        short: _default::NullChar(),
                                                        solo: false,
                                                        inherit: false,
                                                        vis: Arc::new(Visibility::Normal {}),
                                                        shortAlias: seq![] as Sequence<DafnyCharUTF16>,
                                                        longAlias: seq![] as Sequence<Sequence<DafnyCharUTF16>>
                                                    })]
                                    })
                        })];
            let mut opts: Arc<Options> = Arc::new(Options::Options {
                        name: string_utf16_of("myProg"),
                        help: string_utf16_of("does prog stuff"),
                        params: MyOptions.clone()
                    });
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Parsed>, Sequence<DafnyCharUTF16>>> = _default::GetOptions(&opts, args);
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<bool>());
                return output.read();
            };
            let mut x: Arc<Parsed> = valueOrError0.Extract();
            let mut h: Arc<Option<Sequence<DafnyCharUTF16>>> = _default::NeedsHelp(&opts, &x, &string_utf16_of(""));
            if matches!((&h).as_ref(), Some{ .. }) {
                print!("{}", DafnyPrintWrapper(h.value()));
                output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Sequence<DafnyCharUTF16>>::Success {
                                value: true
                            }));
                return output.read();
            };
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Sequence<DafnyCharUTF16>>::Success {
                            value: true
                        }));
            return output.read();
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(140,3)
        pub fn Filter<_T: DafnyType>(f: &Arc<dyn ::std::ops::Fn(&_T) -> bool + Sync + Send>, xs: &Sequence<_T>) -> Sequence<_T> {
            let mut _accumulator: Sequence<_T> = seq![] as Sequence<_T>;
            let mut _r0 = f.clone();
            let mut _r1 = xs.clone();
            'TAIL_CALL_START: loop {
                let f = _r0;
                let xs = _r1;
                if xs.cardinality() == int!(0) {
                    return _accumulator.concat(&(seq![] as Sequence<_T>));
                } else {
                    _accumulator = _accumulator.concat(&(if (&f)(&xs.get(&int!(0))) {
                                seq![xs.get(&int!(0))]
                            } else {
                                seq![] as Sequence<_T>
                            }));
                    let mut _in0: Arc<dyn ::std::ops::Fn(&_T) -> bool + Sync + Send> = f.clone();
                    let mut _in1: Sequence<_T> = xs.drop(&int!(1));
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(244,3)
        pub fn IsHelp(args: &Arc<Parsed>) -> bool {
            args.params().cardinality() != int!(0) && args.params().get(&int!(0)).name().clone() == _default::HELP_STR()
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(250,3)
        pub fn NeedsHelp(opts: &Arc<Options>, args: &Arc<Parsed>, prefix: &Sequence<DafnyCharUTF16>) -> Arc<Option<Sequence<DafnyCharUTF16>>> {
            let mut _r0 = opts.clone();
            let mut _r1 = args.clone();
            let mut _r2 = prefix.clone();
            'TAIL_CALL_START: loop {
                let opts = _r0;
                let args = _r1;
                let prefix = _r2;
                if _default::IsHelp(&args) {
                    return Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                value: _default::GetHelp(&opts, &prefix)
                            });
                } else {
                    if matches!(args.subcommand().as_ref(), Some{ .. }) {
                        let mut valueOrError0: Arc<Option<nat>> = _default::GetSubOptions(opts.params(), args.subcommand().value().command(), &int!(0));
                        if valueOrError0.IsFailure() {
                            return valueOrError0.PropagateFailure::<Sequence<DafnyCharUTF16>>();
                        } else {
                            let mut pos: nat = valueOrError0.Extract();
                            let mut _in0: Arc<Options> = opts.params().get(&pos).options().clone();
                            let mut _in1: Arc<Parsed> = args.subcommand().value().clone();
                            let mut _in2: Sequence<DafnyCharUTF16> = prefix.concat(args.command()).concat(&string_utf16_of(" "));
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            _r2 = _in2.clone();
                            continue 'TAIL_CALL_START;
                        }
                    } else {
                        return Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {});
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(264,3)
        pub fn GetHelp(opts: &Arc<Options>, prefix: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            let mut newOpts: Sequence<Arc<Param>> = opts.params().concat(&seq![_default::HELP_PARAM()]);
            let mut longLen: nat = _default::GetLongLen(&newOpts, &int!(6));
            let mut commandLen: nat = _default::GetCommandLen(&newOpts, &int!(0));
            if commandLen.clone() == int!(0) {
                string_utf16_of("USAGE : ").concat(prefix).concat(opts.name()).concat(&string_utf16_of(" [args...]\n")).concat(opts.help()).concat(&string_utf16_of("\n")).concat(&_default::GetHelp2(&newOpts, &longLen))
            } else {
                string_utf16_of("USAGE : ").concat(opts.name()).concat(&string_utf16_of(" [args...] command [args...]\n")).concat(opts.help()).concat(&string_utf16_of("\n")).concat(&string_utf16_of("\nAvailable Commands:\n")).concat(&_default::GetCmdHelp(&newOpts, &commandLen)).concat(&string_utf16_of("\nAvailable Options:\n")).concat(&_default::GetHelp2(&newOpts, &longLen))
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(296,3)
        pub fn OptValue(args: &Sequence<Arc<OneArg>>, arg: &Sequence<DafnyCharUTF16>) -> Arc<Option<Sequence<DafnyCharUTF16>>> {
            let mut _r0 = args.clone();
            let mut _r1 = arg.clone();
            'TAIL_CALL_START: loop {
                let args = _r0;
                let arg = _r1;
                if args.cardinality() == int!(0) {
                    return Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {});
                } else {
                    if args.get(&int!(0)).name().clone() == arg.clone() {
                        return args.get(&int!(0)).value().clone();
                    } else {
                        let mut _in0: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in1: Sequence<DafnyCharUTF16> = arg.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(308,3)
        pub fn FlagCount(args: &Sequence<Arc<OneArg>>, arg: &Sequence<DafnyCharUTF16>) -> nat {
            let mut _accumulator: nat = int!(0);
            let mut _r0 = args.clone();
            let mut _r1 = arg.clone();
            'TAIL_CALL_START: loop {
                let args = _r0;
                let arg = _r1;
                if args.cardinality() == int!(0) {
                    return int!(0) + _accumulator.clone();
                } else {
                    if args.get(&int!(0)).name().clone() == arg.clone() {
                        _accumulator = _accumulator.clone() + int!(1);
                        let mut _in0: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in1: Sequence<DafnyCharUTF16> = arg.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    } else {
                        let mut _in2: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in3: Sequence<DafnyCharUTF16> = arg.clone();
                        _r0 = _in2.clone();
                        _r1 = _in3.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(318,3)
        pub fn OptMapLast(args: &Sequence<Arc<OneArg>>, theMap: &Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>) -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> {
            let mut _r0 = args.clone();
            let mut _r1 = theMap.clone();
            'TAIL_CALL_START: loop {
                let args = _r0;
                let theMap = _r1;
                if args.cardinality() == int!(0) {
                    return theMap.clone();
                } else {
                    if matches!(args.get(&int!(0)).value().as_ref(), Some{ .. }) {
                        let mut _in0: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in1: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = theMap.update_index(args.get(&int!(0)).name(), args.get(&int!(0)).value().value());
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    } else {
                        let mut _in2: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in3: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = theMap.clone();
                        _r0 = _in2.clone();
                        _r1 = _in3.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(328,3)
        pub fn FlagsSet(args: &Sequence<Arc<OneArg>>, theSet: &Set<Sequence<DafnyCharUTF16>>) -> Set<Sequence<DafnyCharUTF16>> {
            let mut _r0 = args.clone();
            let mut _r1 = theSet.clone();
            'TAIL_CALL_START: loop {
                let args = _r0;
                let theSet = _r1;
                if args.cardinality() == int!(0) {
                    return theSet.clone();
                } else {
                    if matches!(args.get(&int!(0)).value().as_ref(), Some{ .. }) {
                        let mut _in0: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in1: Set<Sequence<DafnyCharUTF16>> = theSet.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    } else {
                        let mut _in2: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in3: Set<Sequence<DafnyCharUTF16>> = theSet.merge(&set!{args.get(&int!(0)).name().clone()});
                        _r0 = _in2.clone();
                        _r1 = _in3.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(338,3)
        pub fn OptMapList(args: &Sequence<Arc<OneArg>>, theMap: &Map<Sequence<DafnyCharUTF16>, Sequence<Sequence<DafnyCharUTF16>>>) -> Map<Sequence<DafnyCharUTF16>, Sequence<Sequence<DafnyCharUTF16>>> {
            let mut _r0 = args.clone();
            let mut _r1 = theMap.clone();
            'TAIL_CALL_START: loop {
                let args = _r0;
                let theMap = _r1;
                if args.cardinality() == int!(0) {
                    return theMap.clone();
                } else {
                    if matches!(args.get(&int!(0)).value().as_ref(), Some{ .. }) {
                        if theMap.contains(args.get(&int!(0)).name()) {
                            let mut _in0: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                            let mut _in1: Map<Sequence<DafnyCharUTF16>, Sequence<Sequence<DafnyCharUTF16>>> = theMap.update_index(args.get(&int!(0)).name(), &theMap.get(args.get(&int!(0)).name()).concat(&seq![args.get(&int!(0)).value().value().clone()]));
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            continue 'TAIL_CALL_START;
                        } else {
                            let mut _in2: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                            let mut _in3: Map<Sequence<DafnyCharUTF16>, Sequence<Sequence<DafnyCharUTF16>>> = theMap.update_index(args.get(&int!(0)).name(), &seq![args.get(&int!(0)).value().value().clone()]);
                            _r0 = _in2.clone();
                            _r1 = _in3.clone();
                            continue 'TAIL_CALL_START;
                        }
                    } else {
                        let mut _in4: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in5: Map<Sequence<DafnyCharUTF16>, Sequence<Sequence<DafnyCharUTF16>>> = theMap.clone();
                        _r0 = _in4.clone();
                        _r1 = _in5.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(353,3)
        pub fn FlagMapCount(args: &Sequence<Arc<OneArg>>, theMap: &Map<Sequence<DafnyCharUTF16>, nat>) -> Map<Sequence<DafnyCharUTF16>, nat> {
            let mut _r0 = args.clone();
            let mut _r1 = theMap.clone();
            'TAIL_CALL_START: loop {
                let args = _r0;
                let theMap = _r1;
                if args.cardinality() == int!(0) {
                    return theMap.clone();
                } else {
                    if matches!(args.get(&int!(0)).value().as_ref(), Some{ .. }) {
                        let mut _in0: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in1: Map<Sequence<DafnyCharUTF16>, nat> = theMap.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    } else {
                        if theMap.contains(args.get(&int!(0)).name()) {
                            let mut _in2: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                            let mut _in3: Map<Sequence<DafnyCharUTF16>, nat> = theMap.update_index(args.get(&int!(0)).name(), &(theMap.get(args.get(&int!(0)).name()) + int!(1)));
                            _r0 = _in2.clone();
                            _r1 = _in3.clone();
                            continue 'TAIL_CALL_START;
                        } else {
                            let mut _in4: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                            let mut _in5: Map<Sequence<DafnyCharUTF16>, nat> = theMap.update_index(args.get(&int!(0)).name(), &int!(1));
                            _r0 = _in4.clone();
                            _r1 = _in5.clone();
                            continue 'TAIL_CALL_START;
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(368,3)
        pub fn FlagSetCheck(args: &Sequence<Arc<OneArg>>, theSet: &Set<Sequence<DafnyCharUTF16>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Set<Sequence<DafnyCharUTF16>>, Sequence<DafnyCharUTF16>>> {
            let mut _r0 = args.clone();
            let mut _r1 = theSet.clone();
            'TAIL_CALL_START: loop {
                let args = _r0;
                let theSet = _r1;
                if args.cardinality() == int!(0) {
                    return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Set<Sequence<DafnyCharUTF16>>, Sequence<DafnyCharUTF16>>::Success {
                                value: theSet.clone()
                            });
                } else {
                    if matches!(args.get(&int!(0)).value().as_ref(), Some{ .. }) {
                        if theSet.contains(args.get(&int!(0)).name()) {
                            return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Set<Sequence<DafnyCharUTF16>>, Sequence<DafnyCharUTF16>>::Failure {
                                        error: string_utf16_of("Duplicate arg : ").concat(args.get(&int!(0)).name())
                                    });
                        } else {
                            let mut _in0: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                            let mut _in1: Set<Sequence<DafnyCharUTF16>> = theSet.merge(&set!{args.get(&int!(0)).name().clone()});
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            continue 'TAIL_CALL_START;
                        }
                    } else {
                        let mut _in2: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in3: Set<Sequence<DafnyCharUTF16>> = theSet.clone();
                        _r0 = _in2.clone();
                        _r1 = _in3.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(381,3)
        pub fn OptMapCheck(args: &Sequence<Arc<OneArg>>, theMap: &Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Sequence<DafnyCharUTF16>>> {
            let mut _r0 = args.clone();
            let mut _r1 = theMap.clone();
            'TAIL_CALL_START: loop {
                let args = _r0;
                let theMap = _r1;
                if args.cardinality() == int!(0) {
                    return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Sequence<DafnyCharUTF16>>::Success {
                                value: theMap.clone()
                            });
                } else {
                    if matches!(args.get(&int!(0)).value().as_ref(), Some{ .. }) {
                        if theMap.contains(args.get(&int!(0)).name()) {
                            return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, Sequence<DafnyCharUTF16>>::Failure {
                                        error: string_utf16_of("Duplicate arg : ").concat(args.get(&int!(0)).name())
                                    });
                        } else {
                            let mut _in0: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                            let mut _in1: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = theMap.update_index(args.get(&int!(0)).name(), args.get(&int!(0)).value().value());
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            continue 'TAIL_CALL_START;
                        }
                    } else {
                        let mut _in2: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in3: Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = theMap.clone();
                        _r0 = _in2.clone();
                        _r1 = _in3.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(396,3)
        pub fn GetHelpHelp(opt: &Arc<Param>) -> Sequence<DafnyCharUTF16> {
            if matches!(opt.as_ref(), Command{ .. }) {
                string_utf16_of("")
            } else {
                if matches!(opt.as_ref(), Flag{ .. }) {
                    opt.help().clone()
                } else {
                    opt.help().concat(&(if opt.Required() {
                            string_utf16_of(" (required)")
                        } else {
                            if opt.HasDefault() {
                                string_utf16_of(" (default : ").concat(opt.unused().val()).concat(&string_utf16_of(")"))
                            } else {
                                string_utf16_of("")
                            }
                        }))
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(412,3)
        pub fn OneHelp(opt: &Arc<Param>, longLen: &nat) -> Sequence<DafnyCharUTF16> {
            if matches!(opt.as_ref(), Command{ .. }) || !opt.ShowHelp() {
                string_utf16_of("")
            } else {
                _default::GetShortHelp(opt).concat(&string_utf16_of("  ")).concat(&_default::GetLongHelp(opt, longLen)).concat(&string_utf16_of("  ")).concat(&_default::GetHelpHelp(opt)).concat(&string_utf16_of("\n"))
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(420,3)
        pub fn GetCommandHelp(opt: &Arc<Param>, commandLen: &nat) -> Sequence<DafnyCharUTF16> {
            let mut name: Sequence<DafnyCharUTF16> = if opt.options().name().cardinality() < commandLen.clone() {
                    opt.options().name().concat(&({
                            let _initializer = {
                                    Arc::new(move |i: &DafnyInt| -> DafnyCharUTF16{
                                            DafnyCharUTF16(32 as u16)
                                        })
                                };
                            integer_range(Zero::zero(), commandLen.clone() - opt.options().name().cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                        }))
                } else {
                    opt.options().name().clone()
                };
            name.concat(&string_utf16_of("  ")).concat(opt.options().help()).concat(&string_utf16_of("\n"))
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(431,3)
        pub fn GetShortHelp(opt: &Arc<Param>) -> Sequence<DafnyCharUTF16> {
            if matches!(opt.as_ref(), Opt{ .. }) || matches!(opt.as_ref(), Flag{ .. }) {
                if opt.short().clone() != _default::NullChar() {
                    string_utf16_of("-").concat(&seq![opt.short().clone()])
                } else {
                    string_utf16_of("  ")
                }
            } else {
                string_utf16_of("")
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(442,3)
        pub fn GetLongHelp(opt: &Arc<Param>, longLen: &nat) -> Sequence<DafnyCharUTF16> {
            if matches!(opt.as_ref(), Opt{ .. }) || matches!(opt.as_ref(), Flag{ .. }) {
                let mut tmp: Sequence<DafnyCharUTF16> = string_utf16_of("--").concat(opt.name()).concat(&(if matches!(opt.as_ref(), Opt{ .. }) {
                            string_utf16_of("=").concat(opt.argName())
                        } else {
                            string_utf16_of("")
                        }));
                if tmp.cardinality() < longLen.clone() {
                    tmp.concat(&({
                            let _initializer = {
                                    Arc::new(move |i: &DafnyInt| -> DafnyCharUTF16{
                                            DafnyCharUTF16(32 as u16)
                                        })
                                };
                            integer_range(Zero::zero(), longLen.clone() - tmp.cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                        }))
                } else {
                    tmp.clone()
                }
            } else {
                string_utf16_of("")
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(459,3)
        pub fn GetHelp2(opts: &Sequence<Arc<Param>>, longLen: &nat) -> Sequence<DafnyCharUTF16> {
            let mut _accumulator: Sequence<DafnyCharUTF16> = seq![] as Sequence<DafnyCharUTF16>;
            let mut _r0 = opts.clone();
            let mut _r1 = longLen.clone();
            'TAIL_CALL_START: loop {
                let opts = _r0;
                let longLen = _r1;
                if opts.cardinality() == int!(0) {
                    return _accumulator.concat(&string_utf16_of(""));
                } else {
                    let mut x: Sequence<DafnyCharUTF16> = _default::OneHelp(&opts.get(&int!(0)), &longLen);
                    _accumulator = _accumulator.concat(&x);
                    let mut _in0: Sequence<Arc<Param>> = opts.drop(&int!(1));
                    let mut _in1: nat = longLen.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(468,3)
        pub fn GetCmdHelp(opts: &Sequence<Arc<Param>>, commandLen: &nat) -> Sequence<DafnyCharUTF16> {
            let mut _accumulator: Sequence<DafnyCharUTF16> = seq![] as Sequence<DafnyCharUTF16>;
            let mut _r0 = opts.clone();
            let mut _r1 = commandLen.clone();
            'TAIL_CALL_START: loop {
                let opts = _r0;
                let commandLen = _r1;
                if opts.cardinality() == int!(0) {
                    return _accumulator.concat(&string_utf16_of(""));
                } else {
                    let mut x: Sequence<DafnyCharUTF16> = if matches!((&opts.get(&int!(0))).as_ref(), Command{ .. }) {
                            _default::GetCommandHelp(&opts.get(&int!(0)), &commandLen)
                        } else {
                            string_utf16_of("")
                        };
                    _accumulator = _accumulator.concat(&x);
                    let mut _in0: Sequence<Arc<Param>> = opts.drop(&int!(1));
                    let mut _in1: nat = commandLen.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(481,3)
        pub fn GetLongLen(opts: &Sequence<Arc<Param>>, max: &nat) -> nat {
            let mut _r0 = opts.clone();
            let mut _r1 = max.clone();
            'TAIL_CALL_START: loop {
                let opts = _r0;
                let max = _r1;
                if opts.cardinality() == int!(0) {
                    return max.clone();
                } else {
                    let mut x: DafnyInt = _default::GetLongHelp(&opts.get(&int!(0)), &int!(0)).cardinality();
                    let mut newMax: DafnyInt = if max.clone() < x.clone() {
                            x.clone()
                        } else {
                            max.clone()
                        };
                    let mut _in0: Sequence<Arc<Param>> = opts.drop(&int!(1));
                    let mut _in1: DafnyInt = newMax.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(491,3)
        pub fn GetCommandLen(opts: &Sequence<Arc<Param>>, max: &nat) -> nat {
            let mut _r0 = opts.clone();
            let mut _r1 = max.clone();
            'TAIL_CALL_START: loop {
                let opts = _r0;
                let max = _r1;
                if opts.cardinality() == int!(0) {
                    return max.clone();
                } else {
                    let mut x: DafnyInt = if matches!((&opts.get(&int!(0))).as_ref(), Command{ .. }) {
                            opts.get(&int!(0)).options().name().cardinality()
                        } else {
                            int!(0)
                        };
                    let mut newMax: DafnyInt = if max.clone() < x.clone() {
                            x.clone()
                        } else {
                            max.clone()
                        };
                    let mut _in0: Sequence<Arc<Param>> = opts.drop(&int!(1));
                    let mut _in1: DafnyInt = newMax.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(501,3)
        pub fn AddShortAlias(aliases: &Sequence<DafnyCharUTF16>, shortMap: &Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, name: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, Sequence<DafnyCharUTF16>>> {
            let mut _r0 = aliases.clone();
            let mut _r1 = shortMap.clone();
            let mut _r2 = name.clone();
            'TAIL_CALL_START: loop {
                let aliases = _r0;
                let shortMap = _r1;
                let name = _r2;
                if aliases.cardinality() == int!(0) {
                    return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, Sequence<DafnyCharUTF16>>::Success {
                                value: shortMap.clone()
                            });
                } else {
                    if shortMap.contains(&aliases.get(&int!(0))) {
                        return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, Sequence<DafnyCharUTF16>>::Failure {
                                    error: string_utf16_of("Short alias '").concat(&aliases.slice(&int!(0), &int!(1))).concat(&string_utf16_of("' for '")).concat(&name).concat(&string_utf16_of("' already in use as a short option."))
                                });
                    } else {
                        let mut _in0: Sequence<DafnyCharUTF16> = aliases.drop(&int!(1));
                        let mut _in1: Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>> = shortMap.update_index(&aliases.get(&int!(0)), &name);
                        let mut _in2: Sequence<DafnyCharUTF16> = name.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        _r2 = _in2.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(529,3)
        pub fn AddLongAlias(aliases: &Sequence<Sequence<DafnyCharUTF16>>, longMap: &Map<Sequence<DafnyCharUTF16>, Arc<Param>>, opt: &Arc<Param>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Sequence<DafnyCharUTF16>>> {
            let mut _r0 = aliases.clone();
            let mut _r1 = longMap.clone();
            let mut _r2 = opt.clone();
            'TAIL_CALL_START: loop {
                let aliases = _r0;
                let longMap = _r1;
                let opt = _r2;
                if aliases.cardinality() == int!(0) {
                    return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Sequence<DafnyCharUTF16>>::Success {
                                value: longMap.clone()
                            });
                } else {
                    if longMap.contains(&aliases.get(&int!(0))) {
                        return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Sequence<DafnyCharUTF16>>::Failure {
                                    error: string_utf16_of("Long alias '").concat(&aliases.get(&int!(0))).concat(&string_utf16_of("' already in use as a long option."))
                                });
                    } else {
                        let mut _in0: Sequence<Sequence<DafnyCharUTF16>> = aliases.drop(&int!(1));
                        let mut _in1: Map<Sequence<DafnyCharUTF16>, Arc<Param>> = longMap.update_index(&aliases.get(&int!(0)), &opt);
                        let mut _in2: Arc<Param> = opt.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        _r2 = _in2.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(546,3)
        pub fn GetMaps(opts: &Sequence<Arc<Param>>, longMap: &Map<Sequence<DafnyCharUTF16>, Arc<Param>>, shortMap: &Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, commandMap: &CommandMap) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap), Sequence<DafnyCharUTF16>>> {
            let mut _r0 = opts.clone();
            let mut _r1 = longMap.clone();
            let mut _r2 = shortMap.clone();
            let mut _r3 = commandMap.clone();
            'TAIL_CALL_START: loop {
                let opts = _r0;
                let longMap = _r1;
                let shortMap = _r2;
                let commandMap = _r3;
                if opts.cardinality() == int!(0) {
                    return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap), Sequence<DafnyCharUTF16>>::Success {
                                value: (
                                        longMap.clone(),
                                        shortMap.clone(),
                                        commandMap.clone()
                                    )
                            });
                } else {
                    let mut opt: Arc<Param> = opts.get(&int!(0));
                    if matches!((&opt).as_ref(), Command{ .. }) {
                        let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(!commandMap.contains(opt.options().name()), &string_utf16_of("Duplicate command in options : ").concat(opt.options().name()));
                        if valueOrError0.IsFailure() {
                            return valueOrError0.PropagateFailure::<(Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap)>();
                        } else {
                            let mut _in0: Sequence<Arc<Param>> = opts.drop(&int!(1));
                            let mut _in1: Map<Sequence<DafnyCharUTF16>, Arc<Param>> = longMap.clone();
                            let mut _in2: Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>> = shortMap.clone();
                            let mut _in3: Map<Sequence<DafnyCharUTF16>, Arc<Options>> = commandMap.update_index(opt.options().name(), opt.options());
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            _r2 = _in2.clone();
                            _r3 = _in3.clone();
                            continue 'TAIL_CALL_START;
                        }
                    } else {
                        let mut valueOrError1: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(!longMap.contains(opt.name()), &string_utf16_of("Duplicate long name in options : ").concat(opt.name()));
                        if valueOrError1.IsFailure() {
                            return valueOrError1.PropagateFailure::<(Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap)>();
                        } else {
                            let mut newLongMap: Map<Sequence<DafnyCharUTF16>, Arc<Param>> = longMap.update_index(opt.name(), &opt);
                            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, Sequence<DafnyCharUTF16>>> = _default::AddShortAlias(&opt.ShortAlias(), &shortMap, opt.name());
                            if valueOrError2.IsFailure() {
                                return valueOrError2.PropagateFailure::<(Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap)>();
                            } else {
                                let mut newShortMap: Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>> = valueOrError2.Extract();
                                let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Sequence<DafnyCharUTF16>>> = _default::AddLongAlias(&opt.LongAlias(), &newLongMap, &opt);
                                if valueOrError3.IsFailure() {
                                    return valueOrError3.PropagateFailure::<(Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap)>();
                                } else {
                                    let mut newLongMap: Map<Sequence<DafnyCharUTF16>, Arc<Param>> = valueOrError3.Extract();
                                    if opt.short().clone() != _default::NullChar() {
                                        let mut short: DafnyCharUTF16 = opt.short().clone();
                                        if newShortMap.contains(&short) {
                                            return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap), Sequence<DafnyCharUTF16>>::Failure {
                                                        error: string_utf16_of("Duplicate short char in options : '").concat(&seq![short.clone()]).concat(&string_utf16_of("' for ")).concat(opt.name()).concat(&string_utf16_of(" and ")).concat(&newShortMap.get(&short))
                                                    });
                                        } else {
                                            let mut _in4: Sequence<Arc<Param>> = opts.drop(&int!(1));
                                            let mut _in5: Map<Sequence<DafnyCharUTF16>, Arc<Param>> = newLongMap.update_index(opt.name(), &opt);
                                            let mut _in6: Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>> = newShortMap.update_index(&short, opt.name());
                                            let mut _in7: CommandMap = commandMap.clone();
                                            _r0 = _in4.clone();
                                            _r1 = _in5.clone();
                                            _r2 = _in6.clone();
                                            _r3 = _in7.clone();
                                            continue 'TAIL_CALL_START;
                                        }
                                    } else {
                                        let mut _in8: Sequence<Arc<Param>> = opts.drop(&int!(1));
                                        let mut _in9: Map<Sequence<DafnyCharUTF16>, Arc<Param>> = newLongMap.update_index(opt.name(), &opt);
                                        let mut _in10: Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>> = newShortMap.clone();
                                        let mut _in11: CommandMap = commandMap.clone();
                                        _r0 = _in8.clone();
                                        _r1 = _in9.clone();
                                        _r2 = _in10.clone();
                                        _r3 = _in11.clone();
                                        continue 'TAIL_CALL_START;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(577,3)
        pub fn Print<_T: DafnyType>(x: &_T) -> Arc<Outcome<Sequence<DafnyCharUTF16>>> {
            let mut _hresult: Arc<Outcome<Sequence<DafnyCharUTF16>>>;
            print!("{}", DafnyPrintWrapper(x));
            print!("{}", DafnyPrintWrapper(&string_utf16_of("\n")));
            _hresult = Arc::new(Outcome::<Sequence<DafnyCharUTF16>>::Pass {});
            return _hresult.clone();
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(584,3)
        pub fn ArgExists(args: &Sequence<Arc<OneArg>>, name: &Sequence<DafnyCharUTF16>) -> bool {
            let mut _r0 = args.clone();
            let mut _r1 = name.clone();
            'TAIL_CALL_START: loop {
                let args = _r0;
                let name = _r1;
                if args.cardinality() == int!(0) {
                    return false;
                } else {
                    if args.get(&int!(0)).name().clone() == name.clone() {
                        return true;
                    } else {
                        let mut _in0: Sequence<Arc<OneArg>> = args.drop(&int!(1));
                        let mut _in1: Sequence<DafnyCharUTF16> = name.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(594,3)
        pub fn PostProcess2(opts: &Sequence<Arc<Param>>, args: &Sequence<Arc<OneArg>>, newArgs: &Sequence<Arc<OneArg>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Arc<OneArg>>, Sequence<DafnyCharUTF16>>> {
            let mut _r0 = opts.clone();
            let mut _r1 = args.clone();
            let mut _r2 = newArgs.clone();
            'TAIL_CALL_START: loop {
                let opts = _r0;
                let args = _r1;
                let newArgs = _r2;
                if opts.cardinality() == int!(0) {
                    return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<Arc<OneArg>>, Sequence<DafnyCharUTF16>>::Success {
                                value: newArgs.clone()
                            });
                } else {
                    if matches!((&opts.get(&int!(0))).as_ref(), Opt{ .. }) && opts.get(&int!(0)).Required() && !_default::ArgExists(&args, opts.get(&int!(0)).name()) {
                        return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<Arc<OneArg>>, Sequence<DafnyCharUTF16>>::Failure {
                                    error: string_utf16_of("Option '").concat(opts.get(&int!(0)).name()).concat(&string_utf16_of("' is required, but was not used."))
                                });
                    } else {
                        if matches!((&opts.get(&int!(0))).as_ref(), Opt{ .. }) && opts.get(&int!(0)).HasDefault() && !_default::ArgExists(&args, opts.get(&int!(0)).name()) {
                            let mut _in0: Sequence<Arc<Param>> = opts.drop(&int!(1));
                            let mut _in1: Sequence<Arc<OneArg>> = args.clone();
                            let mut _in2: Sequence<Arc<OneArg>> = newArgs.concat(&seq![Arc::new(OneArg::OneArg {
                                                name: opts.get(&int!(0)).name().clone(),
                                                value: Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                                            value: opts.get(&int!(0)).unused().val().clone()
                                                        })
                                            })]);
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            _r2 = _in2.clone();
                            continue 'TAIL_CALL_START;
                        } else {
                            let mut _in3: Sequence<Arc<Param>> = opts.drop(&int!(1));
                            let mut _in4: Sequence<Arc<OneArg>> = args.clone();
                            let mut _in5: Sequence<Arc<OneArg>> = newArgs.clone();
                            _r0 = _in3.clone();
                            _r1 = _in4.clone();
                            _r2 = _in5.clone();
                            continue 'TAIL_CALL_START;
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(607,3)
        pub fn GetSubOptions(opts: &Sequence<Arc<Param>>, name: &Sequence<DafnyCharUTF16>, pos: &nat) -> Arc<Option<nat>> {
            let mut _r0 = opts.clone();
            let mut _r1 = name.clone();
            let mut _r2 = pos.clone();
            'TAIL_CALL_START: loop {
                let opts = _r0;
                let name = _r1;
                let pos = _r2;
                if opts.cardinality() == pos.clone() {
                    return Arc::new(Option::<nat>::None {});
                } else {
                    if matches!((&opts.get(&pos)).as_ref(), Command{ .. }) && opts.get(&pos).options().name().clone() == name.clone() {
                        return Arc::new(Option::<nat>::Some {
                                    value: pos.clone()
                                });
                    } else {
                        let mut _in0: Sequence<Arc<Param>> = opts.clone();
                        let mut _in1: Sequence<DafnyCharUTF16> = name.clone();
                        let mut _in2: DafnyInt = pos.clone() + int!(1);
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        _r2 = _in2.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(620,3)
        pub fn PostProcess(opts: &Arc<Options>, args: &Arc<Parsed>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Parsed>, Sequence<DafnyCharUTF16>>> {
            if _default::IsHelp(args) {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Success {
                        value: args.clone()
                    })
            } else {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<Arc<OneArg>>, Sequence<DafnyCharUTF16>>> = _default::PostProcess2(opts.params(), args.params(), &(seq![] as Sequence<Arc<OneArg>>));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<Parsed>>()
                } else {
                    let mut newParams: Sequence<Arc<OneArg>> = valueOrError0.Extract();
                    if matches!(args.subcommand().as_ref(), Some{ .. }) {
                        let mut optPos: Arc<Option<nat>> = _default::GetSubOptions(opts.params(), args.subcommand().value().command(), &int!(0));
                        if matches!((&optPos).as_ref(), Some{ .. }) {
                            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Parsed>, Sequence<DafnyCharUTF16>>> = _default::PostProcess(opts.params().get(optPos.value()).options(), args.subcommand().value());
                            if valueOrError1.IsFailure() {
                                valueOrError1.PropagateFailure::<Arc<Parsed>>()
                            } else {
                                let mut sub: Arc<Parsed> = valueOrError1.Extract();
                                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Success {
                                        value: {
                                                let __pat_let7_0: Arc<Parsed> = args.clone();
                                                {
                                                    let _dt__update__tmp_h0: Arc<Parsed> = __pat_let7_0.clone();
                                                    {
                                                        let __pat_let8_0: Arc<Option<Arc<Parsed>>> = Arc::new(Option::<Arc<Parsed>>::Some {
                                                                    value: sub.clone()
                                                                });
                                                        {
                                                            let _dt__update_hsubcommand_h0: Arc<Option<Arc<Parsed>>> = __pat_let8_0.clone();
                                                            {
                                                                let __pat_let9_0: Sequence<Arc<OneArg>> = args.params().concat(&newParams);
                                                                {
                                                                    let _dt__update_hparams_h0: Sequence<Arc<OneArg>> = __pat_let9_0.clone();
                                                                    Arc::new(Parsed::Parsed {
                                                                            command: _dt__update__tmp_h0.command().clone(),
                                                                            params: _dt__update_hparams_h0.clone(),
                                                                            files: _dt__update__tmp_h0.files().clone(),
                                                                            subcommand: _dt__update_hsubcommand_h0.clone()
                                                                        })
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                    })
                            }
                        } else {
                            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Failure {
                                    error: string_utf16_of("Internal error in GetOpt::PostProcess")
                                })
                        }
                    } else {
                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Success {
                                value: {
                                        let __pat_let10_0: Arc<Parsed> = args.clone();
                                        {
                                            let _dt__update__tmp_h1: Arc<Parsed> = __pat_let10_0.clone();
                                            {
                                                let __pat_let11_0: Sequence<Arc<OneArg>> = args.params().concat(&newParams);
                                                {
                                                    let _dt__update_hparams_h1: Sequence<Arc<OneArg>> = __pat_let11_0.clone();
                                                    Arc::new(Parsed::Parsed {
                                                            command: _dt__update__tmp_h1.command().clone(),
                                                            params: _dt__update_hparams_h1.clone(),
                                                            files: _dt__update__tmp_h1.files().clone(),
                                                            subcommand: _dt__update__tmp_h1.subcommand().clone()
                                                        })
                                                }
                                            }
                                        }
                                    }
                            })
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(637,3)
        pub fn AllDigits(s: &Sequence<DafnyCharUTF16>) -> bool {
            let mut _r0 = s.clone();
            'TAIL_CALL_START: loop {
                let s = _r0;
                if s.cardinality() == int!(0) {
                    return true;
                } else {
                    if DafnyCharUTF16(48 as u16) <= s.get(&int!(0)) && s.get(&int!(0)) <= DafnyCharUTF16(57 as u16) {
                        let mut _in0: Sequence<DafnyCharUTF16> = s.drop(&int!(1));
                        _r0 = _in0.clone();
                        continue 'TAIL_CALL_START;
                    } else {
                        return false;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(646,3)
        pub fn ValidPositional(s: &Sequence<DafnyCharUTF16>) -> bool {
            if s.cardinality() == int!(0) {
                true
            } else {
                if s.get(&int!(0)) != DafnyCharUTF16(45 as u16) {
                    true
                } else {
                    _default::AllDigits(&s.drop(&int!(1)))
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(656,3)
        pub fn TestPositionals(opts: &Sequence<Arc<Param>>, optional: &Arc<Option<Sequence<DafnyCharUTF16>>>) -> Arc<Outcome<Sequence<DafnyCharUTF16>>> {
            let mut _r0 = opts.clone();
            let mut _r1 = optional.clone();
            'TAIL_CALL_START: loop {
                let opts = _r0;
                let optional = _r1;
                if opts.cardinality() == int!(0) {
                    return Arc::new(Outcome::<Sequence<DafnyCharUTF16>>::Pass {});
                } else {
                    if !matches!((&opts.get(&int!(0))).as_ref(), Opt{ .. }) {
                        let mut _in0: Sequence<Arc<Param>> = opts.drop(&int!(1));
                        let mut _in1: Arc<Option<Sequence<DafnyCharUTF16>>> = optional.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    } else {
                        if opts.get(&int!(0)).positional().clone() == Arc::new(Tri::No {}) {
                            let mut _in2: Sequence<Arc<Param>> = opts.drop(&int!(1));
                            let mut _in3: Arc<Option<Sequence<DafnyCharUTF16>>> = optional.clone();
                            _r0 = _in2.clone();
                            _r1 = _in3.clone();
                            continue 'TAIL_CALL_START;
                        } else {
                            if opts.get(&int!(0)).positional().clone() == Arc::new(Tri::Maybe {}) {
                                let mut _in4: Sequence<Arc<Param>> = opts.drop(&int!(1));
                                let mut _in5: Arc<Option<Sequence<DafnyCharUTF16>>> = Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                            value: opts.get(&int!(0)).name().clone()
                                        });
                                _r0 = _in4.clone();
                                _r1 = _in5.clone();
                                continue 'TAIL_CALL_START;
                            } else {
                                if matches!((&optional).as_ref(), None{ .. }) {
                                    let mut _in6: Sequence<Arc<Param>> = opts.drop(&int!(1));
                                    let mut _in7: Arc<Option<Sequence<DafnyCharUTF16>>> = optional.clone();
                                    _r0 = _in6.clone();
                                    _r1 = _in7.clone();
                                    continue 'TAIL_CALL_START;
                                } else {
                                    return Arc::new(Outcome::<Sequence<DafnyCharUTF16>>::Fail {
                                                error: string_utf16_of("Required positional argument '").concat(opts.get(&int!(0)).name()).concat(&string_utf16_of("' follows optional positional argument '")).concat(optional.value()).concat(&string_utf16_of("'."))
                                            });
                                }
                            }
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(672,3)
        pub fn GetPositionals(opts: &Sequence<Arc<Param>>, args: &Sequence<Sequence<DafnyCharUTF16>>, params: &Sequence<Arc<OneArg>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Sequence<Sequence<DafnyCharUTF16>>, Sequence<Arc<OneArg>>), Sequence<DafnyCharUTF16>>> {
            let mut _r0 = opts.clone();
            let mut _r1 = args.clone();
            let mut _r2 = params.clone();
            'TAIL_CALL_START: loop {
                let opts = _r0;
                let args = _r1;
                let params = _r2;
                if opts.cardinality() == int!(0) {
                    return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Sequence<Sequence<DafnyCharUTF16>>, Sequence<Arc<OneArg>>), Sequence<DafnyCharUTF16>>::Success {
                                value: (
                                        args.clone(),
                                        params.clone()
                                    )
                            });
                } else {
                    if !matches!((&opts.get(&int!(0))).as_ref(), Opt{ .. }) {
                        let mut _in0: Sequence<Arc<Param>> = opts.drop(&int!(1));
                        let mut _in1: Sequence<Sequence<DafnyCharUTF16>> = args.clone();
                        let mut _in2: Sequence<Arc<OneArg>> = params.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        _r2 = _in2.clone();
                        continue 'TAIL_CALL_START;
                    } else {
                        if opts.get(&int!(0)).positional().clone() == Arc::new(Tri::No {}) {
                            let mut _in3: Sequence<Arc<Param>> = opts.drop(&int!(1));
                            let mut _in4: Sequence<Sequence<DafnyCharUTF16>> = args.clone();
                            let mut _in5: Sequence<Arc<OneArg>> = params.clone();
                            _r0 = _in3.clone();
                            _r1 = _in4.clone();
                            _r2 = _in5.clone();
                            continue 'TAIL_CALL_START;
                        } else {
                            if opts.get(&int!(0)).positional().clone() == Arc::new(Tri::Yes {}) {
                                if args.cardinality() == int!(0) {
                                    return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Sequence<Sequence<DafnyCharUTF16>>, Sequence<Arc<OneArg>>), Sequence<DafnyCharUTF16>>::Failure {
                                                error: string_utf16_of("Positional arg '").concat(opts.get(&int!(0)).name()).concat(&string_utf16_of("' is required, but we've run out of arguments."))
                                            });
                                } else {
                                    if _default::ValidPositional(&args.get(&int!(0))) {
                                        let mut _in6: Sequence<Arc<Param>> = opts.drop(&int!(1));
                                        let mut _in7: Sequence<Sequence<DafnyCharUTF16>> = args.drop(&int!(1));
                                        let mut _in8: Sequence<Arc<OneArg>> = params.concat(&seq![Arc::new(OneArg::OneArg {
                                                            name: opts.get(&int!(0)).name().clone(),
                                                            value: Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                                                        value: args.get(&int!(0))
                                                                    })
                                                        })]);
                                        _r0 = _in6.clone();
                                        _r1 = _in7.clone();
                                        _r2 = _in8.clone();
                                        continue 'TAIL_CALL_START;
                                    } else {
                                        return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Sequence<Sequence<DafnyCharUTF16>>, Sequence<Arc<OneArg>>), Sequence<DafnyCharUTF16>>::Failure {
                                                    error: string_utf16_of("Positional arg ").concat(opts.get(&int!(0)).name()).concat(&string_utf16_of(" matched with invalid positional value '")).concat(&args.get(&int!(0))).concat(&string_utf16_of("'."))
                                                });
                                    }
                                }
                            } else {
                                if args.cardinality() == int!(0) {
                                    return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Sequence<Sequence<DafnyCharUTF16>>, Sequence<Arc<OneArg>>), Sequence<DafnyCharUTF16>>::Success {
                                                value: (
                                                        args.clone(),
                                                        params.clone()
                                                    )
                                            });
                                } else {
                                    if _default::ValidPositional(&args.get(&int!(0))) {
                                        let mut _in9: Sequence<Arc<Param>> = opts.drop(&int!(1));
                                        let mut _in10: Sequence<Sequence<DafnyCharUTF16>> = args.drop(&int!(1));
                                        let mut _in11: Sequence<Arc<OneArg>> = params.concat(&seq![Arc::new(OneArg::OneArg {
                                                            name: opts.get(&int!(0)).name().clone(),
                                                            value: Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                                                        value: args.get(&int!(0))
                                                                    })
                                                        })]);
                                        _r0 = _in9.clone();
                                        _r1 = _in10.clone();
                                        _r2 = _in11.clone();
                                        continue 'TAIL_CALL_START;
                                    } else {
                                        return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Sequence<Sequence<DafnyCharUTF16>>, Sequence<Arc<OneArg>>), Sequence<DafnyCharUTF16>>::Success {
                                                    value: (
                                                            args.clone(),
                                                            params.clone()
                                                        )
                                                });
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(699,3)
        pub fn GetOptions(opts: &Arc<Options>, args: &Sequence<Sequence<DafnyCharUTF16>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Parsed>, Sequence<DafnyCharUTF16>>> {
            let mut newOpts: Sequence<Arc<Param>> = opts.params().concat(&seq![_default::HELP_PARAM()]);
            let mut inherits: Sequence<Arc<Param>> = _default::Filter::<Arc<Param>>(&({
                        Arc::new(move |o: &Arc<Param>| -> bool{
                                o.Inherits()
                            })
                    }), &newOpts);
            let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = _default::TestPositionals(&newOpts, &Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {}));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<Parsed>>()
            } else {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Sequence<Sequence<DafnyCharUTF16>>, Sequence<Arc<OneArg>>), Sequence<DafnyCharUTF16>>> = _default::GetPositionals(&newOpts, &args.drop(&int!(1)), &(seq![] as Sequence<Arc<OneArg>>));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<Parsed>>()
                } else {
                    let mut __let_tmp_rhs0: (Sequence<Sequence<DafnyCharUTF16>>, Sequence<Arc<OneArg>>) = valueOrError1.Extract();
                    let mut newArgs: Sequence<Sequence<DafnyCharUTF16>> = __let_tmp_rhs0.0.clone();
                    let mut params: Sequence<Arc<OneArg>> = __let_tmp_rhs0.1.clone();
                    let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap), Sequence<DafnyCharUTF16>>> = _default::GetMaps(&newOpts, &map![], &map![], &map![]);
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<Parsed>>()
                    } else {
                        let mut __let_tmp_rhs1: (Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap) = valueOrError2.Extract();
                        let mut longMap: Map<Sequence<DafnyCharUTF16>, Arc<Param>> = __let_tmp_rhs1.0.clone();
                        let mut shortMap: Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>> = __let_tmp_rhs1.1.clone();
                        let mut commandMap: CommandMap = __let_tmp_rhs1.2.clone();
                        let mut context: Arc<Context> = Arc::new(Context::Context {
                                    longMap: longMap.clone(),
                                    shortMap: shortMap.clone(),
                                    inherits: inherits.clone(),
                                    commands: commandMap.clone(),
                                    command: args.get(&int!(0))
                                });
                        let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Parsed>, Sequence<DafnyCharUTF16>>> = _default::GetOptions2(&newArgs, &context, &params, &(seq![] as Sequence<Sequence<DafnyCharUTF16>>));
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<Parsed>>()
                        } else {
                            let mut result: Arc<Parsed> = valueOrError3.Extract();
                            _default::PostProcess(opts, &result)
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(723,3)
        pub fn IndexOf<_T: DafnyTypeEq>(xs: &Sequence<_T>, v: &_T) -> nat {
            let mut _accumulator: nat = int!(0);
            let mut _r0 = xs.clone();
            let mut _r1 = v.clone();
            'TAIL_CALL_START: loop {
                let xs = _r0;
                let v = _r1;
                if xs.get(&int!(0)) == v.clone() {
                    return int!(0) + _accumulator.clone();
                } else {
                    _accumulator = _accumulator.clone() + int!(1);
                    let mut _in0: Sequence<_T> = xs.drop(&int!(1));
                    let mut _in1: _T = v.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(732,3)
        pub fn SplitOnce<_T: DafnyTypeEq>(s: &Sequence<_T>, delim: &_T) -> (Sequence<_T>, Sequence<_T>) {
            let mut i: nat = _default::IndexOf::<_T>(s, delim);
            (
                s.take(&i),
                s.drop(&(i.clone() + int!(1)))
            )
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(741,3)
        pub fn GetOptions2(args: &Sequence<Sequence<DafnyCharUTF16>>, context: &Arc<Context>, parms: &Sequence<Arc<OneArg>>, files: &Sequence<Sequence<DafnyCharUTF16>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Parsed>, Sequence<DafnyCharUTF16>>> {
            if args.cardinality() == int!(0) {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Success {
                        value: Arc::new(Parsed::Parsed {
                                    command: context.command().clone(),
                                    params: parms.clone(),
                                    files: files.clone(),
                                    subcommand: Arc::new(Option::<Arc<Parsed>>::None {})
                                })
                    })
            } else {
                if context.commands().contains(&args.get(&int!(0))) {
                    let mut inherits: Sequence<Arc<Param>> = _default::Filter::<Arc<Param>>(&({
                                Arc::new(move |o: &Arc<Param>| -> bool{
                                        o.Inherits()
                                    })
                            }), context.commands().get(&args.get(&int!(0))).params());
                    let mut newOpts: Sequence<Arc<Param>> = context.commands().get(&args.get(&int!(0))).params().concat(context.inherits());
                    let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = _default::TestPositionals(&newOpts, &Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {}));
                    if valueOrError0.IsFailure() {
                        valueOrError0.PropagateFailure::<Arc<Parsed>>()
                    } else {
                        let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Sequence<Sequence<DafnyCharUTF16>>, Sequence<Arc<OneArg>>), Sequence<DafnyCharUTF16>>> = _default::GetPositionals(&newOpts, &args.drop(&int!(1)), &(seq![] as Sequence<Arc<OneArg>>));
                        if valueOrError1.IsFailure() {
                            valueOrError1.PropagateFailure::<Arc<Parsed>>()
                        } else {
                            let mut __let_tmp_rhs0: (Sequence<Sequence<DafnyCharUTF16>>, Sequence<Arc<OneArg>>) = valueOrError1.Extract();
                            let mut newArgs: Sequence<Sequence<DafnyCharUTF16>> = __let_tmp_rhs0.0.clone();
                            let mut params: Sequence<Arc<OneArg>> = __let_tmp_rhs0.1.clone();
                            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap), Sequence<DafnyCharUTF16>>> = _default::GetMaps(&newOpts, &map![], &map![], &map![]);
                            if valueOrError2.IsFailure() {
                                valueOrError2.PropagateFailure::<Arc<Parsed>>()
                            } else {
                                let mut __let_tmp_rhs1: (Map<Sequence<DafnyCharUTF16>, Arc<Param>>, Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, CommandMap) = valueOrError2.Extract();
                                let mut longMap: Map<Sequence<DafnyCharUTF16>, Arc<Param>> = __let_tmp_rhs1.0.clone();
                                let mut shortMap: Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>> = __let_tmp_rhs1.1.clone();
                                let mut commandSet: CommandMap = __let_tmp_rhs1.2.clone();
                                let mut newContext: Arc<Context> = Arc::new(Context::Context {
                                            longMap: longMap.clone(),
                                            shortMap: shortMap.clone(),
                                            inherits: context.inherits().concat(&inherits),
                                            commands: commandSet.clone(),
                                            command: args.get(&int!(0))
                                        });
                                let mut lostArgs: DafnyInt = args.cardinality() - newArgs.cardinality();
                                let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Parsed>, Sequence<DafnyCharUTF16>>> = _default::GetOptions2(&args.drop(&lostArgs), &newContext, &params, &(seq![] as Sequence<Sequence<DafnyCharUTF16>>));
                                if valueOrError3.IsFailure() {
                                    valueOrError3.PropagateFailure::<Arc<Parsed>>()
                                } else {
                                    let mut result: Arc<Parsed> = valueOrError3.Extract();
                                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Success {
                                            value: Arc::new(Parsed::Parsed {
                                                        command: context.command().clone(),
                                                        params: parms.clone(),
                                                        files: files.clone(),
                                                        subcommand: Arc::new(Option::<Arc<Parsed>>::Some {
                                                                    value: result.clone()
                                                                })
                                                    })
                                        })
                                }
                            }
                        }
                    }
                } else {
                    if args.get(&int!(0)) == string_utf16_of("--") {
                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Success {
                                value: Arc::new(Parsed::Parsed {
                                            command: context.command().clone(),
                                            params: parms.clone(),
                                            files: files.concat(&args.drop(&int!(1))),
                                            subcommand: Arc::new(Option::<Arc<Parsed>>::None {})
                                        })
                            })
                    } else {
                        if string_utf16_of("--") < args.get(&int!(0)) {
                            let mut longOpt: Sequence<DafnyCharUTF16> = args.get(&int!(0)).drop(&int!(2));
                            if longOpt.contains(&DafnyCharUTF16(61 as u16)) {
                                let mut __let_tmp_rhs2: (Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>) = _default::SplitOnce::<DafnyCharUTF16>(&longOpt, &DafnyCharUTF16(61 as u16));
                                let mut opt: Sequence<DafnyCharUTF16> = __let_tmp_rhs2.0.clone();
                                let mut arg: Sequence<DafnyCharUTF16> = __let_tmp_rhs2.1.clone();
                                if context.longMap().contains(&opt) {
                                    if context.longMap().get(&opt).NeedsArg() {
                                        _default::GetOptions2(&args.drop(&int!(1)), context, &parms.concat(&context.longMap().get(&opt).MakeArg(&Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                                            value: arg.clone()
                                                        }))), files)
                                    } else {
                                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Failure {
                                                error: string_utf16_of("Option ").concat(&opt).concat(&string_utf16_of(" does not take an argument, but it got one."))
                                            })
                                    }
                                } else {
                                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Failure {
                                            error: string_utf16_of("Option ").concat(&opt).concat(&string_utf16_of(" not recognized."))
                                        })
                                }
                            } else {
                                if context.longMap().contains(&longOpt) {
                                    let mut opt: Arc<Param> = context.longMap().get(&longOpt);
                                    if opt.NeedsArg() {
                                        if args.cardinality() < int!(2) {
                                            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Failure {
                                                    error: string_utf16_of("Option ").concat(&longOpt).concat(&string_utf16_of(" requires an argument, but didn't get one."))
                                                })
                                        } else {
                                            _default::GetOptions2(&args.drop(&int!(2)), context, &parms.concat(&opt.MakeArg(&Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                                                value: args.get(&int!(1))
                                                            }))), files)
                                        }
                                    } else {
                                        if matches!((&opt).as_ref(), Flag{ .. }) && opt.solo().clone() && (args.cardinality() != int!(1) || parms.cardinality() != int!(0) || files.cardinality() != int!(0)) {
                                            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Failure {
                                                    error: string_utf16_of("Option '").concat(&longOpt).concat(&string_utf16_of("' used with other stuff, but must only be used alone."))
                                                })
                                        } else {
                                            _default::GetOptions2(&args.drop(&int!(1)), context, &parms.concat(&opt.MakeArg(&Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {}))), files)
                                        }
                                    }
                                } else {
                                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Failure {
                                            error: string_utf16_of("Option ").concat(&longOpt).concat(&string_utf16_of(" not recognized."))
                                        })
                                }
                            }
                        } else {
                            if string_utf16_of("-") == args.get(&int!(0)) {
                                _default::GetOptions2(&args.drop(&int!(1)), context, parms, &files.concat(&seq![args.get(&int!(0))]))
                            } else {
                                if string_utf16_of("-") < args.get(&int!(0)) {
                                    let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Sequence<Arc<OneArg>>, Arc<Option<DafnyCharUTF16>>), Sequence<DafnyCharUTF16>>> = _default::GetShort(&args.get(&int!(0)).drop(&int!(1)), context.longMap(), context.shortMap(), &(seq![] as Sequence<Arc<OneArg>>));
                                    if valueOrError4.IsFailure() {
                                        valueOrError4.PropagateFailure::<Arc<Parsed>>()
                                    } else {
                                        let mut __let_tmp_rhs3: (Sequence<Arc<OneArg>>, Arc<Option<DafnyCharUTF16>>) = valueOrError4.Extract();
                                        let mut newParms: Sequence<Arc<OneArg>> = __let_tmp_rhs3.0.clone();
                                        let mut nextParm: Arc<Option<DafnyCharUTF16>> = __let_tmp_rhs3.1.clone();
                                        if matches!((&nextParm).as_ref(), None{ .. }) {
                                            _default::GetOptions2(&args.drop(&int!(1)), context, &parms.concat(&newParms), files)
                                        } else {
                                            if args.cardinality() == int!(1) {
                                                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Failure {
                                                        error: string_utf16_of("Short option ").concat(&seq![nextParm.value().clone()]).concat(&string_utf16_of(" requires argument but didn't get one."))
                                                    })
                                            } else {
                                                let mut longOpt: Sequence<DafnyCharUTF16> = context.shortMap().get(nextParm.value());
                                                let mut opt: Arc<Param> = context.longMap().get(&longOpt);
                                                _default::GetOptions2(&args.drop(&int!(2)), context, &parms.concat(&newParms).concat(&opt.MakeArg(&Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                                                    value: args.get(&int!(1))
                                                                }))), files)
                                            }
                                        }
                                    }
                                } else {
                                    if context.commands().cardinality() == int!(0) {
                                        _default::GetOptions2(&args.drop(&int!(1)), context, parms, &files.concat(&seq![args.get(&int!(0))]))
                                    } else {
                                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Parsed>, Sequence<DafnyCharUTF16>>::Failure {
                                                error: string_utf16_of("Unrecognized command ").concat(&args.get(&int!(0))).concat(&string_utf16_of(" for ")).concat(context.command()).concat(&string_utf16_of("\nRun '")).concat(context.command()).concat(&string_utf16_of(" --help' for usage."))
                                            })
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(807,3)
        pub fn GetShort(arg: &Sequence<DafnyCharUTF16>, longMap: &Map<Sequence<DafnyCharUTF16>, Arc<Param>>, shortMap: &Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>, parms: &Sequence<Arc<OneArg>>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Sequence<Arc<OneArg>>, Arc<Option<DafnyCharUTF16>>), Sequence<DafnyCharUTF16>>> {
            let mut _r0 = arg.clone();
            let mut _r1 = longMap.clone();
            let mut _r2 = shortMap.clone();
            let mut _r3 = parms.clone();
            'TAIL_CALL_START: loop {
                let arg = _r0;
                let longMap = _r1;
                let shortMap = _r2;
                let parms = _r3;
                if arg.cardinality() == int!(0) {
                    return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Sequence<Arc<OneArg>>, Arc<Option<DafnyCharUTF16>>), Sequence<DafnyCharUTF16>>::Success {
                                value: (
                                        parms.clone(),
                                        Arc::new(Option::<DafnyCharUTF16>::None {})
                                    )
                            });
                } else {
                    let mut ch: DafnyCharUTF16 = arg.get(&int!(0));
                    if shortMap.contains(&ch) {
                        let mut opt: Sequence<DafnyCharUTF16> = shortMap.get(&ch);
                        if longMap.get(&opt).NeedsArg() {
                            if arg.cardinality() == int!(1) {
                                return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Sequence<Arc<OneArg>>, Arc<Option<DafnyCharUTF16>>), Sequence<DafnyCharUTF16>>::Success {
                                            value: (
                                                    parms.clone(),
                                                    Arc::new(Option::<DafnyCharUTF16>::Some {
                                                            value: ch.clone()
                                                        })
                                                )
                                        });
                            } else {
                                return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Sequence<Arc<OneArg>>, Arc<Option<DafnyCharUTF16>>), Sequence<DafnyCharUTF16>>::Success {
                                            value: (
                                                    parms.concat(&longMap.get(&opt).MakeArg(&Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                                                    value: arg.drop(&int!(1))
                                                                }))),
                                                    Arc::new(Option::<DafnyCharUTF16>::None {})
                                                )
                                        });
                            }
                        } else {
                            let mut _in0: Sequence<DafnyCharUTF16> = arg.drop(&int!(1));
                            let mut _in1: Map<Sequence<DafnyCharUTF16>, Arc<Param>> = longMap.clone();
                            let mut _in2: Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>> = shortMap.clone();
                            let mut _in3: Sequence<Arc<OneArg>> = parms.concat(&longMap.get(&opt).MakeArg(&Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {})));
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            _r2 = _in2.clone();
                            _r3 = _in3.clone();
                            continue 'TAIL_CALL_START;
                        }
                    } else {
                        return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Sequence<Arc<OneArg>>, Arc<Option<DafnyCharUTF16>>), Sequence<DafnyCharUTF16>>::Failure {
                                    error: string_utf16_of("Short option '").concat(&seq![ch.clone()]).concat(&string_utf16_of("' not recognized."))
                                });
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(153,3)
        pub fn NullChar() -> DafnyCharUTF16 {
            DafnyCharUTF16(<u16 as NumCast>::from(int!(0)).unwrap())
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(261,3)
        pub fn HELP_STR() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("help")
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(262,3)
        pub fn HELP_PARAM() -> Arc<Param> {
            Arc::new(Param::Flag {
                    name: _default::HELP_STR(),
                    help: string_utf16_of("This help text."),
                    short: _default::NullChar(),
                    solo: true,
                    inherit: true,
                    vis: Arc::new(Visibility::Normal {}),
                    shortAlias: seq![] as Sequence<DafnyCharUTF16>,
                    longAlias: seq![] as Sequence<Sequence<DafnyCharUTF16>>
                })
        }
    }

    /// ../mpl/StandardLibrary/src/GetOpt.dfy(150,3)
    #[derive(PartialEq, Clone)]
    pub enum Tri {
        Yes {},
        No {},
        Maybe {}
    }

    impl Tri {}

    impl Debug
        for Tri {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Tri {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Tri::Yes{} => {
                    write!(_formatter, "GetOpt_Compile.Tri.Yes")?;
                    Ok(())
                },
                Tri::No{} => {
                    write!(_formatter, "GetOpt_Compile.Tri.No")?;
                    Ok(())
                },
                Tri::Maybe{} => {
                    write!(_formatter, "GetOpt_Compile.Tri.Maybe")?;
                    Ok(())
                },
            }
        }
    }

    impl Tri {
        /// Enumerates all possible values of Tri
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<Tri>> {
            seq![Arc::new(Tri::Yes {}), Arc::new(Tri::No {}), Arc::new(Tri::Maybe {})].iter()
        }
    }

    impl Eq
        for Tri {}

    impl Hash
        for Tri {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Tri::Yes{} => {

                },
                Tri::No{} => {

                },
                Tri::Maybe{} => {

                },
            }
        }
    }

    impl ::std::default::Default
        for Tri {
        fn default() -> Tri {
            Tri::Yes {}
        }
    }

    impl AsRef<Tri>
        for Tri {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/StandardLibrary/src/GetOpt.dfy(151,3)
    #[derive(PartialEq, Clone)]
    pub enum Visibility {
        Normal {},
        Hidden {},
        Deprecated {}
    }

    impl Visibility {}

    impl Debug
        for Visibility {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Visibility {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Visibility::Normal{} => {
                    write!(_formatter, "GetOpt_Compile.Visibility.Normal")?;
                    Ok(())
                },
                Visibility::Hidden{} => {
                    write!(_formatter, "GetOpt_Compile.Visibility.Hidden")?;
                    Ok(())
                },
                Visibility::Deprecated{} => {
                    write!(_formatter, "GetOpt_Compile.Visibility.Deprecated")?;
                    Ok(())
                },
            }
        }
    }

    impl Visibility {
        /// Enumerates all possible values of Visibility
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<Visibility>> {
            seq![Arc::new(Visibility::Normal {}), Arc::new(Visibility::Hidden {}), Arc::new(Visibility::Deprecated {})].iter()
        }
    }

    impl Eq
        for Visibility {}

    impl Hash
        for Visibility {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Visibility::Normal{} => {

                },
                Visibility::Hidden{} => {

                },
                Visibility::Deprecated{} => {

                },
            }
        }
    }

    impl ::std::default::Default
        for Visibility {
        fn default() -> Visibility {
            Visibility::Normal {}
        }
    }

    impl AsRef<Visibility>
        for Visibility {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/StandardLibrary/src/GetOpt.dfy(155,3)
    #[derive(PartialEq, Clone)]
    pub enum Options {
        Options {
            name: Sequence<DafnyCharUTF16>,
            help: Sequence<DafnyCharUTF16>,
            params: Sequence<Arc<Param>>
        }
    }

    impl Options {
        /// Returns a borrow of the field name
        pub fn name(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Options::Options{name, help, params, } => name,
            }
        }
        /// Returns a borrow of the field help
        pub fn help(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Options::Options{name, help, params, } => help,
            }
        }
        /// Returns a borrow of the field params
        pub fn params(&self) -> &Sequence<Arc<Param>> {
            match self {
                Options::Options{name, help, params, } => params,
            }
        }
    }

    impl Debug
        for Options {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Options {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Options::Options{name, help, params, } => {
                    write!(_formatter, "GetOpt_Compile.Options.Options(")?;
                    DafnyPrint::fmt_print(name, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(help, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(params, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for Options {}

    impl Hash
        for Options {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Options::Options{name, help, params, } => {
                    Hash::hash(name, _state);
                    Hash::hash(help, _state);
                    Hash::hash(params, _state)
                },
            }
        }
    }

    impl ::std::default::Default
        for Options {
        fn default() -> Options {
            Options::Options {
                name: ::std::default::Default::default(),
                help: ::std::default::Default::default(),
                params: ::std::default::Default::default()
            }
        }
    }

    impl AsRef<Options>
        for Options {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/StandardLibrary/src/GetOpt.dfy(161,3)
    #[derive(PartialEq, Clone)]
    pub enum Unused {
        UnusedOk {},
        Required {},
        Default {
            val: Sequence<DafnyCharUTF16>
        }
    }

    impl Unused {
        /// Gets the field val for all enum members which have it
        pub fn val(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Unused::UnusedOk{} => panic!("field does not exist on this variant"),
                Unused::Required{} => panic!("field does not exist on this variant"),
                Unused::Default{val, } => val,
            }
        }
    }

    impl Debug
        for Unused {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Unused {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Unused::UnusedOk{} => {
                    write!(_formatter, "GetOpt_Compile.Unused.UnusedOk")?;
                    Ok(())
                },
                Unused::Required{} => {
                    write!(_formatter, "GetOpt_Compile.Unused.Required")?;
                    Ok(())
                },
                Unused::Default{val, } => {
                    write!(_formatter, "GetOpt_Compile.Unused.Default(")?;
                    DafnyPrint::fmt_print(val, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for Unused {}

    impl Hash
        for Unused {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Unused::UnusedOk{} => {

                },
                Unused::Required{} => {

                },
                Unused::Default{val, } => {
                    Hash::hash(val, _state)
                },
            }
        }
    }

    impl ::std::default::Default
        for Unused {
        fn default() -> Unused {
            Unused::UnusedOk {}
        }
    }

    impl AsRef<Unused>
        for Unused {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/StandardLibrary/src/GetOpt.dfy(163,3)
    #[derive(PartialEq, Clone)]
    pub enum Param {
        Opt {
            name: Sequence<DafnyCharUTF16>,
            help: Sequence<DafnyCharUTF16>,
            argName: Sequence<DafnyCharUTF16>,
            short: DafnyCharUTF16,
            unused: Arc<Unused>,
            inherit: bool,
            vis: Arc<Visibility>,
            shortAlias: Sequence<DafnyCharUTF16>,
            longAlias: Sequence<Sequence<DafnyCharUTF16>>,
            positional: Arc<Tri>
        },
        Flag {
            name: Sequence<DafnyCharUTF16>,
            help: Sequence<DafnyCharUTF16>,
            short: DafnyCharUTF16,
            solo: bool,
            inherit: bool,
            vis: Arc<Visibility>,
            shortAlias: Sequence<DafnyCharUTF16>,
            longAlias: Sequence<Sequence<DafnyCharUTF16>>
        },
        Command {
            options: Arc<Options>
        }
    }

    impl Param {
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(190,5)
        pub fn NeedsArg(self: &Arc<Self>) -> bool {
            matches!(self.as_ref(), Opt{ .. })
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(194,5)
        pub fn Inherits(self: &Arc<Self>) -> bool {
            (matches!(self.as_ref(), Opt{ .. }) || matches!(self.as_ref(), Flag{ .. })) && self.inherit().clone()
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(198,5)
        pub fn ShowHelp(self: &Arc<Self>) -> bool {
            matches!(self.as_ref(), Command{ .. }) || self.vis().clone() == Arc::new(Visibility::Normal {})
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(202,5)
        pub fn KeepResult(self: &Arc<Self>) -> bool {
            matches!(self.as_ref(), Command{ .. }) || self.vis().clone() != Arc::new(Visibility::Deprecated {})
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(206,5)
        pub fn Name(self: &Arc<Self>) -> Sequence<DafnyCharUTF16> {
            if matches!(self.as_ref(), Command{ .. }) {
                self.options().name().clone()
            } else {
                self.name().clone()
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(213,5)
        pub fn MakeArg(self: &Arc<Self>, value: &Arc<Option<Sequence<DafnyCharUTF16>>>) -> Sequence<Arc<OneArg>> {
            if self.KeepResult() {
                seq![Arc::new(OneArg::OneArg {
                            name: self.Name(),
                            value: value.clone()
                        })]
            } else {
                seq![] as Sequence<Arc<OneArg>>
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(220,5)
        pub fn ShortAlias(self: &Arc<Self>) -> Sequence<DafnyCharUTF16> {
            if matches!(self.as_ref(), Command{ .. }) {
                seq![] as Sequence<DafnyCharUTF16>
            } else {
                self.shortAlias().clone()
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(227,5)
        pub fn LongAlias(self: &Arc<Self>) -> Sequence<Sequence<DafnyCharUTF16>> {
            if matches!(self.as_ref(), Command{ .. }) {
                seq![] as Sequence<Sequence<DafnyCharUTF16>>
            } else {
                self.longAlias().clone()
            }
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(234,5)
        pub fn Required(self: &Arc<Self>) -> bool {
            matches!(self.as_ref(), Opt{ .. }) && matches!(self.unused().as_ref(), Required{ .. })
        }
        /// ../mpl/StandardLibrary/src/GetOpt.dfy(238,5)
        pub fn HasDefault(self: &Arc<Self>) -> bool {
            matches!(self.as_ref(), Opt{ .. }) && matches!(self.unused().as_ref(), crate::implementation_from_dafny::_GetOpt_Compile::Unused::Default{ .. })
        }
        /// Gets the field name for all enum members which have it
        pub fn name(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => name,
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => name,
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field help for all enum members which have it
        pub fn help(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => help,
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => help,
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field argName for all enum members which have it
        pub fn argName(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => argName,
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => panic!("field does not exist on this variant"),
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field short for all enum members which have it
        pub fn short(&self) -> &DafnyCharUTF16 {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => short,
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => short,
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field unused for all enum members which have it
        pub fn unused(&self) -> &Arc<Unused> {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => unused,
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => panic!("field does not exist on this variant"),
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field inherit for all enum members which have it
        pub fn inherit(&self) -> &bool {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => inherit,
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => inherit,
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field vis for all enum members which have it
        pub fn vis(&self) -> &Arc<Visibility> {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => vis,
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => vis,
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field shortAlias for all enum members which have it
        pub fn shortAlias(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => shortAlias,
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => shortAlias,
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field longAlias for all enum members which have it
        pub fn longAlias(&self) -> &Sequence<Sequence<DafnyCharUTF16>> {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => longAlias,
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => longAlias,
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field positional for all enum members which have it
        pub fn positional(&self) -> &Arc<Tri> {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => positional,
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => panic!("field does not exist on this variant"),
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field solo for all enum members which have it
        pub fn solo(&self) -> &bool {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => panic!("field does not exist on this variant"),
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => solo,
                Param::Command{options, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field options for all enum members which have it
        pub fn options(&self) -> &Arc<Options> {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => panic!("field does not exist on this variant"),
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => panic!("field does not exist on this variant"),
                Param::Command{options, } => options,
            }
        }
    }

    impl Debug
        for Param {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Param {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => {
                    write!(_formatter, "GetOpt_Compile.Param.Opt(")?;
                    DafnyPrint::fmt_print(name, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(help, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(argName, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(short, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(unused, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(inherit, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(vis, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(shortAlias, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(longAlias, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(positional, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => {
                    write!(_formatter, "GetOpt_Compile.Param.Flag(")?;
                    DafnyPrint::fmt_print(name, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(help, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(short, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(solo, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(inherit, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(vis, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(shortAlias, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(longAlias, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
                Param::Command{options, } => {
                    write!(_formatter, "GetOpt_Compile.Param.Command(")?;
                    DafnyPrint::fmt_print(options, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for Param {}

    impl Hash
        for Param {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Param::Opt{name, help, argName, short, unused, inherit, vis, shortAlias, longAlias, positional, } => {
                    Hash::hash(name, _state);
                    Hash::hash(help, _state);
                    Hash::hash(argName, _state);
                    Hash::hash(short, _state);
                    Hash::hash(unused, _state);
                    Hash::hash(inherit, _state);
                    Hash::hash(vis, _state);
                    Hash::hash(shortAlias, _state);
                    Hash::hash(longAlias, _state);
                    Hash::hash(positional, _state)
                },
                Param::Flag{name, help, short, solo, inherit, vis, shortAlias, longAlias, } => {
                    Hash::hash(name, _state);
                    Hash::hash(help, _state);
                    Hash::hash(short, _state);
                    Hash::hash(solo, _state);
                    Hash::hash(inherit, _state);
                    Hash::hash(vis, _state);
                    Hash::hash(shortAlias, _state);
                    Hash::hash(longAlias, _state)
                },
                Param::Command{options, } => {
                    Hash::hash(options, _state)
                },
            }
        }
    }

    impl ::std::default::Default
        for Param {
        fn default() -> Param {
            Param::Opt {
                name: ::std::default::Default::default(),
                help: ::std::default::Default::default(),
                argName: ::std::default::Default::default(),
                short: ::std::default::Default::default(),
                unused: ::std::default::Default::default(),
                inherit: ::std::default::Default::default(),
                vis: ::std::default::Default::default(),
                shortAlias: ::std::default::Default::default(),
                longAlias: ::std::default::Default::default(),
                positional: ::std::default::Default::default()
            }
        }
    }

    impl AsRef<Param>
        for Param {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/StandardLibrary/src/GetOpt.dfy(282,3)
    #[derive(PartialEq, Clone)]
    pub enum OneArg {
        OneArg {
            name: Sequence<DafnyCharUTF16>,
            value: Arc<Option<Sequence<DafnyCharUTF16>>>
        }
    }

    impl OneArg {
        /// Returns a borrow of the field name
        pub fn name(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                OneArg::OneArg{name, value, } => name,
            }
        }
        /// Returns a borrow of the field value
        pub fn value(&self) -> &Arc<Option<Sequence<DafnyCharUTF16>>> {
            match self {
                OneArg::OneArg{name, value, } => value,
            }
        }
    }

    impl Debug
        for OneArg {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for OneArg {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                OneArg::OneArg{name, value, } => {
                    write!(_formatter, "GetOpt_Compile.OneArg.OneArg(")?;
                    DafnyPrint::fmt_print(name, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(value, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for OneArg {}

    impl Hash
        for OneArg {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                OneArg::OneArg{name, value, } => {
                    Hash::hash(name, _state);
                    Hash::hash(value, _state)
                },
            }
        }
    }

    impl ::std::default::Default
        for OneArg {
        fn default() -> OneArg {
            OneArg::OneArg {
                name: ::std::default::Default::default(),
                value: ::std::default::Default::default()
            }
        }
    }

    impl AsRef<OneArg>
        for OneArg {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/StandardLibrary/src/GetOpt.dfy(287,3)
    #[derive(PartialEq, Clone)]
    pub enum Parsed {
        Parsed {
            command: Sequence<DafnyCharUTF16>,
            params: Sequence<Arc<OneArg>>,
            files: Sequence<Sequence<DafnyCharUTF16>>,
            subcommand: Arc<Option<Arc<Parsed>>>
        }
    }

    impl Parsed {
        /// Returns a borrow of the field command
        pub fn command(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Parsed::Parsed{command, params, files, subcommand, } => command,
            }
        }
        /// Returns a borrow of the field params
        pub fn params(&self) -> &Sequence<Arc<OneArg>> {
            match self {
                Parsed::Parsed{command, params, files, subcommand, } => params,
            }
        }
        /// Returns a borrow of the field files
        pub fn files(&self) -> &Sequence<Sequence<DafnyCharUTF16>> {
            match self {
                Parsed::Parsed{command, params, files, subcommand, } => files,
            }
        }
        /// Returns a borrow of the field subcommand
        pub fn subcommand(&self) -> &Arc<Option<Arc<Parsed>>> {
            match self {
                Parsed::Parsed{command, params, files, subcommand, } => subcommand,
            }
        }
    }

    impl Debug
        for Parsed {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Parsed {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Parsed::Parsed{command, params, files, subcommand, } => {
                    write!(_formatter, "GetOpt_Compile.Parsed.Parsed(")?;
                    DafnyPrint::fmt_print(command, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(params, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(files, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(subcommand, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for Parsed {}

    impl Hash
        for Parsed {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Parsed::Parsed{command, params, files, subcommand, } => {
                    Hash::hash(command, _state);
                    Hash::hash(params, _state);
                    Hash::hash(files, _state);
                    Hash::hash(subcommand, _state)
                },
            }
        }
    }

    impl ::std::default::Default
        for Parsed {
        fn default() -> Parsed {
            Parsed::Parsed {
                command: ::std::default::Default::default(),
                params: ::std::default::Default::default(),
                files: ::std::default::Default::default(),
                subcommand: ::std::default::Default::default()
            }
        }
    }

    impl AsRef<Parsed>
        for Parsed {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/StandardLibrary/src/GetOpt.dfy(394,3)
    pub type CommandMap = Map<Sequence<DafnyCharUTF16>, Arc<Options>>;

    /// ../mpl/StandardLibrary/src/GetOpt.dfy(713,3)
    #[derive(PartialEq, Clone)]
    pub enum Context {
        Context {
            longMap: Map<Sequence<DafnyCharUTF16>, Arc<Param>>,
            shortMap: Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>>,
            inherits: Sequence<Arc<Param>>,
            commands: CommandMap,
            command: Sequence<DafnyCharUTF16>
        }
    }

    impl Context {
        /// Returns a borrow of the field longMap
        pub fn longMap(&self) -> &Map<Sequence<DafnyCharUTF16>, Arc<Param>> {
            match self {
                Context::Context{longMap, shortMap, inherits, commands, command, } => longMap,
            }
        }
        /// Returns a borrow of the field shortMap
        pub fn shortMap(&self) -> &Map<DafnyCharUTF16, Sequence<DafnyCharUTF16>> {
            match self {
                Context::Context{longMap, shortMap, inherits, commands, command, } => shortMap,
            }
        }
        /// Returns a borrow of the field inherits
        pub fn inherits(&self) -> &Sequence<Arc<Param>> {
            match self {
                Context::Context{longMap, shortMap, inherits, commands, command, } => inherits,
            }
        }
        /// Returns a borrow of the field commands
        pub fn commands(&self) -> &CommandMap {
            match self {
                Context::Context{longMap, shortMap, inherits, commands, command, } => commands,
            }
        }
        /// Returns a borrow of the field command
        pub fn command(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                Context::Context{longMap, shortMap, inherits, commands, command, } => command,
            }
        }
    }

    impl Debug
        for Context {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for Context {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Context::Context{longMap, shortMap, inherits, commands, command, } => {
                    write!(_formatter, "GetOpt_Compile.Context.Context(")?;
                    DafnyPrint::fmt_print(longMap, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(shortMap, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(inherits, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(commands, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(command, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for Context {}

    impl Hash
        for Context {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Context::Context{longMap, shortMap, inherits, commands, command, } => {
                    Hash::hash(longMap, _state);
                    Hash::hash(shortMap, _state);
                    Hash::hash(inherits, _state);
                    Hash::hash(commands, _state);
                    Hash::hash(command, _state)
                },
            }
        }
    }

    impl ::std::default::Default
        for Context {
        fn default() -> Context {
            Context::Context {
                longMap: ::std::default::Default::default(),
                shortMap: ::std::default::Default::default(),
                inherits: ::std::default::Default::default(),
                commands: ::std::default::Default::default(),
                command: ::std::default::Default::default()
            }
        }
    }

    impl AsRef<Context>
        for Context {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/HKDF/HKDF.dfy(11,1)
pub mod _HKDF_Compile {
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::HMAC::HMac;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::rd;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HKDF.dfy(39,3)
        pub fn Extract(hmac: &Object<HMac>, salt: &Sequence<u8>, ikm: &Sequence<u8>) -> Sequence<u8> {
            let mut prk: Sequence<u8>;
            rd!(hmac).Init(salt);
            rd!(hmac).BlockUpdate(ikm);
            let mut _out0: Sequence<u8> = rd!(hmac).GetResult();
            prk = _out0.clone();
            prk = prk.clone();
            return prk.clone();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HKDF.dfy(129,3)
        pub fn Expand(hmac: &Object<HMac>, prk: &Sequence<u8>, info: &Sequence<u8>, expectedLength: u64, digest: &Arc<DigestAlgorithm>) -> Sequence<u8> {
            let mut okm = MaybePlacebo::<Sequence<u8>>::new();
            let mut hashLength: u64 = crate::implementation_from_dafny::_Digest_Compile::_default::Length(digest);
            let mut n: u64 = (hashLength + expectedLength - 1) / hashLength;
            rd!(hmac).Init(prk);
            let mut t_prev: Sequence<u8> = seq![] as Sequence<u8>;
            let mut t_n: Sequence<u8> = t_prev.clone();
            let mut i: u64 = 1;
            while i <= n {
                rd!(hmac).BlockUpdate(&t_prev);
                rd!(hmac).BlockUpdate(info);
                rd!(hmac).BlockUpdate(&seq![i as u8]);
                let mut _out0: Sequence<u8> = rd!(hmac).GetResult();
                t_prev = _out0.clone();
                t_n = t_n.concat(&t_prev);
                i = i + 1;
            };
            okm = MaybePlacebo::from(t_n.clone());
            if expectedLength < truncate!(okm.read().cardinality(), u64) {
                okm = MaybePlacebo::from(okm.read().take(&int!((&expectedLength).clone())));
            };
            return okm.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HKDF.dfy(208,3)
        pub fn Hkdf(digest: &Arc<DigestAlgorithm>, salt: &Arc<Option<Sequence<u8>>>, ikm: &Sequence<u8>, info: &Sequence<u8>, L: u64) -> Sequence<u8> {
            let mut okm = MaybePlacebo::<Sequence<u8>>::new();
            if L == 0 {
                okm = MaybePlacebo::from(seq![] as Sequence<u8>);
                return okm.read();
            };
            let mut valueOrError0: Arc<Result<Object<HMac>, Arc<Error>>>;
            let mut _out0: Arc<Result<Object<HMac>, Arc<Error>>> = HMac::Build(digest);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut hmac: Object<HMac> = valueOrError0.Extract();
            let mut hashLength: u64 = crate::implementation_from_dafny::_Digest_Compile::_default::Length(digest);
            let mut nonEmptySalt: Sequence<u8>;
            let mut _source0: Arc<Option<Sequence<u8>>> = salt.clone();
            if matches!((&_source0).as_ref(), None{ .. }) {
                nonEmptySalt = crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Fill::<u8>(&truncate!((&int!(0)).clone(), u8), &int!((&hashLength).clone()));
            } else {
                let mut ___mcc_h0: Sequence<u8> = _source0.value().clone();
                let mut s: Sequence<u8> = ___mcc_h0.clone();
                nonEmptySalt = s.clone();
            };
            let mut prk: Sequence<u8>;
            let mut _out1: Sequence<u8> = _default::Extract(&hmac, &nonEmptySalt, ikm);
            prk = _out1.clone();
            let mut _out2: Sequence<u8> = _default::Expand(&hmac, &prk, info, L, digest);
            okm = MaybePlacebo::from(_out2.clone());
            return okm.read();
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/HKDF/HMAC.dfy(7,1)
pub mod HMAC {
    pub use ::dafny_runtime::Object;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::_dafny_externs::HMAC::*;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HMAC.dfy(80,3)
        pub fn CreateHMacSuccess(hmac: &Object<HMac>) -> Arc<Result<Object<HMac>, Arc<Error>>> {
            Arc::new(Result::<Object<HMac>, Arc<Error>>::Success {
                    value: hmac.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HMAC.dfy(84,3)
        pub fn CreateHMacFailure(error: &Arc<Error>) -> Arc<Result<Object<HMac>, Arc<Error>>> {
            Arc::new(Result::<Object<HMac>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HMAC.dfy(88,3)
        pub fn CreateDigestSuccess(bytes: &Sequence<u8>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: bytes.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/HKDF/HMAC.dfy(92,3)
        pub fn CreateDigestFailure(error: &Arc<Error>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
    }
}
/// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(16,1)
pub mod _Header_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageFormatVersion;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageFormatVersion::V1;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType::Framed;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType::NonFramed;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageType;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ESDKAlgorithmSuite;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageId;
    pub use crate::implementation_from_dafny::_EncryptionContext_Compile::ESDKCanonicalEncryptionContext;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16;
    pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType;
    pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptionContext;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderAuth;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(82,3)
        pub fn _HeaderVersionSupportsCommitment_q(suite: &Arc<AlgorithmSuiteInfo>, body: &Arc<HeaderBody>) -> bool {
            (!matches!(suite.commitment().as_ref(), HKDF{ .. }) || matches!(body.as_ref(), crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody::V2HeaderBody{ .. }) && truncate!(body.suiteData().cardinality(), u64) == suite.commitment().HKDF().outputKeyLength().clone() as u64) && (!(!matches!(suite.commitment().as_ref(), HKDF{ .. })) || true && matches!(body.as_ref(), crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody::V1HeaderBody{ .. }))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(117,3)
        pub fn ReadHeaderBody(buffer: &Arc<ReadableBuffer>, maxEdks: &Arc<Option<CountingNumbers>>, mpl: &Object<MaterialProvidersClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Arc<HeaderBody>>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Arc<MessageFormatVersion>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::ReadMessageFormatVersion(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<Arc<HeaderBody>>>>()
            } else {
                let mut version: Arc<SuccessfulRead<Arc<MessageFormatVersion>>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Arc<HeaderBody>, Arc<ReadableBuffer>), Arc<ReadProblems>>> = (&({
                        let mut mpl = mpl.clone();
                        let mut buffer = buffer.clone();
                        let mut maxEdks = maxEdks.clone();
                        Arc::new(move |_source0: &Arc<MessageFormatVersion>| -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(Arc<HeaderBody>, Arc<ReadableBuffer>), Arc<ReadProblems>>>{
                                if matches!(_source0.as_ref(), V1{ .. }) {
                                    let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<crate::implementation_from_dafny::_V1HeaderBody_Compile::V1HeaderBody>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_V1HeaderBody_Compile::_default::ReadV1HeaderBody(&buffer, &maxEdks, &mpl);
                                    if valueOrError2.IsFailure() {
                                        valueOrError2.PropagateFailure::<(Arc<HeaderBody>, Arc<ReadableBuffer>)>()
                                    } else {
                                        let mut b: Arc<SuccessfulRead<crate::implementation_from_dafny::_V1HeaderBody_Compile::V1HeaderBody>> = valueOrError2.Extract();
                                        let mut body: Arc<HeaderBody> = b.data().clone();
                                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Arc<HeaderBody>, Arc<ReadableBuffer>), Arc<ReadProblems>>::Success {
                                                value: (
                                                        body.clone(),
                                                        b.tail().clone()
                                                    )
                                            })
                                    }
                                } else {
                                    let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<crate::implementation_from_dafny::_V2HeaderBody_Compile::V2HeaderBody>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_V2HeaderBody_Compile::_default::ReadV2HeaderBody(&buffer, &maxEdks, &mpl);
                                    if valueOrError3.IsFailure() {
                                        valueOrError3.PropagateFailure::<(Arc<HeaderBody>, Arc<ReadableBuffer>)>()
                                    } else {
                                        let mut b: Arc<SuccessfulRead<crate::implementation_from_dafny::_V2HeaderBody_Compile::V2HeaderBody>> = valueOrError3.Extract();
                                        let mut body: Arc<HeaderBody> = b.data().clone();
                                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(Arc<HeaderBody>, Arc<ReadableBuffer>), Arc<ReadProblems>>::Success {
                                                value: (
                                                        body.clone(),
                                                        b.tail().clone()
                                                    )
                                            })
                                    }
                                }
                            })
                    }))(version.data());
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<Arc<HeaderBody>>>>()
                } else {
                    let mut __let_tmp_rhs0: (Arc<HeaderBody>, Arc<ReadableBuffer>) = valueOrError1.Extract();
                    let mut body: Arc<HeaderBody> = __let_tmp_rhs0.0.clone();
                    let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs0.1.clone();
                    let mut valueOrError4: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(matches!(body.contentType().as_ref(), Framed{ .. }) == (0 < body.frameLength().clone()), &Arc::new(ReadProblems::Error {
                                    message: string_utf16_of("Frame length must be positive if content is framed")
                                }));
                    if valueOrError4.IsFailure() {
                        valueOrError4.PropagateFailure::<Arc<SuccessfulRead<Arc<HeaderBody>>>>()
                    } else {
                        let mut valueOrError5: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(matches!(body.contentType().as_ref(), NonFramed{ .. }) == (body.frameLength().clone() == 0), &Arc::new(ReadProblems::Error {
                                        message: string_utf16_of("Frame length must be zero if content is non-framed")
                                    }));
                        if valueOrError5.IsFailure() {
                            valueOrError5.PropagateFailure::<Arc<SuccessfulRead<Arc<HeaderBody>>>>()
                        } else {
                            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<Arc<HeaderBody>>>, Arc<ReadProblems>>::Success {
                                    value: Arc::new(SuccessfulRead::<Arc<HeaderBody>>::SuccessfulRead {
                                                data: body.clone(),
                                                tail: tail.clone()
                                            })
                                })
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(167,3)
        pub fn WriteHeaderBody(body: &Arc<HeaderBody>) -> Sequence<u8> {
            let mut _source0: Arc<HeaderBody> = body.clone();
            if matches!((&_source0).as_ref(), crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody::V1HeaderBody{ .. }) {
                let mut ___mcc_h0: Arc<MessageType> = _source0.messageType().clone();
                let mut ___mcc_h1: ESDKAlgorithmSuite = _source0.algorithmSuite().clone();
                let mut ___mcc_h2: MessageId = _source0.messageId().clone();
                let mut ___mcc_h3: ESDKCanonicalEncryptionContext = _source0.encryptionContext().clone();
                let mut ___mcc_h4: seq16<ESDKEncryptedDataKey> = _source0.encryptedDataKeys().clone();
                let mut ___mcc_h5: Arc<ContentType> = _source0.contentType().clone();
                let mut ___mcc_h6: u64 = _source0.headerIvLength().clone();
                let mut ___mcc_h7: u32 = _source0.frameLength().clone();
                crate::implementation_from_dafny::_V1HeaderBody_Compile::_default::WriteV1HeaderBody(body)
            } else {
                let mut ___mcc_h8: ESDKAlgorithmSuite = _source0.algorithmSuite().clone();
                let mut ___mcc_h9: MessageId = _source0.messageId().clone();
                let mut ___mcc_h10: ESDKCanonicalEncryptionContext = _source0.encryptionContext().clone();
                let mut ___mcc_h11: seq16<ESDKEncryptedDataKey> = _source0.encryptedDataKeys().clone();
                let mut ___mcc_h12: Arc<ContentType> = _source0.contentType().clone();
                let mut ___mcc_h13: u32 = _source0.frameLength().clone();
                let mut ___mcc_h14: Sequence<u8> = _source0.suiteData().clone();
                crate::implementation_from_dafny::_V2HeaderBody_Compile::_default::WriteV2HeaderBody(body)
            }
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(35,3)
    #[derive(PartialEq, Clone)]
    pub enum HeaderInfo {
        HeaderInfo {
            body: Arc<HeaderBody>,
            rawHeader: Sequence<u8>,
            encryptionContext: ESDKEncryptionContext,
            suite: Arc<AlgorithmSuiteInfo>,
            headerAuth: Arc<HeaderAuth>
        }
    }

    impl HeaderInfo {
        /// Returns a borrow of the field body
        pub fn body(&self) -> &Arc<HeaderBody> {
            match self {
                HeaderInfo::HeaderInfo{body, rawHeader, encryptionContext, suite, headerAuth, } => body,
            }
        }
        /// Returns a borrow of the field rawHeader
        pub fn rawHeader(&self) -> &Sequence<u8> {
            match self {
                HeaderInfo::HeaderInfo{body, rawHeader, encryptionContext, suite, headerAuth, } => rawHeader,
            }
        }
        /// Returns a borrow of the field encryptionContext
        pub fn encryptionContext(&self) -> &ESDKEncryptionContext {
            match self {
                HeaderInfo::HeaderInfo{body, rawHeader, encryptionContext, suite, headerAuth, } => encryptionContext,
            }
        }
        /// Returns a borrow of the field suite
        pub fn suite(&self) -> &Arc<AlgorithmSuiteInfo> {
            match self {
                HeaderInfo::HeaderInfo{body, rawHeader, encryptionContext, suite, headerAuth, } => suite,
            }
        }
        /// Returns a borrow of the field headerAuth
        pub fn headerAuth(&self) -> &Arc<HeaderAuth> {
            match self {
                HeaderInfo::HeaderInfo{body, rawHeader, encryptionContext, suite, headerAuth, } => headerAuth,
            }
        }
    }

    impl Debug
        for HeaderInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for HeaderInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                HeaderInfo::HeaderInfo{body, rawHeader, encryptionContext, suite, headerAuth, } => {
                    write!(_formatter, "Header_Compile.HeaderInfo.HeaderInfo(")?;
                    DafnyPrint::fmt_print(body, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(rawHeader, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(suite, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(headerAuth, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for HeaderInfo {}

    impl Hash
        for HeaderInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                HeaderInfo::HeaderInfo{body, rawHeader, encryptionContext, suite, headerAuth, } => {
                    Hash::hash(body, _state);
                    Hash::hash(rawHeader, _state);
                    Hash::hash(encryptionContext, _state);
                    Hash::hash(suite, _state);
                    Hash::hash(headerAuth, _state)
                },
            }
        }
    }

    impl Default
        for HeaderInfo {
        fn default() -> HeaderInfo {
            HeaderInfo::HeaderInfo {
                body: Default::default(),
                rawHeader: Default::default(),
                encryptionContext: Default::default(),
                suite: Default::default(),
                headerAuth: Default::default()
            }
        }
    }

    impl AsRef<HeaderInfo>
        for HeaderInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/Header.dfy(101,3)
    pub type Header = Arc<HeaderInfo>;
}
/// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(11,1)
pub mod _HeaderAuth_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderAuth;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(28,3)
        pub fn WriteHeaderAuthTagV2(headerAuth: &AESMac) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(headerAuth.headerAuthTag())
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(48,3)
        pub fn WriteHeaderAuthTagV1(headerAuth: &AESMac) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(headerAuth.headerIv()).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(headerAuth.headerAuthTag()))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(72,3)
        pub fn WriteHeaderAuthTag(headerAuth: &AESMac, suite: &Arc<AlgorithmSuiteInfo>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            if suite.messageVersion().clone() == 1 {
                Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                        value: _default::WriteHeaderAuthTagV1(headerAuth)
                    })
            } else {
                if suite.messageVersion().clone() == 2 {
                    Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: _default::WriteHeaderAuthTagV2(headerAuth)
                        })
                } else {
                    Arc::new(Result::<Sequence<u8>, Arc<Error>>::Failure {
                            error: Arc::new(Error::AwsEncryptionSdkException {
                                        message: string_utf16_of("Unexpected message version")
                                    })
                        })
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(84,3)
        pub fn ReadHeaderAuthTagV1(buffer: &Arc<ReadableBuffer>, suite: &Arc<AlgorithmSuiteInfo>) -> Arc<Result<Arc<SuccessfulRead<AESMac>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite) as u64);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<AESMac>>>()
            } else {
                let mut headerIv: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(headerIv.tail(), crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(suite) as u64);
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<AESMac>>>()
                } else {
                    let mut headerAuthTag: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError1.Extract();
                    let mut auth: AESMac = Arc::new(HeaderAuth::AESMac {
                                headerIv: headerIv.data().clone(),
                                headerAuthTag: headerAuthTag.data().clone()
                            });
                    Arc::new(Result::<Arc<SuccessfulRead<AESMac>>, MoreNeeded>::Success {
                            value: Arc::new(SuccessfulRead::<AESMac>::SuccessfulRead {
                                        data: auth.clone(),
                                        tail: headerAuthTag.tail().clone()
                                    })
                        })
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(110,3)
        pub fn ReadHeaderAuthTagV2(buffer: &Arc<ReadableBuffer>, suite: &Arc<AlgorithmSuiteInfo>) -> Arc<Result<Arc<SuccessfulRead<AESMac>>, Arc<ReadProblems>>> {
            let mut headerIv: Sequence<u8> = crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLengthZeros(suite);
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetTagLength(suite) as u64);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<AESMac>>>()
            } else {
                let mut headerAuthTag: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut auth: AESMac = Arc::new(HeaderAuth::AESMac {
                            headerIv: headerIv.clone(),
                            headerAuthTag: headerAuthTag.data().clone()
                        });
                Arc::new(Result::<Arc<SuccessfulRead<AESMac>>, MoreNeeded>::Success {
                        value: Arc::new(SuccessfulRead::<AESMac>::SuccessfulRead {
                                    data: auth.clone(),
                                    tail: headerAuthTag.tail().clone()
                                })
                    })
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(134,3)
        pub fn ReadHeaderAuthTag(buffer: &Arc<ReadableBuffer>, suite: &Arc<AlgorithmSuiteInfo>) -> Arc<Result<Arc<SuccessfulRead<AESMac>>, Arc<ReadProblems>>> {
            if suite.messageVersion().clone() == 1 {
                _default::ReadHeaderAuthTagV1(buffer, suite)
            } else {
                if suite.messageVersion().clone() == 2 {
                    _default::ReadHeaderAuthTagV2(buffer, suite)
                } else {
                    Arc::new(Result::<Arc<SuccessfulRead<AESMac>>, Arc<ReadProblems>>::Failure {
                            error: Arc::new(ReadProblems::Error {
                                        message: string_utf16_of("Unexpected message version")
                                    })
                        })
                }
            }
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/HeaderAuth.dfy(24,3)
    pub type AESMac = Arc<HeaderAuth>;
}
/// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(9,1)
pub mod _HeaderTypes_Compile {
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageFormatVersion::V1;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::truncate;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_EncryptionContext_Compile::ESDKCanonicalEncryptionContext;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16;
    pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType::NonFramed;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(161,3)
        pub fn MESSAGE_ID_LEN_V1() -> u64 {
            16
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(162,3)
        pub fn MESSAGE_ID_LEN_V2() -> u64 {
            32
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(19,3)
    #[derive(PartialEq, Clone)]
    pub enum MessageFormatVersion {
        V1 {},
        V2 {}
    }

    impl MessageFormatVersion {
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(23,5)
        pub fn Serialize(self: &Arc<Self>) -> Sequence<u8> {
            let mut _source0: Arc<MessageFormatVersion> = self.clone();
            if matches!((&_source0).as_ref(), V1{ .. }) {
                seq![1]
            } else {
                seq![2]
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(47,5)
        pub fn Get(x: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<MessageFormatVersion>, Sequence<DafnyCharUTF16>>> {
            let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(x.clone() == seq![1] || x.clone() == seq![2], &string_utf16_of("Unsupported Version value."));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<MessageFormatVersion>>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<MessageFormatVersion>, Sequence<DafnyCharUTF16>>::Success {
                        value: if x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) == 1 {
                                Arc::new(MessageFormatVersion::V1 {})
                            } else {
                                Arc::new(MessageFormatVersion::V2 {})
                            }
                    })
            }
        }
    }

    impl Debug
        for MessageFormatVersion {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for MessageFormatVersion {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                MessageFormatVersion::V1{} => {
                    write!(_formatter, "HeaderTypes_Compile.MessageFormatVersion.V1")?;
                    Ok(())
                },
                MessageFormatVersion::V2{} => {
                    write!(_formatter, "HeaderTypes_Compile.MessageFormatVersion.V2")?;
                    Ok(())
                },
            }
        }
    }

    impl MessageFormatVersion {
        /// Enumerates all possible values of MessageFormatVersion
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<MessageFormatVersion>> {
            seq![Arc::new(MessageFormatVersion::V1 {}), Arc::new(MessageFormatVersion::V2 {})].iter()
        }
    }

    impl Eq
        for MessageFormatVersion {}

    impl Hash
        for MessageFormatVersion {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                MessageFormatVersion::V1{} => {

                },
                MessageFormatVersion::V2{} => {

                },
            }
        }
    }

    impl Default
        for MessageFormatVersion {
        fn default() -> MessageFormatVersion {
            MessageFormatVersion::V1 {}
        }
    }

    impl AsRef<MessageFormatVersion>
        for MessageFormatVersion {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(66,3)
    pub type ESDKAlgorithmSuite = Arc<AlgorithmSuiteInfo>;

    /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(69,3)
    #[derive(PartialEq, Clone)]
    pub enum HeaderBody {
        V1HeaderBody {
            messageType: Arc<MessageType>,
            algorithmSuite: ESDKAlgorithmSuite,
            messageId: MessageId,
            encryptionContext: ESDKCanonicalEncryptionContext,
            encryptedDataKeys: seq16<ESDKEncryptedDataKey>,
            contentType: Arc<ContentType>,
            headerIvLength: u64,
            frameLength: u32
        },
        V2HeaderBody {
            algorithmSuite: ESDKAlgorithmSuite,
            messageId: MessageId,
            encryptionContext: ESDKCanonicalEncryptionContext,
            encryptedDataKeys: seq16<ESDKEncryptedDataKey>,
            contentType: Arc<ContentType>,
            frameLength: u32,
            suiteData: Sequence<u8>
        }
    }

    impl HeaderBody {
        /// Gets the field messageType for all enum members which have it
        pub fn messageType(&self) -> &Arc<MessageType> {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => messageType,
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field algorithmSuite for all enum members which have it
        pub fn algorithmSuite(&self) -> &ESDKAlgorithmSuite {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => algorithmSuite,
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => algorithmSuite,
            }
        }
        /// Gets the field messageId for all enum members which have it
        pub fn messageId(&self) -> &MessageId {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => messageId,
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => messageId,
            }
        }
        /// Gets the field encryptionContext for all enum members which have it
        pub fn encryptionContext(&self) -> &ESDKCanonicalEncryptionContext {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => encryptionContext,
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => encryptionContext,
            }
        }
        /// Gets the field encryptedDataKeys for all enum members which have it
        pub fn encryptedDataKeys(&self) -> &seq16<ESDKEncryptedDataKey> {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => encryptedDataKeys,
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => encryptedDataKeys,
            }
        }
        /// Gets the field contentType for all enum members which have it
        pub fn contentType(&self) -> &Arc<ContentType> {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => contentType,
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => contentType,
            }
        }
        /// Gets the field headerIvLength for all enum members which have it
        pub fn headerIvLength(&self) -> &u64 {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => headerIvLength,
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field frameLength for all enum members which have it
        pub fn frameLength(&self) -> &u32 {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => frameLength,
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => frameLength,
            }
        }
        /// Gets the field suiteData for all enum members which have it
        pub fn suiteData(&self) -> &Sequence<u8> {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => panic!("field does not exist on this variant"),
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => suiteData,
            }
        }
    }

    impl Debug
        for HeaderBody {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for HeaderBody {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => {
                    write!(_formatter, "HeaderTypes_Compile.HeaderBody.V1HeaderBody(")?;
                    DafnyPrint::fmt_print(messageType, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(algorithmSuite, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(messageId, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encryptedDataKeys, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(contentType, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(headerIvLength, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(frameLength, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => {
                    write!(_formatter, "HeaderTypes_Compile.HeaderBody.V2HeaderBody(")?;
                    DafnyPrint::fmt_print(algorithmSuite, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(messageId, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encryptedDataKeys, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(contentType, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(frameLength, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(suiteData, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for HeaderBody {}

    impl Hash
        for HeaderBody {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                HeaderBody::V1HeaderBody{messageType, algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, headerIvLength, frameLength, } => {
                    Hash::hash(messageType, _state);
                    Hash::hash(algorithmSuite, _state);
                    Hash::hash(messageId, _state);
                    Hash::hash(encryptionContext, _state);
                    Hash::hash(encryptedDataKeys, _state);
                    Hash::hash(contentType, _state);
                    Hash::hash(headerIvLength, _state);
                    Hash::hash(frameLength, _state)
                },
                HeaderBody::V2HeaderBody{algorithmSuite, messageId, encryptionContext, encryptedDataKeys, contentType, frameLength, suiteData, } => {
                    Hash::hash(algorithmSuite, _state);
                    Hash::hash(messageId, _state);
                    Hash::hash(encryptionContext, _state);
                    Hash::hash(encryptedDataKeys, _state);
                    Hash::hash(contentType, _state);
                    Hash::hash(frameLength, _state);
                    Hash::hash(suiteData, _state)
                },
            }
        }
    }

    impl Default
        for HeaderBody {
        fn default() -> HeaderBody {
            HeaderBody::V1HeaderBody {
                messageType: Default::default(),
                algorithmSuite: Default::default(),
                messageId: Default::default(),
                encryptionContext: Default::default(),
                encryptedDataKeys: Default::default(),
                contentType: Default::default(),
                headerIvLength: Default::default(),
                frameLength: Default::default()
            }
        }
    }

    impl AsRef<HeaderBody>
        for HeaderBody {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(90,3)
    #[derive(PartialEq, Clone)]
    pub enum HeaderAuth {
        AESMac {
            headerIv: Sequence<u8>,
            headerAuthTag: Sequence<u8>
        }
    }

    impl HeaderAuth {
        /// Returns a borrow of the field headerIv
        pub fn headerIv(&self) -> &Sequence<u8> {
            match self {
                HeaderAuth::AESMac{headerIv, headerAuthTag, } => headerIv,
            }
        }
        /// Returns a borrow of the field headerAuthTag
        pub fn headerAuthTag(&self) -> &Sequence<u8> {
            match self {
                HeaderAuth::AESMac{headerIv, headerAuthTag, } => headerAuthTag,
            }
        }
    }

    impl Debug
        for HeaderAuth {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for HeaderAuth {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                HeaderAuth::AESMac{headerIv, headerAuthTag, } => {
                    write!(_formatter, "HeaderTypes_Compile.HeaderAuth.AESMac(")?;
                    DafnyPrint::fmt_print(headerIv, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(headerAuthTag, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for HeaderAuth {}

    impl Hash
        for HeaderAuth {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                HeaderAuth::AESMac{headerIv, headerAuthTag, } => {
                    Hash::hash(headerIv, _state);
                    Hash::hash(headerAuthTag, _state)
                },
            }
        }
    }

    impl Default
        for HeaderAuth {
        fn default() -> HeaderAuth {
            HeaderAuth::AESMac {
                headerIv: Default::default(),
                headerAuthTag: Default::default()
            }
        }
    }

    impl AsRef<HeaderAuth>
        for HeaderAuth {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(96,3)
    #[derive(PartialEq, Clone)]
    pub enum MessageType {
        TYPE_CUSTOMER_AED {}
    }

    impl MessageType {
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(99,5)
        pub fn Serialize(self: &Arc<Self>) -> u8 {
            let mut _source0: Arc<MessageType> = self.clone();
            128
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(112,5)
        pub fn Get(x: u8) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<MessageType>, Sequence<DafnyCharUTF16>>> {
            let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(x == 128, &string_utf16_of("Unsupported ContentType value."));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<MessageType>>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<MessageType>, Sequence<DafnyCharUTF16>>::Success {
                        value: Arc::new(MessageType::TYPE_CUSTOMER_AED {})
                    })
            }
        }
    }

    impl Debug
        for MessageType {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for MessageType {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                MessageType::TYPE_CUSTOMER_AED{} => {
                    write!(_formatter, "HeaderTypes_Compile.MessageType.TYPE__CUSTOMER__AED")?;
                    Ok(())
                },
            }
        }
    }

    impl MessageType {
        /// Enumerates all possible values of MessageType
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<MessageType>> {
            seq![Arc::new(MessageType::TYPE_CUSTOMER_AED {})].iter()
        }
    }

    impl Eq
        for MessageType {}

    impl Hash
        for MessageType {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                MessageType::TYPE_CUSTOMER_AED{} => {

                },
            }
        }
    }

    impl Default
        for MessageType {
        fn default() -> MessageType {
            MessageType::TYPE_CUSTOMER_AED {}
        }
    }

    impl AsRef<MessageType>
        for MessageType {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(126,3)
    #[derive(PartialEq, Clone)]
    pub enum ContentType {
        NonFramed {},
        Framed {}
    }

    impl ContentType {
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(130,5)
        pub fn Serialize(self: &Arc<Self>) -> u8 {
            let mut _source0: Arc<ContentType> = self.clone();
            if matches!((&_source0).as_ref(), NonFramed{ .. }) {
                1
            } else {
                2
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(145,5)
        pub fn Get(x: u8) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ContentType>, Sequence<DafnyCharUTF16>>> {
            let mut valueOrError0: Arc<Outcome<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Sequence<DafnyCharUTF16>>(x == 1 || x == 2, &string_utf16_of("Unsupported ContentType value."));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<ContentType>>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<ContentType>, Sequence<DafnyCharUTF16>>::Success {
                        value: if x == 1 {
                                Arc::new(ContentType::NonFramed {})
                            } else {
                                Arc::new(ContentType::Framed {})
                            }
                    })
            }
        }
    }

    impl Debug
        for ContentType {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for ContentType {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                ContentType::NonFramed{} => {
                    write!(_formatter, "HeaderTypes_Compile.ContentType.NonFramed")?;
                    Ok(())
                },
                ContentType::Framed{} => {
                    write!(_formatter, "HeaderTypes_Compile.ContentType.Framed")?;
                    Ok(())
                },
            }
        }
    }

    impl ContentType {
        /// Enumerates all possible values of ContentType
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<ContentType>> {
            seq![Arc::new(ContentType::NonFramed {}), Arc::new(ContentType::Framed {})].iter()
        }
    }

    impl Eq
        for ContentType {}

    impl Hash
        for ContentType {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                ContentType::NonFramed{} => {

                },
                ContentType::Framed{} => {

                },
            }
        }
    }

    impl Default
        for ContentType {
        fn default() -> ContentType {
            ContentType::NonFramed {}
        }
    }

    impl AsRef<ContentType>
        for ContentType {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/HeaderTypes.dfy(163,3)
    pub type MessageId = Sequence<u8>;
}
/// ../mpl/StandardLibrary/src/HexStrings.dfy(6,1)
pub mod _HexStrings_Compile {
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::itertools::Itertools;
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::euclidian_modulo;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/HexStrings.dfy(12,3)
        pub fn HexChar(x: u8) -> DafnyCharUTF16 {
            if x < 10 {
                DafnyCharUTF16(48 as u16) + DafnyCharUTF16(x as u16)
            } else {
                DafnyCharUTF16(97 as u16) + DafnyCharUTF16((x - 10) as u16)
            }
        }
        /// ../mpl/StandardLibrary/src/HexStrings.dfy(24,3)
        pub fn IsLooseHexChar(ch: &DafnyCharUTF16) -> bool {
            DafnyCharUTF16(48 as u16) <= ch.clone() && ch.clone() <= DafnyCharUTF16(57 as u16) || DafnyCharUTF16(97 as u16) <= ch.clone() && ch.clone() <= DafnyCharUTF16(102 as u16) || DafnyCharUTF16(65 as u16) <= ch.clone() && ch.clone() <= DafnyCharUTF16(70 as u16)
        }
        /// ../mpl/StandardLibrary/src/HexStrings.dfy(32,3)
        pub fn IsHexChar(ch: &DafnyCharUTF16) -> bool {
            DafnyCharUTF16(48 as u16) <= ch.clone() && ch.clone() <= DafnyCharUTF16(57 as u16) || DafnyCharUTF16(97 as u16) <= ch.clone() && ch.clone() <= DafnyCharUTF16(102 as u16)
        }
        /// ../mpl/StandardLibrary/src/HexStrings.dfy(48,3)
        pub fn IsHexString(s: &Sequence<DafnyCharUTF16>) -> bool {
            Itertools::unique(s.iter()).all(({
                    let mut s = s.clone();
                    Arc::new(move |__forall_var_0: DafnyCharUTF16| -> bool{
                            let mut ch: DafnyCharUTF16 = __forall_var_0.clone();
                            !s.contains(&ch) || _default::IsHexChar(&ch)
                        })
                }).as_ref())
        }
        /// ../mpl/StandardLibrary/src/HexStrings.dfy(53,3)
        pub fn IsLooseHexString(s: &Sequence<DafnyCharUTF16>) -> bool {
            Itertools::unique(s.iter()).all(({
                    let mut s = s.clone();
                    Arc::new(move |__forall_var_0: DafnyCharUTF16| -> bool{
                            let mut ch: DafnyCharUTF16 = __forall_var_0.clone();
                            !s.contains(&ch) || _default::IsLooseHexChar(&ch)
                        })
                }).as_ref())
        }
        /// ../mpl/StandardLibrary/src/HexStrings.dfy(62,3)
        pub fn HexVal(ch: &DafnyCharUTF16) -> u8 {
            if DafnyCharUTF16(48 as u16) <= ch.clone() && ch.clone() <= DafnyCharUTF16(57 as u16) {
                ch.clone().0 as u8 - DafnyCharUTF16(48 as u16).0 as u8
            } else {
                if DafnyCharUTF16(97 as u16) <= ch.clone() && ch.clone() <= DafnyCharUTF16(102 as u16) {
                    ch.clone().0 as u8 - DafnyCharUTF16(97 as u16).0 as u8 + 10
                } else {
                    ch.clone().0 as u8 - DafnyCharUTF16(65 as u16).0 as u8 + 10
                }
            }
        }
        /// ../mpl/StandardLibrary/src/HexStrings.dfy(86,3)
        pub fn HexStr(x: u8) -> Sequence<DafnyCharUTF16> {
            if x < 16 {
                let mut res: Sequence<DafnyCharUTF16> = seq![DafnyCharUTF16(48 as u16), _default::HexChar(x)];
                res.clone()
            } else {
                let mut res: Sequence<DafnyCharUTF16> = seq![_default::HexChar(x / 16), _default::HexChar(x % 16)];
                res.clone()
            }
        }
        /// ../mpl/StandardLibrary/src/HexStrings.dfy(98,3)
        pub fn HexValue(x: &Sequence<DafnyCharUTF16>) -> u8 {
            _default::HexVal(&x.get(&int!(0))) * 16 + _default::HexVal(&x.get(&int!(1)))
        }
        /// ../mpl/StandardLibrary/src/HexStrings.dfy(115,3)
        pub fn ToHexString(val: &Sequence<u8>) -> Sequence<DafnyCharUTF16> {
            let mut _accumulator: Sequence<DafnyCharUTF16> = seq![] as Sequence<DafnyCharUTF16>;
            let mut _r0 = val.clone();
            'TAIL_CALL_START: loop {
                let val = _r0;
                if val.cardinality() == int!(0) {
                    return _accumulator.concat(&(seq![] as Sequence<DafnyCharUTF16>));
                } else {
                    _accumulator = _accumulator.concat(&_default::HexStr(val.get(&int!(0))));
                    let mut _in0: Sequence<u8> = val.drop(&int!(1));
                    _r0 = _in0.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/StandardLibrary/src/HexStrings.dfy(125,3)
        pub fn FromHexString(data: &Sequence<DafnyCharUTF16>) -> Sequence<u8> {
            let mut _accumulator: Sequence<u8> = seq![] as Sequence<u8>;
            let mut _r0 = data.clone();
            'TAIL_CALL_START: loop {
                let data = _r0;
                if data.cardinality() == int!(0) {
                    return _accumulator.concat(&(seq![] as Sequence<u8>));
                } else {
                    if euclidian_modulo(data.cardinality(), int!(2)) == int!(1) {
                        _accumulator = _accumulator.concat(&seq![_default::HexVal(&data.get(&int!(0)))]);
                        let mut _in0: Sequence<DafnyCharUTF16> = data.drop(&int!(1));
                        _r0 = _in0.clone();
                        continue 'TAIL_CALL_START;
                    } else {
                        _accumulator = _accumulator.concat(&seq![_default::HexValue(&data.take(&int!(2)))]);
                        let mut _in1: Sequence<DafnyCharUTF16> = data.drop(&int!(2));
                        _r0 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
    }

    /// ../mpl/StandardLibrary/src/HexStrings.dfy(58,3)
    pub type HexString = Sequence<DafnyCharUTF16>;

    /// ../mpl/StandardLibrary/src/HexStrings.dfy(59,3)
    pub type LooseHexString = Sequence<DafnyCharUTF16>;
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(9,1)
pub mod _IntermediateKeyWrapping_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::seq;
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::Zero;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::DafnyType;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::upcast_object;
    pub use ::dafny_runtime::cast_object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapOutput;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapInput;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExtractInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExpandInput;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(57,3)
        pub fn GetIvLengthZeros(len: i32) -> Sequence<u8> {
            if len == 12 {
                seq![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
            } else {
                {
                    let _initializer = {
                            Arc::new(move |_v0: &DafnyInt| -> u8{
                                    0
                                })
                        };
                    integer_range(Zero::zero(), int!(len)).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(69,3)
        pub fn IntermediateUnwrap<_T: DafnyType>(unwrap: &Object<dyn UnwrapMaterial<_T>>, wrappedMaterial: &Sequence<u8>, algorithmSuite: &Arc<AlgorithmSuiteInfo>, encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateUnwrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateUnwrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybeCrypto: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::AtomicPrimitives(&crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::DefaultCryptoConfig());
            maybeCrypto = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeCrypto.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<IntermediateUnwrapOutput<_T>>>());
                return res.read();
            };
            let mut cryptoPrimitivesX: Object<dyn IAwsCryptographicPrimitivesClient> = upcast_object::<AtomicPrimitivesClient, dyn IAwsCryptographicPrimitivesClient>()(valueOrError0.Extract());
            let mut cryptoPrimitives: Object<AtomicPrimitivesClient> = cast_object!(cryptoPrimitivesX.clone(), AtomicPrimitivesClient);
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DeserializedIntermediateWrappedMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DeserializeIntermediateWrappedMaterial(wrappedMaterial, algorithmSuite);
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<IntermediateUnwrapOutput<_T>>>());
                return res.read();
            };
            let mut deserializedWrapped: Arc<DeserializedIntermediateWrappedMaterial> = valueOrError1.Extract();
            let mut __let_tmp_rhs0: Arc<DeserializedIntermediateWrappedMaterial> = deserializedWrapped.clone();
            let mut encryptedPdk: Sequence<u8> = __let_tmp_rhs0.encryptedPdk().clone();
            let mut providerWrappedIkm: Sequence<u8> = __let_tmp_rhs0.providerWrappedIkm().clone();
            let mut serializedEC: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionContext);
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = Action::<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::Invoke(rd!(unwrap.clone()), &Arc::new(UnwrapInput::UnwrapInput {
                            wrappedMaterial: providerWrappedIkm.clone(),
                            algorithmSuite: algorithmSuite.clone(),
                            encryptionContext: encryptionContext.clone(),
                            serializedEC: serializedEC.clone()
                        }));
            valueOrError2 = _out1.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<IntermediateUnwrapOutput<_T>>>());
                return res.read();
            };
            let mut unwrapOutput: Arc<UnwrapOutput<_T>> = valueOrError2.Extract();
            let mut __let_tmp_rhs1: Arc<UnwrapOutput<_T>> = unwrapOutput.clone();
            let mut intermediateMaterial: Sequence<u8> = __let_tmp_rhs1.unwrappedMaterial().clone();
            let mut unwrapInfo: _T = __let_tmp_rhs1.unwrapInfo().clone();
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<PdkEncryptionAndSymmetricSigningKeys>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<PdkEncryptionAndSymmetricSigningKeys>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DeriveKeysFromIntermediateMaterial(&intermediateMaterial, algorithmSuite, encryptionContext, &cryptoPrimitives);
            valueOrError3 = _out2.clone();
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<IntermediateUnwrapOutput<_T>>>());
                return res.read();
            };
            let mut derivedKeys: Arc<PdkEncryptionAndSymmetricSigningKeys> = valueOrError3.Extract();
            let mut __let_tmp_rhs2: Arc<PdkEncryptionAndSymmetricSigningKeys> = derivedKeys.clone();
            let mut pdkEncryptionKey: Sequence<u8> = __let_tmp_rhs2.pdkEncryptionKey().clone();
            let mut symmetricSigningKey: Sequence<u8> = __let_tmp_rhs2.symmetricSigningKey().clone();
            let mut iv: Sequence<u8> = _default::GetIvLengthZeros(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptIvLength(algorithmSuite));
            let mut tagIndex: u64 = truncate!(encryptedPdk.cardinality(), u64) - crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptTagLength(algorithmSuite) as u64;
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = serializedEC.clone();
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<IntermediateUnwrapOutput<_T>>>());
                return res.read();
            };
            let mut aad: Sequence<u8> = valueOrError4.Extract();
            let mut decInput: Arc<AESDecryptInput> = Arc::new(AESDecryptInput::AESDecryptInput {
                        encAlg: algorithmSuite.encrypt().AES_GCM().clone(),
                        key: pdkEncryptionKey.clone(),
                        cipherTxt: encryptedPdk.take(&int!((&tagIndex).clone())),
                        authTag: encryptedPdk.drop(&int!((&tagIndex).clone())),
                        iv: iv.clone(),
                        aad: aad.clone()
                    });
            let mut decOutR: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESDecrypt(rd!(cryptoPrimitives.clone()), &decInput);
            decOutR = _out3.clone();
            let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = decOutR.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError5.IsFailure() {
                res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<IntermediateUnwrapOutput<_T>>>());
                return res.read();
            };
            let mut plaintextDataKey: Sequence<u8> = valueOrError5.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<IntermediateUnwrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(IntermediateUnwrapOutput::<_T>::IntermediateUnwrapOutput {
                                        plaintextDataKey: plaintextDataKey.clone(),
                                        symmetricSigningKey: symmetricSigningKey.clone(),
                                        unwrapInfo: unwrapInfo.clone()
                                    })
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(152,3)
        pub fn IntermediateWrap<_T: DafnyType>(generateAndWrap: &Object<dyn GenerateAndWrapMaterial<_T>>, plaintextDataKey: &Sequence<u8>, algorithmSuite: &Arc<AlgorithmSuiteInfo>, encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybeCrypto: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::AtomicPrimitives(&crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::DefaultCryptoConfig());
            maybeCrypto = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeCrypto.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<IntermediateWrapOutput<_T>>>());
                return res.read();
            };
            let mut cryptoPrimitivesX: Object<dyn IAwsCryptographicPrimitivesClient> = upcast_object::<AtomicPrimitivesClient, dyn IAwsCryptographicPrimitivesClient>()(valueOrError0.Extract());
            let mut cryptoPrimitives: Object<AtomicPrimitivesClient> = cast_object!(cryptoPrimitivesX.clone(), AtomicPrimitivesClient);
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = Action::<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::Invoke(rd!(generateAndWrap.clone()), &Arc::new(GenerateAndWrapInput::GenerateAndWrapInput {
                            algorithmSuite: algorithmSuite.clone(),
                            encryptionContext: encryptionContext.clone(),
                            serializedEC: crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionContext)
                        }));
            valueOrError1 = _out1.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<IntermediateWrapOutput<_T>>>());
                return res.read();
            };
            let mut generateAndWrapOutput: Arc<GenerateAndWrapOutput<_T>> = valueOrError1.Extract();
            let mut __let_tmp_rhs0: Arc<GenerateAndWrapOutput<_T>> = generateAndWrapOutput.clone();
            let mut intermediateMaterial: Sequence<u8> = __let_tmp_rhs0.plaintextMaterial().clone();
            let mut providerWrappedIkm: Sequence<u8> = __let_tmp_rhs0.wrappedMaterial().clone();
            let mut wrapInfo: _T = __let_tmp_rhs0.wrapInfo().clone();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<PdkEncryptionAndSymmetricSigningKeys>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<PdkEncryptionAndSymmetricSigningKeys>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DeriveKeysFromIntermediateMaterial(&intermediateMaterial, algorithmSuite, encryptionContext, &cryptoPrimitives);
            valueOrError2 = _out2.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<IntermediateWrapOutput<_T>>>());
                return res.read();
            };
            let mut derivedKeys: Arc<PdkEncryptionAndSymmetricSigningKeys> = valueOrError2.Extract();
            let mut __let_tmp_rhs1: Arc<PdkEncryptionAndSymmetricSigningKeys> = derivedKeys.clone();
            let mut pdkEncryptionKey: Sequence<u8> = __let_tmp_rhs1.pdkEncryptionKey().clone();
            let mut symmetricSigningKey: Sequence<u8> = __let_tmp_rhs1.symmetricSigningKey().clone();
            let mut iv: Sequence<u8> = _default::GetIvLengthZeros(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptIvLength(algorithmSuite));
            let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(encryptionContext);
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<IntermediateWrapOutput<_T>>>());
                return res.read();
            };
            let mut aad: Sequence<u8> = valueOrError3.Extract();
            let mut encInput: Arc<AESEncryptInput> = Arc::new(AESEncryptInput::AESEncryptInput {
                        encAlg: algorithmSuite.encrypt().AES_GCM().clone(),
                        iv: iv.clone(),
                        key: pdkEncryptionKey.clone(),
                        msg: plaintextDataKey.clone(),
                        aad: aad.clone()
                    });
            let mut encOutR: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESEncrypt(rd!(cryptoPrimitives.clone()), &encInput);
            encOutR = _out3.clone();
            let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = encOutR.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<IntermediateWrapOutput<_T>>>());
                return res.read();
            };
            let mut encryptedPdk: Arc<AESEncryptOutput> = valueOrError4.Extract();
            let mut serializedMaterial: Sequence<u8> = encryptedPdk.cipherText().concat(encryptedPdk.authTag()).concat(&providerWrappedIkm);
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<IntermediateWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(IntermediateWrapOutput::<_T>::IntermediateWrapOutput {
                                        wrappedMaterial: serializedMaterial.clone(),
                                        symmetricSigningKey: symmetricSigningKey.clone(),
                                        wrapInfo: wrapInfo.clone()
                                    })
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(255,3)
        pub fn IntermediateGenerateAndWrap<_T: DafnyType>(generateAndWrap: &Object<dyn GenerateAndWrapMaterial<_T>>, algorithmSuite: &Arc<AlgorithmSuiteInfo>, encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateGenerateAndWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateGenerateAndWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybeCrypto: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::AtomicPrimitives(&crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::_default::DefaultCryptoConfig());
            maybeCrypto = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Object<AtomicPrimitivesClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeCrypto.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<IntermediateGenerateAndWrapOutput<_T>>>());
                return res.read();
            };
            let mut cryptoPrimitives: Object<AtomicPrimitivesClient> = valueOrError0.Extract();
            let mut generateBytesResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(cryptoPrimitives.clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                            length: crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(algorithmSuite)
                        }));
            generateBytesResult = _out1.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = generateBytesResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<IntermediateGenerateAndWrapOutput<_T>>>());
                return res.read();
            };
            let mut plaintextDataKey: Sequence<u8> = valueOrError1.Extract();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<IntermediateWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::IntermediateWrap::<_T>(generateAndWrap, &plaintextDataKey, algorithmSuite, encryptionContext);
            valueOrError2 = _out2.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<IntermediateGenerateAndWrapOutput<_T>>>());
                return res.read();
            };
            let mut wrapOutput: Arc<IntermediateWrapOutput<_T>> = valueOrError2.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<IntermediateGenerateAndWrapOutput<_T>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(IntermediateGenerateAndWrapOutput::<_T>::IntermediateGenerateAndWrapOutput {
                                        plaintextDataKey: plaintextDataKey.clone(),
                                        wrappedMaterial: wrapOutput.wrappedMaterial().clone(),
                                        symmetricSigningKey: wrapOutput.symmetricSigningKey().clone(),
                                        wrapInfo: wrapOutput.wrapInfo().clone()
                                    })
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(310,3)
        pub fn DeserializeIntermediateWrappedMaterial(material: &Sequence<u8>, algSuite: &Arc<AlgorithmSuiteInfo>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DeserializedIntermediateWrappedMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(material.cardinality(), u64) >= (crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(algSuite) + crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptTagLength(algSuite)) as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Unable to deserialize Intermediate Key Wrapped material: too short.")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<DeserializedIntermediateWrappedMaterial>>()
            } else {
                let mut encryptedPdkLen: i32 = crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(algSuite) + crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptTagLength(algSuite);
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<DeserializedIntermediateWrappedMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                        value: Arc::new(DeserializedIntermediateWrappedMaterial::DeserializedIntermediateWrappedMaterial {
                                    encryptedPdk: material.take(&int!((&encryptedPdkLen).clone())),
                                    providerWrappedIkm: material.drop(&int!((&encryptedPdkLen).clone()))
                                })
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(329,3)
        pub fn DeriveKeysFromIntermediateMaterial(intermediateMaterial: &Sequence<u8>, algorithmSuite: &Arc<AlgorithmSuiteInfo>, encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<PdkEncryptionAndSymmetricSigningKeys>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<PdkEncryptionAndSymmetricSigningKeys>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut hkdfExtractInput: Arc<HkdfExtractInput> = Arc::new(HkdfExtractInput::HkdfExtractInput {
                        digestAlgorithm: algorithmSuite.commitment().HKDF().hmac().clone(),
                        salt: Arc::new(Option::<Sequence<u8>>::None {}),
                        ikm: intermediateMaterial.clone()
                    });
            let mut maybePseudoRandomKey: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::HkdfExtract(rd!(cryptoPrimitives.clone()), &hkdfExtractInput);
            maybePseudoRandomKey = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybePseudoRandomKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<PdkEncryptionAndSymmetricSigningKeys>>());
                return res.read();
            };
            let mut pseudoRandomKey: Sequence<u8> = valueOrError0.Extract();
            let mut symmetricSigningKeyInput: Arc<HkdfExpandInput> = Arc::new(HkdfExpandInput::HkdfExpandInput {
                        digestAlgorithm: algorithmSuite.commitment().HKDF().hmac().clone(),
                        prk: pseudoRandomKey.clone(),
                        info: _default::KEYWRAP_MAC_INFO(),
                        expectedLength: algorithmSuite.commitment().HKDF().outputKeyLength().clone()
                    });
            let mut pdkEncryptionKeyInput: Arc<HkdfExpandInput>;
            let mut _dt__update__tmp_h0: Arc<HkdfExpandInput> = symmetricSigningKeyInput.clone();
            let mut _dt__update_hinfo_h0: Sequence<u8> = _default::KEYWRAP_ENC_INFO();
            pdkEncryptionKeyInput = Arc::new(HkdfExpandInput::HkdfExpandInput {
                        digestAlgorithm: _dt__update__tmp_h0.digestAlgorithm().clone(),
                        prk: _dt__update__tmp_h0.prk().clone(),
                        info: _dt__update_hinfo_h0.clone(),
                        expectedLength: _dt__update__tmp_h0.expectedLength().clone()
                    });
            let mut maybeSymmetricSigningKey: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::HkdfExpand(rd!(cryptoPrimitives.clone()), &symmetricSigningKeyInput);
            maybeSymmetricSigningKey = _out1.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeSymmetricSigningKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<PdkEncryptionAndSymmetricSigningKeys>>());
                return res.read();
            };
            let mut symmetricSigningKey: Sequence<u8> = valueOrError1.Extract();
            let mut maybePdkEncryptionKey: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::HkdfExpand(rd!(cryptoPrimitives.clone()), &pdkEncryptionKeyInput);
            maybePdkEncryptionKey = _out2.clone();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybePdkEncryptionKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<PdkEncryptionAndSymmetricSigningKeys>>());
                return res.read();
            };
            let mut pdkEncryptionKey: Sequence<u8> = valueOrError2.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<PdkEncryptionAndSymmetricSigningKeys>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(PdkEncryptionAndSymmetricSigningKeys::PdkEncryptionAndSymmetricSigningKeys {
                                        pdkEncryptionKey: pdkEncryptionKey.clone(),
                                        symmetricSigningKey: symmetricSigningKey.clone()
                                    })
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(25,3)
        pub fn KEYWRAP_MAC_INFO() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![65, 87, 83, 95, 77, 80, 76, 95, 73, 78, 84, 69, 82, 77, 69, 68, 73, 65, 84, 69, 95, 75, 69, 89, 87, 82, 65, 80, 95, 77, 65, 67];
            s.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(30,3)
        pub fn KEYWRAP_ENC_INFO() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![65, 87, 83, 95, 77, 80, 76, 95, 73, 78, 84, 69, 82, 77, 69, 68, 73, 65, 84, 69, 95, 75, 69, 89, 87, 82, 65, 80, 95, 69, 78, 67];
            s.clone()
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(35,3)
    #[derive(PartialEq, Clone)]
    pub enum IntermediateUnwrapOutput<T: DafnyType> {
        IntermediateUnwrapOutput {
            plaintextDataKey: Sequence<u8>,
            symmetricSigningKey: Sequence<u8>,
            unwrapInfo: T
        }
    }

    impl<T: DafnyType> IntermediateUnwrapOutput<T> {
        /// Returns a borrow of the field plaintextDataKey
        pub fn plaintextDataKey(&self) -> &Sequence<u8> {
            match self {
                IntermediateUnwrapOutput::IntermediateUnwrapOutput{plaintextDataKey, symmetricSigningKey, unwrapInfo, } => plaintextDataKey,
            }
        }
        /// Returns a borrow of the field symmetricSigningKey
        pub fn symmetricSigningKey(&self) -> &Sequence<u8> {
            match self {
                IntermediateUnwrapOutput::IntermediateUnwrapOutput{plaintextDataKey, symmetricSigningKey, unwrapInfo, } => symmetricSigningKey,
            }
        }
        /// Returns a borrow of the field unwrapInfo
        pub fn unwrapInfo(&self) -> &T {
            match self {
                IntermediateUnwrapOutput::IntermediateUnwrapOutput{plaintextDataKey, symmetricSigningKey, unwrapInfo, } => unwrapInfo,
            }
        }
    }

    impl<T: DafnyType> Debug
        for IntermediateUnwrapOutput<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for IntermediateUnwrapOutput<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                IntermediateUnwrapOutput::IntermediateUnwrapOutput{plaintextDataKey, symmetricSigningKey, unwrapInfo, } => {
                    write!(_formatter, "IntermediateKeyWrapping_Compile.IntermediateUnwrapOutput.IntermediateUnwrapOutput(")?;
                    DafnyPrint::fmt_print(plaintextDataKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(symmetricSigningKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(unwrapInfo, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType + Eq> Eq
        for IntermediateUnwrapOutput<T> {}

    impl<T: DafnyType + Hash> Hash
        for IntermediateUnwrapOutput<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                IntermediateUnwrapOutput::IntermediateUnwrapOutput{plaintextDataKey, symmetricSigningKey, unwrapInfo, } => {
                    Hash::hash(plaintextDataKey, _state);
                    Hash::hash(symmetricSigningKey, _state);
                    Hash::hash(unwrapInfo, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for IntermediateUnwrapOutput<T> {
        fn default() -> IntermediateUnwrapOutput<T> {
            IntermediateUnwrapOutput::IntermediateUnwrapOutput {
                plaintextDataKey: Default::default(),
                symmetricSigningKey: Default::default(),
                unwrapInfo: Default::default()
            }
        }
    }

    impl<T: DafnyType> AsRef<IntermediateUnwrapOutput<T>>
        for IntermediateUnwrapOutput<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(42,3)
    #[derive(PartialEq, Clone)]
    pub enum IntermediateGenerateAndWrapOutput<T: DafnyType> {
        IntermediateGenerateAndWrapOutput {
            plaintextDataKey: Sequence<u8>,
            wrappedMaterial: Sequence<u8>,
            symmetricSigningKey: Sequence<u8>,
            wrapInfo: T
        }
    }

    impl<T: DafnyType> IntermediateGenerateAndWrapOutput<T> {
        /// Returns a borrow of the field plaintextDataKey
        pub fn plaintextDataKey(&self) -> &Sequence<u8> {
            match self {
                IntermediateGenerateAndWrapOutput::IntermediateGenerateAndWrapOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => plaintextDataKey,
            }
        }
        /// Returns a borrow of the field wrappedMaterial
        pub fn wrappedMaterial(&self) -> &Sequence<u8> {
            match self {
                IntermediateGenerateAndWrapOutput::IntermediateGenerateAndWrapOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => wrappedMaterial,
            }
        }
        /// Returns a borrow of the field symmetricSigningKey
        pub fn symmetricSigningKey(&self) -> &Sequence<u8> {
            match self {
                IntermediateGenerateAndWrapOutput::IntermediateGenerateAndWrapOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => symmetricSigningKey,
            }
        }
        /// Returns a borrow of the field wrapInfo
        pub fn wrapInfo(&self) -> &T {
            match self {
                IntermediateGenerateAndWrapOutput::IntermediateGenerateAndWrapOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => wrapInfo,
            }
        }
    }

    impl<T: DafnyType> Debug
        for IntermediateGenerateAndWrapOutput<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for IntermediateGenerateAndWrapOutput<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                IntermediateGenerateAndWrapOutput::IntermediateGenerateAndWrapOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => {
                    write!(_formatter, "IntermediateKeyWrapping_Compile.IntermediateGenerateAndWrapOutput.IntermediateGenerateAndWrapOutput(")?;
                    DafnyPrint::fmt_print(plaintextDataKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(wrappedMaterial, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(symmetricSigningKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(wrapInfo, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType + Eq> Eq
        for IntermediateGenerateAndWrapOutput<T> {}

    impl<T: DafnyType + Hash> Hash
        for IntermediateGenerateAndWrapOutput<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                IntermediateGenerateAndWrapOutput::IntermediateGenerateAndWrapOutput{plaintextDataKey, wrappedMaterial, symmetricSigningKey, wrapInfo, } => {
                    Hash::hash(plaintextDataKey, _state);
                    Hash::hash(wrappedMaterial, _state);
                    Hash::hash(symmetricSigningKey, _state);
                    Hash::hash(wrapInfo, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for IntermediateGenerateAndWrapOutput<T> {
        fn default() -> IntermediateGenerateAndWrapOutput<T> {
            IntermediateGenerateAndWrapOutput::IntermediateGenerateAndWrapOutput {
                plaintextDataKey: Default::default(),
                wrappedMaterial: Default::default(),
                symmetricSigningKey: Default::default(),
                wrapInfo: Default::default()
            }
        }
    }

    impl<T: DafnyType> AsRef<IntermediateGenerateAndWrapOutput<T>>
        for IntermediateGenerateAndWrapOutput<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(50,3)
    #[derive(PartialEq, Clone)]
    pub enum IntermediateWrapOutput<T: DafnyType> {
        IntermediateWrapOutput {
            wrappedMaterial: Sequence<u8>,
            symmetricSigningKey: Sequence<u8>,
            wrapInfo: T
        }
    }

    impl<T: DafnyType> IntermediateWrapOutput<T> {
        /// Returns a borrow of the field wrappedMaterial
        pub fn wrappedMaterial(&self) -> &Sequence<u8> {
            match self {
                IntermediateWrapOutput::IntermediateWrapOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => wrappedMaterial,
            }
        }
        /// Returns a borrow of the field symmetricSigningKey
        pub fn symmetricSigningKey(&self) -> &Sequence<u8> {
            match self {
                IntermediateWrapOutput::IntermediateWrapOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => symmetricSigningKey,
            }
        }
        /// Returns a borrow of the field wrapInfo
        pub fn wrapInfo(&self) -> &T {
            match self {
                IntermediateWrapOutput::IntermediateWrapOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => wrapInfo,
            }
        }
    }

    impl<T: DafnyType> Debug
        for IntermediateWrapOutput<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for IntermediateWrapOutput<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                IntermediateWrapOutput::IntermediateWrapOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => {
                    write!(_formatter, "IntermediateKeyWrapping_Compile.IntermediateWrapOutput.IntermediateWrapOutput(")?;
                    DafnyPrint::fmt_print(wrappedMaterial, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(symmetricSigningKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(wrapInfo, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType + Eq> Eq
        for IntermediateWrapOutput<T> {}

    impl<T: DafnyType + Hash> Hash
        for IntermediateWrapOutput<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                IntermediateWrapOutput::IntermediateWrapOutput{wrappedMaterial, symmetricSigningKey, wrapInfo, } => {
                    Hash::hash(wrappedMaterial, _state);
                    Hash::hash(symmetricSigningKey, _state);
                    Hash::hash(wrapInfo, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for IntermediateWrapOutput<T> {
        fn default() -> IntermediateWrapOutput<T> {
            IntermediateWrapOutput::IntermediateWrapOutput {
                wrappedMaterial: Default::default(),
                symmetricSigningKey: Default::default(),
                wrapInfo: Default::default()
            }
        }
    }

    impl<T: DafnyType> AsRef<IntermediateWrapOutput<T>>
        for IntermediateWrapOutput<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(303,3)
    #[derive(PartialEq, Clone)]
    pub enum DeserializedIntermediateWrappedMaterial {
        DeserializedIntermediateWrappedMaterial {
            encryptedPdk: Sequence<u8>,
            providerWrappedIkm: Sequence<u8>
        }
    }

    impl DeserializedIntermediateWrappedMaterial {
        /// Returns a borrow of the field encryptedPdk
        pub fn encryptedPdk(&self) -> &Sequence<u8> {
            match self {
                DeserializedIntermediateWrappedMaterial::DeserializedIntermediateWrappedMaterial{encryptedPdk, providerWrappedIkm, } => encryptedPdk,
            }
        }
        /// Returns a borrow of the field providerWrappedIkm
        pub fn providerWrappedIkm(&self) -> &Sequence<u8> {
            match self {
                DeserializedIntermediateWrappedMaterial::DeserializedIntermediateWrappedMaterial{encryptedPdk, providerWrappedIkm, } => providerWrappedIkm,
            }
        }
    }

    impl Debug
        for DeserializedIntermediateWrappedMaterial {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for DeserializedIntermediateWrappedMaterial {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                DeserializedIntermediateWrappedMaterial::DeserializedIntermediateWrappedMaterial{encryptedPdk, providerWrappedIkm, } => {
                    write!(_formatter, "IntermediateKeyWrapping_Compile.DeserializedIntermediateWrappedMaterial.DeserializedIntermediateWrappedMaterial(")?;
                    DafnyPrint::fmt_print(encryptedPdk, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(providerWrappedIkm, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for DeserializedIntermediateWrappedMaterial {}

    impl Hash
        for DeserializedIntermediateWrappedMaterial {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                DeserializedIntermediateWrappedMaterial::DeserializedIntermediateWrappedMaterial{encryptedPdk, providerWrappedIkm, } => {
                    Hash::hash(encryptedPdk, _state);
                    Hash::hash(providerWrappedIkm, _state)
                },
            }
        }
    }

    impl Default
        for DeserializedIntermediateWrappedMaterial {
        fn default() -> DeserializedIntermediateWrappedMaterial {
            DeserializedIntermediateWrappedMaterial::DeserializedIntermediateWrappedMaterial {
                encryptedPdk: Default::default(),
                providerWrappedIkm: Default::default()
            }
        }
    }

    impl AsRef<DeserializedIntermediateWrappedMaterial>
        for DeserializedIntermediateWrappedMaterial {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/IntermediateKeyWrapping.dfy(324,3)
    #[derive(PartialEq, Clone)]
    pub enum PdkEncryptionAndSymmetricSigningKeys {
        PdkEncryptionAndSymmetricSigningKeys {
            pdkEncryptionKey: Sequence<u8>,
            symmetricSigningKey: Sequence<u8>
        }
    }

    impl PdkEncryptionAndSymmetricSigningKeys {
        /// Returns a borrow of the field pdkEncryptionKey
        pub fn pdkEncryptionKey(&self) -> &Sequence<u8> {
            match self {
                PdkEncryptionAndSymmetricSigningKeys::PdkEncryptionAndSymmetricSigningKeys{pdkEncryptionKey, symmetricSigningKey, } => pdkEncryptionKey,
            }
        }
        /// Returns a borrow of the field symmetricSigningKey
        pub fn symmetricSigningKey(&self) -> &Sequence<u8> {
            match self {
                PdkEncryptionAndSymmetricSigningKeys::PdkEncryptionAndSymmetricSigningKeys{pdkEncryptionKey, symmetricSigningKey, } => symmetricSigningKey,
            }
        }
    }

    impl Debug
        for PdkEncryptionAndSymmetricSigningKeys {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for PdkEncryptionAndSymmetricSigningKeys {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                PdkEncryptionAndSymmetricSigningKeys::PdkEncryptionAndSymmetricSigningKeys{pdkEncryptionKey, symmetricSigningKey, } => {
                    write!(_formatter, "IntermediateKeyWrapping_Compile.PdkEncryptionAndSymmetricSigningKeys.PdkEncryptionAndSymmetricSigningKeys(")?;
                    DafnyPrint::fmt_print(pdkEncryptionKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(symmetricSigningKey, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for PdkEncryptionAndSymmetricSigningKeys {}

    impl Hash
        for PdkEncryptionAndSymmetricSigningKeys {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                PdkEncryptionAndSymmetricSigningKeys::PdkEncryptionAndSymmetricSigningKeys{pdkEncryptionKey, symmetricSigningKey, } => {
                    Hash::hash(pdkEncryptionKey, _state);
                    Hash::hash(symmetricSigningKey, _state)
                },
            }
        }
    }

    impl Default
        for PdkEncryptionAndSymmetricSigningKeys {
        fn default() -> PdkEncryptionAndSymmetricSigningKeys {
            PdkEncryptionAndSymmetricSigningKeys::PdkEncryptionAndSymmetricSigningKeys {
                pdkEncryptionKey: Default::default(),
                symmetricSigningKey: Default::default()
            }
        }
    }

    impl AsRef<PdkEncryptionAndSymmetricSigningKeys>
        for PdkEncryptionAndSymmetricSigningKeys {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
pub mod _JSON_Compile {
    /// ../mpl/libraries/src/JSON/API.dfy(8,1)
    pub mod _API_Compile {
        pub use ::std::sync::Arc;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON;
        pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
        pub use ::dafny_runtime::Sequence;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::SerializationError;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
        pub use ::dafny_runtime::Object;
        pub use ::dafny_runtime::MaybePlacebo;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;

        pub struct _default {}

        impl _default {
            /// ../mpl/libraries/src/JSON/API.dfy(16,3)
            pub fn Serialize(js: &Arc<JSON>) -> Arc<Result<Sequence<u8>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Arc<Structural<Arc<Value>>>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::JSON(js);
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Sequence<u8>>()
                } else {
                    let mut js: Arc<Structural<Arc<Value>>> = valueOrError0.Extract();
                    crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_API_Compile::_default::Serialize(&js)
                }
            }
            /// ../mpl/libraries/src/JSON/API.dfy(22,3)
            pub fn SerializeAlloc(js: &Arc<JSON>) -> Arc<Result<Object<[u8]>, Arc<SerializationError>>> {
                let mut bs = MaybePlacebo::<Arc<Result<Object<[u8]>, Arc<SerializationError>>>>::new();
                let mut valueOrError0: Arc<Result<Arc<Structural<Arc<Value>>>, Arc<SerializationError>>>;
                valueOrError0 = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::JSON(js);
                if valueOrError0.IsFailure() {
                    bs = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<[u8]>>());
                    return bs.read();
                };
                let mut js: Arc<Structural<Arc<Value>>> = valueOrError0.Extract();
                let mut _out0: Arc<Result<Object<[u8]>, Arc<SerializationError>>>;
                _out0 = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_API_Compile::_default::SerializeAlloc(&js);
                bs = MaybePlacebo::from(_out0.clone());
                return bs.read();
            }
            /// ../mpl/libraries/src/JSON/API.dfy(28,3)
            pub fn SerializeInto(js: &Arc<JSON>, bs: &Object<[u8]>) -> Arc<Result<u32, Arc<SerializationError>>> {
                let mut len = MaybePlacebo::<Arc<Result<u32, Arc<SerializationError>>>>::new();
                let mut valueOrError0: Arc<Result<Arc<Structural<Arc<Value>>>, Arc<SerializationError>>>;
                valueOrError0 = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::JSON(js);
                if valueOrError0.IsFailure() {
                    len = MaybePlacebo::from(valueOrError0.PropagateFailure::<u32>());
                    return len.read();
                };
                let mut js: Arc<Structural<Arc<Value>>> = valueOrError0.Extract();
                let mut _out0: Arc<Result<u32, Arc<SerializationError>>>;
                _out0 = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_API_Compile::_default::SerializeInto(&js, bs);
                len = MaybePlacebo::from(_out0.clone());
                return len.read();
            }
            /// ../mpl/libraries/src/JSON/API.dfy(35,3)
            pub fn Deserialize(bs: &Sequence<u8>) -> Arc<Result<Arc<JSON>, Arc<DeserializationError>>> {
                let mut valueOrError0: Arc<Result<Arc<Structural<Arc<Value>>>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_API_Compile::_default::Deserialize(bs);
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<JSON>>()
                } else {
                    let mut js: Arc<Structural<Arc<Value>>> = valueOrError0.Extract();
                    crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::JSON(&js)
                }
            }
        }
    }

    pub mod _ConcreteSyntax_Compile {
        /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(5,1)
        pub mod _Spec_Compile {
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
            pub use ::dafny_runtime::Sequence;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_;
            pub use ::dafny_runtime::DafnyType;
            pub use ::std::sync::Arc;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
            pub use ::std::marker::Sync;
            pub use ::std::marker::Send;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe::Empty;
            pub use ::dafny_runtime::seq;
            pub use ::dafny_runtime::int;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Suffixed;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jKeyValue;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jfrac;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jexp;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnumber;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbrace;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbrace;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbracket;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbracket;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Null;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnull;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Bool;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jbool;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::String;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Number;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Object;

            pub struct _default {}

            impl _default {
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(11,3)
                pub fn View(v: &View) -> Sequence<u8> {
                    View_::Bytes(v)
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(15,3)
                pub fn Structural<_T: DafnyType>(_self: &Arc<Structural<_T>>, fT: &Arc<dyn ::std::ops::Fn(&_T) -> Sequence<u8> + Sync + Send>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.before()).concat(&fT(_self.t())).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.after()))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(19,3)
                pub fn StructuralView(_self: &Arc<Structural<View>>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Structural::<View>(_self, &(Arc::new(move |x0: &View| crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(23,3)
                pub fn Maybe<_T: DafnyType>(_self: &Arc<Maybe<_T>>, fT: &Arc<dyn ::std::ops::Fn(&_T) -> Sequence<u8> + Sync + Send>) -> Sequence<u8> {
                    if matches!(_self.as_ref(), Empty{ .. }) {
                        seq![] as Sequence<u8>
                    } else {
                        fT(_self.t())
                    }
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(30,3)
                pub fn ConcatBytes<_T: DafnyType>(ts: &Sequence<_T>, fT: &Arc<dyn ::std::ops::Fn(&_T) -> Sequence<u8> + Sync + Send>) -> Sequence<u8> {
                    let mut _accumulator: Sequence<u8> = seq![] as Sequence<u8>;
                    let mut _r0 = ts.clone();
                    let mut _r1 = fT.clone();
                    'TAIL_CALL_START: loop {
                        let ts = _r0;
                        let fT = _r1;
                        if ts.cardinality() == int!(0) {
                            return _accumulator.concat(&(seq![] as Sequence<u8>));
                        } else {
                            _accumulator = _accumulator.concat(&(&fT)(&ts.get(&int!(0))));
                            let mut _in0: Sequence<_T> = ts.drop(&int!(1));
                            let mut _in1: Arc<dyn ::std::ops::Fn(&_T) -> Sequence<u8> + Sync + Send> = fT.clone();
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            continue 'TAIL_CALL_START;
                        }
                    }
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(37,3)
                pub fn Bracketed<_D: DafnyType, _S: DafnyType>(_self: &Arc<Bracketed<View, _D, _S, View>>, fDatum: &Arc<dyn ::std::ops::Fn(&Arc<Suffixed<_D, _S>>) -> Sequence<u8> + Sync + Send>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::StructuralView(_self.l()).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::ConcatBytes::<Arc<Suffixed<_D, _S>>>(_self.data(), fDatum)).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::StructuralView(_self.r()))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(45,3)
                pub fn KeyValue(_self: &Arc<jKeyValue>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::String(_self.k()).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::StructuralView(_self.colon())).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Value(_self.v()))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(49,3)
                pub fn Frac(_self: &Arc<jfrac>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.period()).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.num()))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(53,3)
                pub fn Exp(_self: &Arc<jexp>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.e()).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.sign())).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.num()))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(57,3)
                pub fn Number(_self: &Arc<jnumber>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.minus()).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.num())).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Maybe::<Arc<jfrac>>(_self.frac(), &(Arc::new(move |x0: &Arc<jfrac>| crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Frac(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>))).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Maybe::<Arc<jexp>>(_self.exp(), &(Arc::new(move |x0: &Arc<jexp>| crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Exp(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>)))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(61,3)
                pub fn String(_self: &Arc<jstring>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.lq()).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.contents())).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(_self.rq()))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(65,3)
                pub fn CommaSuffix(c: &Arc<Maybe<Arc<Structural<jcomma>>>>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Maybe::<Arc<Structural<View>>>(c, &(Arc::new(move |x0: &Arc<Structural<View>>| crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::StructuralView(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(70,3)
                pub fn Member(_self: &Arc<Suffixed<Arc<jKeyValue>, jcomma>>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::KeyValue(_self.t()).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::CommaSuffix(_self.suffix()))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(74,3)
                pub fn Item(_self: &Arc<Suffixed<Arc<Value>, jcomma>>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Value(_self.t()).concat(&crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::CommaSuffix(_self.suffix()))
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(78,3)
                pub fn Object(obj: &Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Bracketed::<Arc<jKeyValue>, jcomma>(obj, {
                            let obj: Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>> = obj.clone();
                            &({
                                Arc::new(move |d: &Arc<Suffixed<Arc<jKeyValue>, jcomma>>| -> Sequence<u8>{
                                        crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Member(d)
                                    })
                            })
                        })
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(82,3)
                pub fn Array(arr: &Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Bracketed::<Arc<Value>, jcomma>(arr, {
                            let arr: Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>> = arr.clone();
                            &({
                                Arc::new(move |d: &Arc<Suffixed<Arc<Value>, jcomma>>| -> Sequence<u8>{
                                        crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Item(d)
                                    })
                            })
                        })
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(86,3)
                pub fn Value(_self: &Arc<Value>) -> Sequence<u8> {
                    let mut _source0: Arc<Value> = _self.clone();
                    if matches!((&_source0).as_ref(), Null{ .. }) {
                        let mut ___mcc_h0: jnull = _source0.n().clone();
                        let mut n: jnull = ___mcc_h0.clone();
                        crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(&n)
                    } else {
                        if matches!((&_source0).as_ref(), Bool{ .. }) {
                            let mut ___mcc_h1: jbool = _source0.b().clone();
                            let mut b: jbool = ___mcc_h1.clone();
                            crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(&b)
                        } else {
                            if matches!((&_source0).as_ref(), String{ .. }) {
                                let mut ___mcc_h2: Arc<jstring> = _source0.str().clone();
                                let mut str: Arc<jstring> = ___mcc_h2.clone();
                                crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::String(&str)
                            } else {
                                if matches!((&_source0).as_ref(), Number{ .. }) {
                                    let mut ___mcc_h3: Arc<jnumber> = _source0.num().clone();
                                    let mut num: Arc<jnumber> = ___mcc_h3.clone();
                                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Number(&num)
                                } else {
                                    if matches!((&_source0).as_ref(), Object{ .. }) {
                                        let mut ___mcc_h4: Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>> = _source0.obj().clone();
                                        let mut obj: Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>> = ___mcc_h4.clone();
                                        crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Object(&obj)
                                    } else {
                                        let mut ___mcc_h5: Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>> = _source0.arr().clone();
                                        let mut arr: Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>> = ___mcc_h5.clone();
                                        crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Array(&arr)
                                    }
                                }
                            }
                        }
                    }
                }
                /// ../mpl/libraries/src/JSON/ConcreteSyntax.Spec.dfy(118,3)
                pub fn JSON(js: &Arc<Structural<Arc<Value>>>) -> Sequence<u8> {
                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Structural::<Arc<Value>>(js, &(Arc::new(move |x0: &Arc<Value>| crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Value(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>))
                }
            }
        }

        /// Some useful properties about the functions used in `ConcreteSyntax.Spec`.
        /// ../mpl/libraries/src/JSON/ConcreteSyntax.SpecProperties.dfy(6,1)
        pub mod _SpecProperties_Compile {

        }
    }

    /// ../mpl/libraries/src/JSON/Deserializer.dfy(20,1)
    pub mod _Deserializer_Compile {
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jbool;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_;
        pub use ::dafny_runtime::truncate;
        pub use ::dafny_runtime::int;
        pub use ::dafny_runtime::DafnyCharUTF16;
        pub use ::dafny_runtime::Sequence;
        pub use ::std::sync::Arc;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
        pub use ::dafny_runtime::string_utf16_of;
        pub use ::dafny_runtime::_System::nat;
        pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
        pub use ::dafny_runtime::itertools::Itertools;
        pub use ::dafny_runtime::DafnyInt;
        pub use ::dafny_runtime::seq;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jsign;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnum;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnumber;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::Decimal;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jminus;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jfrac;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jexp;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe::Empty;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::je;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jperiod;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jKeyValue;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbrace;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbrace;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Suffixed;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbracket;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbracket;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Null;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnull;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Bool;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::String;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Number;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Object;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
        pub use ::dafny_runtime::Map;
        pub use ::dafny_runtime::map;

        pub struct _default {}

        impl _default {
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(37,3)
            pub fn Bool(js: &jbool) -> bool {
                View_::At(js, truncate!(int!(0), u32)) == DafnyCharUTF16(116 as u16).0 as u8
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(42,3)
            pub fn UnsupportedEscape16(code: &Sequence<u16>) -> Arc<DeserializationError> {
                Arc::new(DeserializationError::UnsupportedEscape {
                        str: crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::FromUTF16Checked(code).UnwrapOr(&string_utf16_of("Couldn't decode UTF-16"))
                    })
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(60,3)
            pub fn ToNat16(str: &Sequence<u16>) -> u16 {
                let mut hd: nat = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_Uint16StrConversion_Compile::_default::ToNat_any(str, &int!(16), &crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::HEX_TABLE_16());
                truncate!(hd.clone(), u16)
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(70,3)
            pub fn Unescape(str: &Sequence<u16>, start: &nat, prefix: &Sequence<u16>) -> Arc<Result<Sequence<u16>, Arc<DeserializationError>>> {
                let mut _r0 = str.clone();
                let mut _r1 = start.clone();
                let mut _r2 = prefix.clone();
                'TAIL_CALL_START: loop {
                    let str = _r0;
                    let start = _r1;
                    let prefix = _r2;
                    if !(start.clone() < str.cardinality()) {
                        return Arc::new(Result::<Sequence<u16>, Arc<DeserializationError>>::Success {
                                    value: prefix.clone()
                                });
                    } else {
                        if str.get(&start) == DafnyCharUTF16(92 as u16).0 as u16 {
                            if str.cardinality() == start.clone() + int!(1) {
                                return Arc::new(Result::<Sequence<u16>, Arc<DeserializationError>>::Failure {
                                            error: Arc::new(DeserializationError::EscapeAtEOS {})
                                        });
                            } else {
                                let mut c: u16 = str.get(&(start.clone() + int!(1)));
                                if c == DafnyCharUTF16(117 as u16).0 as u16 {
                                    if str.cardinality() < start.clone() + int!(6) {
                                        return Arc::new(Result::<Sequence<u16>, Arc<DeserializationError>>::Failure {
                                                    error: Arc::new(DeserializationError::EscapeAtEOS {})
                                                });
                                    } else {
                                        let mut code: Sequence<u16> = str.slice(&(start.clone() + int!(2)), &(start.clone() + int!(6)));
                                        if Itertools::unique((&code).iter()).any(({
                                                    let mut code = code.clone();
                                                    Arc::new(move |__exists_var_0: u16| -> bool{
                                                            let mut c: u16 = __exists_var_0;
                                                            code.contains(&c) && !crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::HEX_TABLE_16().contains(&c)
                                                        })
                                                }).as_ref()) {
                                            return Arc::new(Result::<Sequence<u16>, Arc<DeserializationError>>::Failure {
                                                        error: crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::UnsupportedEscape16(&code)
                                                    });
                                        } else {
                                            let mut hd: u16 = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::ToNat16(&code);
                                            let mut _in0: Sequence<u16> = str.clone();
                                            let mut _in1: DafnyInt = start.clone() + int!(6);
                                            let mut _in2: Sequence<u16> = prefix.concat(&seq![hd]);
                                            _r0 = _in0.clone();
                                            _r1 = _in1.clone();
                                            _r2 = _in2.clone();
                                            continue 'TAIL_CALL_START;
                                        }
                                    }
                                } else {
                                    let mut unescaped: u16 = if c == truncate!(int!(34), u16) {
                                            truncate!(int!(34), u16)
                                        } else {
                                            if c == truncate!(int!(92), u16) {
                                                truncate!(int!(92), u16)
                                            } else {
                                                if c == truncate!(int!(98), u16) {
                                                    truncate!(int!(8), u16)
                                                } else {
                                                    if c == truncate!(int!(102), u16) {
                                                        truncate!(int!(12), u16)
                                                    } else {
                                                        if c == truncate!(int!(110), u16) {
                                                            truncate!(int!(10), u16)
                                                        } else {
                                                            if c == truncate!(int!(114), u16) {
                                                                truncate!(int!(13), u16)
                                                            } else {
                                                                if c == truncate!(int!(116), u16) {
                                                                    truncate!(int!(9), u16)
                                                                } else {
                                                                    truncate!(int!(0), u16)
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        };
                                    if int!(unescaped) == int!(0) {
                                        return Arc::new(Result::<Sequence<u16>, Arc<DeserializationError>>::Failure {
                                                    error: crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::UnsupportedEscape16(&str.slice(&start, &(start.clone() + int!(2))))
                                                });
                                    } else {
                                        let mut _in3: Sequence<u16> = str.clone();
                                        let mut _in4: DafnyInt = start.clone() + int!(2);
                                        let mut _in5: Sequence<u16> = prefix.concat(&seq![unescaped]);
                                        _r0 = _in3.clone();
                                        _r1 = _in4.clone();
                                        _r2 = _in5.clone();
                                        continue 'TAIL_CALL_START;
                                    }
                                }
                            }
                        } else {
                            let mut _in6: Sequence<u16> = str.clone();
                            let mut _in7: DafnyInt = start.clone() + int!(1);
                            let mut _in8: Sequence<u16> = prefix.concat(&seq![str.get(&start)]);
                            _r0 = _in6.clone();
                            _r1 = _in7.clone();
                            _r2 = _in8.clone();
                            continue 'TAIL_CALL_START;
                        }
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(107,3)
            pub fn String(js: &Arc<jstring>) -> Arc<Result<Sequence<DafnyCharUTF16>, Arc<DeserializationError>>> {
                let mut valueOrError0: Arc<Result<Sequence<DafnyCharUTF16>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::FromUTF8Checked(&View_::Bytes(js.contents()))._ToResult_k::<Arc<DeserializationError>>(&Arc::new(DeserializationError::InvalidUnicode {}));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Sequence<DafnyCharUTF16>>()
                } else {
                    let mut asUtf32: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
                    let mut valueOrError1: Arc<Result<Sequence<u16>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ToUTF16Checked(&asUtf32)._ToResult_k::<Arc<DeserializationError>>(&Arc::new(DeserializationError::InvalidUnicode {}));
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Sequence<DafnyCharUTF16>>()
                    } else {
                        let mut asUint16: Sequence<u16> = valueOrError1.Extract();
                        let mut valueOrError2: Arc<Result<Sequence<u16>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::Unescape(&asUint16, &int!(0), &(seq![] as Sequence<u16>));
                        if valueOrError2.IsFailure() {
                            valueOrError2.PropagateFailure::<Sequence<DafnyCharUTF16>>()
                        } else {
                            let mut unescaped: Sequence<u16> = valueOrError2.Extract();
                            crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::FromUTF16Checked(&unescaped)._ToResult_k::<Arc<DeserializationError>>(&Arc::new(DeserializationError::InvalidUnicode {}))
                        }
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(128,3)
            pub fn ToInt(sign: &jsign, n: &jnum) -> Arc<Result<DafnyInt, Arc<DeserializationError>>> {
                let mut n: DafnyInt = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_ByteStrConversion_Compile::_default::ToNat_any(&View_::Bytes(n), &int!(10), &crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::DIGITS());
                Arc::new(Result::<DafnyInt, Arc<DeserializationError>>::Success {
                        value: if View_::_Char_q(sign, &DafnyCharUTF16(45 as u16)) {
                                int!(0) - n.clone()
                            } else {
                                n.clone()
                            }
                    })
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(133,3)
            pub fn Number(js: &Arc<jnumber>) -> Arc<Result<Arc<Decimal>, Arc<DeserializationError>>> {
                let mut __let_tmp_rhs0: Arc<jnumber> = js.clone();
                let mut minus: jminus = __let_tmp_rhs0.minus().clone();
                let mut num: jnum = __let_tmp_rhs0.num().clone();
                let mut frac: Arc<Maybe<Arc<jfrac>>> = __let_tmp_rhs0.frac().clone();
                let mut exp: Arc<Maybe<Arc<jexp>>> = __let_tmp_rhs0.exp().clone();
                let mut valueOrError0: Arc<Result<DafnyInt, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::ToInt(&minus, &num);
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<Decimal>>()
                } else {
                    let mut n: DafnyInt = valueOrError0.Extract();
                    let mut valueOrError1: Arc<Result<DafnyInt, Arc<DeserializationError>>> = (&({
                            Arc::new(move |_source0: &Arc<Maybe<Arc<jexp>>>| -> Arc<Result<DafnyInt, Arc<DeserializationError>>>{
                                    if matches!(_source0.as_ref(), Empty{ .. }) {
                                        Arc::new(Result::<DafnyInt, Arc<DeserializationError>>::Success {
                                                value: int!(0)
                                            })
                                    } else {
                                        let mut ___mcc_h0: Arc<jexp> = _source0.t().clone();
                                        let mut _source1: Arc<jexp> = ___mcc_h0.clone();
                                        let mut ___mcc_h1: je = _source1.e().clone();
                                        let mut ___mcc_h2: jsign = _source1.sign().clone();
                                        let mut ___mcc_h3: jnum = _source1.num().clone();
                                        let mut num: jnum = ___mcc_h3.clone();
                                        let mut sign: jsign = ___mcc_h2.clone();
                                        crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::ToInt(&sign, &num)
                                    }
                                })
                        }))(&exp);
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Arc<Decimal>>()
                    } else {
                        let mut e10: DafnyInt = valueOrError1.Extract();
                        let mut _source2: Arc<Maybe<Arc<jfrac>>> = frac.clone();
                        if matches!((&_source2).as_ref(), Empty{ .. }) {
                            Arc::new(Result::<Arc<Decimal>, Arc<DeserializationError>>::Success {
                                    value: Arc::new(Decimal::Decimal {
                                                n: n.clone(),
                                                e10: e10.clone()
                                            })
                                })
                        } else {
                            let mut ___mcc_h4: Arc<jfrac> = _source2.t().clone();
                            let mut _source3: Arc<jfrac> = ___mcc_h4.clone();
                            let mut ___mcc_h5: jperiod = _source3.period().clone();
                            let mut ___mcc_h6: jnum = _source3.num().clone();
                            let mut num: jnum = ___mcc_h6.clone();
                            let mut pow10: DafnyInt = int!(View_::Length(&num));
                            let mut valueOrError2: Arc<Result<DafnyInt, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::ToInt(&minus, &num);
                            if valueOrError2.IsFailure() {
                                valueOrError2.PropagateFailure::<Arc<Decimal>>()
                            } else {
                                let mut frac: DafnyInt = valueOrError2.Extract();
                                Arc::new(Result::<Arc<Decimal>, Arc<DeserializationError>>::Success {
                                        value: Arc::new(Decimal::Decimal {
                                                    n: n.clone() * crate::implementation_from_dafny::_Power_Compile::_default::Pow(&int!(10), &pow10) + frac.clone(),
                                                    e10: e10.clone() - pow10.clone()
                                                })
                                    })
                            }
                        }
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(148,3)
            pub fn KeyValue(js: &Arc<jKeyValue>) -> Arc<Result<(Sequence<DafnyCharUTF16>, Arc<JSON>), Arc<DeserializationError>>> {
                let mut valueOrError0: Arc<Result<Sequence<DafnyCharUTF16>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::String(js.k());
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<(Sequence<DafnyCharUTF16>, Arc<JSON>)>()
                } else {
                    let mut k: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
                    let mut valueOrError1: Arc<Result<Arc<JSON>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::Value(js.v());
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<(Sequence<DafnyCharUTF16>, Arc<JSON>)>()
                    } else {
                        let mut v: Arc<JSON> = valueOrError1.Extract();
                        Arc::new(Result::<(Sequence<DafnyCharUTF16>, Arc<JSON>), Arc<DeserializationError>>::Success {
                                value: (
                                        k.clone(),
                                        v.clone()
                                    )
                            })
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(154,3)
            pub fn Object(js: &Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>>) -> Arc<Result<Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)>, Arc<DeserializationError>>> {
                crate::implementation_from_dafny::_Seq_Compile::_default::MapWithResult::<Arc<Suffixed<Arc<jKeyValue>, jcomma>>, (Sequence<DafnyCharUTF16>, Arc<JSON>), Arc<DeserializationError>>({
                        let js: Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>> = js.clone();
                        &({
                            Arc::new(move |d: &Arc<Suffixed<Arc<jKeyValue>, jcomma>>| -> Arc<Result<(Sequence<DafnyCharUTF16>, Arc<JSON>), Arc<DeserializationError>>>{
                                    crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::KeyValue(d.t())
                                })
                        })
                    }, js.data())
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(158,3)
            pub fn Array(js: &Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>>) -> Arc<Result<Sequence<Arc<JSON>>, Arc<DeserializationError>>> {
                crate::implementation_from_dafny::_Seq_Compile::_default::MapWithResult::<Arc<Suffixed<Arc<Value>, jcomma>>, Arc<JSON>, Arc<DeserializationError>>({
                        let js: Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>> = js.clone();
                        &({
                            Arc::new(move |d: &Arc<Suffixed<Arc<Value>, jcomma>>| -> Arc<Result<Arc<JSON>, Arc<DeserializationError>>>{
                                    crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::Value(d.t())
                                })
                        })
                    }, js.data())
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(162,3)
            pub fn Value(js: &Arc<Value>) -> Arc<Result<Arc<JSON>, Arc<DeserializationError>>> {
                let mut _source0: Arc<Value> = js.clone();
                if matches!((&_source0).as_ref(), Null{ .. }) {
                    let mut ___mcc_h0: jnull = _source0.n().clone();
                    Arc::new(Result::<Arc<JSON>, Arc<DeserializationError>>::Success {
                            value: Arc::new(JSON::Null {})
                        })
                } else {
                    if matches!((&_source0).as_ref(), Bool{ .. }) {
                        let mut ___mcc_h1: jbool = _source0.b().clone();
                        let mut b: jbool = ___mcc_h1.clone();
                        Arc::new(Result::<Arc<JSON>, Arc<DeserializationError>>::Success {
                                value: Arc::new(JSON::Bool {
                                            b: crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::Bool(&b)
                                        })
                            })
                    } else {
                        if matches!((&_source0).as_ref(), String{ .. }) {
                            let mut ___mcc_h2: Arc<jstring> = _source0.str().clone();
                            let mut str: Arc<jstring> = ___mcc_h2.clone();
                            let mut valueOrError0: Arc<Result<Sequence<DafnyCharUTF16>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::String(&str);
                            if valueOrError0.IsFailure() {
                                valueOrError0.PropagateFailure::<Arc<JSON>>()
                            } else {
                                let mut s: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
                                Arc::new(Result::<Arc<JSON>, Arc<DeserializationError>>::Success {
                                        value: Arc::new(JSON::String {
                                                    str: s.clone()
                                                })
                                    })
                            }
                        } else {
                            if matches!((&_source0).as_ref(), Number{ .. }) {
                                let mut ___mcc_h3: Arc<jnumber> = _source0.num().clone();
                                let mut dec: Arc<jnumber> = ___mcc_h3.clone();
                                let mut valueOrError1: Arc<Result<Arc<Decimal>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::Number(&dec);
                                if valueOrError1.IsFailure() {
                                    valueOrError1.PropagateFailure::<Arc<JSON>>()
                                } else {
                                    let mut n: Arc<Decimal> = valueOrError1.Extract();
                                    Arc::new(Result::<Arc<JSON>, Arc<DeserializationError>>::Success {
                                            value: Arc::new(JSON::Number {
                                                        num: n.clone()
                                                    })
                                        })
                                }
                            } else {
                                if matches!((&_source0).as_ref(), Object{ .. }) {
                                    let mut ___mcc_h4: Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>> = _source0.obj().clone();
                                    let mut obj: Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>> = ___mcc_h4.clone();
                                    let mut valueOrError2: Arc<Result<Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::Object(&obj);
                                    if valueOrError2.IsFailure() {
                                        valueOrError2.PropagateFailure::<Arc<JSON>>()
                                    } else {
                                        let mut o: Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)> = valueOrError2.Extract();
                                        Arc::new(Result::<Arc<JSON>, Arc<DeserializationError>>::Success {
                                                value: Arc::new(JSON::Object {
                                                            obj: o.clone()
                                                        })
                                            })
                                    }
                                } else {
                                    let mut ___mcc_h5: Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>> = _source0.arr().clone();
                                    let mut arr: Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>> = ___mcc_h5.clone();
                                    let mut valueOrError3: Arc<Result<Sequence<Arc<JSON>>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::Array(&arr);
                                    if valueOrError3.IsFailure() {
                                        valueOrError3.PropagateFailure::<Arc<JSON>>()
                                    } else {
                                        let mut a: Sequence<Arc<JSON>> = valueOrError3.Extract();
                                        Arc::new(Result::<Arc<JSON>, Arc<DeserializationError>>::Success {
                                                value: Arc::new(JSON::Array {
                                                            arr: a.clone()
                                                        })
                                            })
                                    }
                                }
                            }
                        }
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(172,3)
            pub fn JSON(js: &Arc<Structural<Arc<Value>>>) -> Arc<Result<Arc<JSON>, Arc<DeserializationError>>> {
                crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_default::Value(js.t())
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(52,3)
            pub fn HEX_TABLE_16() -> Map<u16, nat> {
                map![(DafnyCharUTF16(48 as u16).0 as u16) => (int!(0)), (DafnyCharUTF16(49 as u16).0 as u16) => (int!(1)), (DafnyCharUTF16(50 as u16).0 as u16) => (int!(2)), (DafnyCharUTF16(51 as u16).0 as u16) => (int!(3)), (DafnyCharUTF16(52 as u16).0 as u16) => (int!(4)), (DafnyCharUTF16(53 as u16).0 as u16) => (int!(5)), (DafnyCharUTF16(54 as u16).0 as u16) => (int!(6)), (DafnyCharUTF16(55 as u16).0 as u16) => (int!(7)), (DafnyCharUTF16(56 as u16).0 as u16) => (int!(8)), (DafnyCharUTF16(57 as u16).0 as u16) => (int!(9)), (DafnyCharUTF16(97 as u16).0 as u16) => (int!(10)), (DafnyCharUTF16(98 as u16).0 as u16) => (int!(11)), (DafnyCharUTF16(99 as u16).0 as u16) => (int!(12)), (DafnyCharUTF16(100 as u16).0 as u16) => (int!(13)), (DafnyCharUTF16(101 as u16).0 as u16) => (int!(14)), (DafnyCharUTF16(102 as u16).0 as u16) => (int!(15)), (DafnyCharUTF16(65 as u16).0 as u16) => (int!(10)), (DafnyCharUTF16(66 as u16).0 as u16) => (int!(11)), (DafnyCharUTF16(67 as u16).0 as u16) => (int!(12)), (DafnyCharUTF16(68 as u16).0 as u16) => (int!(13)), (DafnyCharUTF16(69 as u16).0 as u16) => (int!(14)), (DafnyCharUTF16(70 as u16).0 as u16) => (int!(15))]
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(119,3)
            pub fn DIGITS() -> Map<u8, DafnyInt> {
                map![(DafnyCharUTF16(48 as u16).0 as u8) => (int!(0)), (DafnyCharUTF16(49 as u16).0 as u8) => (int!(1)), (DafnyCharUTF16(50 as u16).0 as u8) => (int!(2)), (DafnyCharUTF16(51 as u16).0 as u8) => (int!(3)), (DafnyCharUTF16(52 as u16).0 as u8) => (int!(4)), (DafnyCharUTF16(53 as u16).0 as u8) => (int!(5)), (DafnyCharUTF16(54 as u16).0 as u8) => (int!(6)), (DafnyCharUTF16(55 as u16).0 as u8) => (int!(7)), (DafnyCharUTF16(56 as u16).0 as u8) => (int!(8)), (DafnyCharUTF16(57 as u16).0 as u8) => (int!(9))]
            }
            /// ../mpl/libraries/src/JSON/Deserializer.dfy(126,3)
            pub fn MINUS() -> u8 {
                DafnyCharUTF16(45 as u16).0 as u8
            }
        }

        /// ../mpl/libraries/src/JSON/Deserializer.dfy(114,3)
        pub mod _ByteStrConversion_Compile {
            pub use ::dafny_runtime::_System::nat;
            pub use ::dafny_runtime::DafnyInt;
            pub use ::dafny_runtime::Sequence;
            pub use ::dafny_runtime::int;
            pub use ::dafny_runtime::seq;
            pub use ::dafny_runtime::euclidian_division;
            pub use ::dafny_runtime::euclidian_modulo;
            pub use ::std::sync::Arc;
            pub use ::std::marker::Sync;
            pub use ::std::marker::Send;
            pub use ::dafny_runtime::itertools::Itertools;
            pub use ::dafny_runtime::Map;

            pub struct _default {}

            impl _default {
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(27,5)
                pub fn Digits(n: &nat, base: &DafnyInt) -> Sequence<DafnyInt> {
                    if n.clone() == int!(0) {
                        seq![] as Sequence<DafnyInt>
                    } else {
                        let mut _digits_k: Sequence<DafnyInt> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_ByteStrConversion_Compile::_default::Digits(&euclidian_division(n.clone(), base.clone()), base);
                        let mut digits: Sequence<DafnyInt> = _digits_k.concat(&seq![euclidian_modulo(n.clone(), base.clone())]);
                        digits.clone()
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(54,5)
                pub fn OfDigits(digits: &Sequence<DafnyInt>, chars: &Sequence<u8>) -> Sequence<u8> {
                    let mut _accumulator: Sequence<u8> = seq![] as Sequence<u8>;
                    let mut _r0 = digits.clone();
                    let mut _r1 = chars.clone();
                    'TAIL_CALL_START: loop {
                        let digits = _r0;
                        let chars = _r1;
                        if digits.clone().to_array().len() == 0 {
                            return _accumulator.concat(&(seq![] as Sequence<u8>));
                        } else {
                            _accumulator = _accumulator.concat(&seq![chars.get(&digits.get(&int!(0)))]);
                            let mut _in0: Sequence<DafnyInt> = digits.drop(&int!(1));
                            let mut _in1: Sequence<u8> = chars.clone();
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            continue 'TAIL_CALL_START;
                        }
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(66,5)
                pub fn OfNat_any(n: &nat, chars: &Sequence<u8>) -> Sequence<u8> {
                    let mut base: DafnyInt = chars.cardinality();
                    if n.clone() == int!(0) {
                        seq![chars.get(&int!(0))]
                    } else {
                        crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_ByteStrConversion_Compile::_default::OfDigits(&crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_ByteStrConversion_Compile::_default::Digits(n, &base), chars)
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(76,5)
                pub fn NumberStr(str: &Sequence<u8>, minus: u8, is_digit: &Arc<dyn ::std::ops::Fn(&u8) -> bool + Sync + Send>) -> bool {
                    !(!(str.clone().to_array().len() == 0)) || (str.get(&int!(0)) == minus || is_digit(&str.get(&int!(0)))) && Itertools::unique((&str.drop(&int!(1))).iter()).all(({
                            let mut str = str.clone();
                            let mut is_digit = is_digit.clone();
                            Arc::new(move |__forall_var_0: u8| -> bool{
                                    let mut c: u8 = __forall_var_0;
                                    !str.drop(&int!(1)).contains(&c) || (&is_digit)(&c)
                                })
                        }).as_ref())
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(82,5)
                pub fn OfInt_any(n: &DafnyInt, chars: &Sequence<u8>, minus: u8) -> Sequence<u8> {
                    if !(n.clone() < int!(0)) {
                        crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_ByteStrConversion_Compile::_default::OfNat_any(n, chars)
                    } else {
                        seq![minus].concat(&crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_ByteStrConversion_Compile::_default::OfNat_any(&(int!(0) - n.clone()), chars))
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(90,5)
                pub fn ToNat_any(str: &Sequence<u8>, base: &nat, digits: &Map<u8, nat>) -> nat {
                    if str.clone().to_array().len() == 0 {
                        int!(0)
                    } else {
                        crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_ByteStrConversion_Compile::_default::ToNat_any(&str.take(&(str.cardinality() - int!(1))), base, digits) * base.clone() + digits.get(&str.get(&(str.cardinality() - int!(1))))
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(124,5)
                pub fn ToInt_any(str: &Sequence<u8>, minus: u8, base: &nat, digits: &Map<u8, nat>) -> DafnyInt {
                    if seq![minus] <= str.clone() {
                        int!(0) - crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_ByteStrConversion_Compile::_default::ToNat_any(&str.drop(&int!(1)), base, digits)
                    } else {
                        crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_ByteStrConversion_Compile::_default::ToNat_any(str, base, digits)
                    }
                }
            }
        }

        /// ../mpl/libraries/src/JSON/Deserializer.dfy(46,3)
        pub mod _Uint16StrConversion_Compile {
            pub use ::dafny_runtime::_System::nat;
            pub use ::dafny_runtime::DafnyInt;
            pub use ::dafny_runtime::Sequence;
            pub use ::dafny_runtime::int;
            pub use ::dafny_runtime::seq;
            pub use ::dafny_runtime::euclidian_division;
            pub use ::dafny_runtime::euclidian_modulo;
            pub use ::std::sync::Arc;
            pub use ::std::marker::Sync;
            pub use ::std::marker::Send;
            pub use ::dafny_runtime::itertools::Itertools;
            pub use ::dafny_runtime::Map;

            pub struct _default {}

            impl _default {
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(27,5)
                pub fn Digits(n: &nat, base: &DafnyInt) -> Sequence<DafnyInt> {
                    if n.clone() == int!(0) {
                        seq![] as Sequence<DafnyInt>
                    } else {
                        let mut _digits_k: Sequence<DafnyInt> = crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_Uint16StrConversion_Compile::_default::Digits(&euclidian_division(n.clone(), base.clone()), base);
                        let mut digits: Sequence<DafnyInt> = _digits_k.concat(&seq![euclidian_modulo(n.clone(), base.clone())]);
                        digits.clone()
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(54,5)
                pub fn OfDigits(digits: &Sequence<DafnyInt>, chars: &Sequence<u16>) -> Sequence<u16> {
                    let mut _accumulator: Sequence<u16> = seq![] as Sequence<u16>;
                    let mut _r0 = digits.clone();
                    let mut _r1 = chars.clone();
                    'TAIL_CALL_START: loop {
                        let digits = _r0;
                        let chars = _r1;
                        if digits.clone().to_array().len() == 0 {
                            return _accumulator.concat(&(seq![] as Sequence<u16>));
                        } else {
                            _accumulator = _accumulator.concat(&seq![chars.get(&digits.get(&int!(0)))]);
                            let mut _in0: Sequence<DafnyInt> = digits.drop(&int!(1));
                            let mut _in1: Sequence<u16> = chars.clone();
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            continue 'TAIL_CALL_START;
                        }
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(66,5)
                pub fn OfNat_any(n: &nat, chars: &Sequence<u16>) -> Sequence<u16> {
                    let mut base: DafnyInt = chars.cardinality();
                    if n.clone() == int!(0) {
                        seq![chars.get(&int!(0))]
                    } else {
                        crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_Uint16StrConversion_Compile::_default::OfDigits(&crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_Uint16StrConversion_Compile::_default::Digits(n, &base), chars)
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(76,5)
                pub fn NumberStr(str: &Sequence<u16>, minus: u16, is_digit: &Arc<dyn ::std::ops::Fn(&u16) -> bool + Sync + Send>) -> bool {
                    !(!(str.clone().to_array().len() == 0)) || (str.get(&int!(0)) == minus || is_digit(&str.get(&int!(0)))) && Itertools::unique((&str.drop(&int!(1))).iter()).all(({
                            let mut str = str.clone();
                            let mut is_digit = is_digit.clone();
                            Arc::new(move |__forall_var_0: u16| -> bool{
                                    let mut c: u16 = __forall_var_0;
                                    !str.drop(&int!(1)).contains(&c) || (&is_digit)(&c)
                                })
                        }).as_ref())
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(82,5)
                pub fn OfInt_any(n: &DafnyInt, chars: &Sequence<u16>, minus: u16) -> Sequence<u16> {
                    if !(n.clone() < int!(0)) {
                        crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_Uint16StrConversion_Compile::_default::OfNat_any(n, chars)
                    } else {
                        seq![minus].concat(&crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_Uint16StrConversion_Compile::_default::OfNat_any(&(int!(0) - n.clone()), chars))
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(90,5)
                pub fn ToNat_any(str: &Sequence<u16>, base: &nat, digits: &Map<u16, nat>) -> nat {
                    if str.clone().to_array().len() == 0 {
                        int!(0)
                    } else {
                        crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_Uint16StrConversion_Compile::_default::ToNat_any(&str.take(&(str.cardinality() - int!(1))), base, digits) * base.clone() + digits.get(&str.get(&(str.cardinality() - int!(1))))
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(124,5)
                pub fn ToInt_any(str: &Sequence<u16>, minus: u16, base: &nat, digits: &Map<u16, nat>) -> DafnyInt {
                    if seq![minus] <= str.clone() {
                        int!(0) - crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_Uint16StrConversion_Compile::_default::ToNat_any(&str.drop(&int!(1)), base, digits)
                    } else {
                        crate::implementation_from_dafny::_JSON_Compile::_Deserializer_Compile::_Uint16StrConversion_Compile::_default::ToNat_any(str, base, digits)
                    }
                }
            }
        }
    }

    /// ../mpl/libraries/src/JSON/Errors.dfy(7,1)
    pub mod _Errors_Compile {
        pub use ::dafny_runtime::Sequence;
        pub use ::dafny_runtime::DafnyCharUTF16;
        pub use ::std::sync::Arc;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError::UnterminatedSequence;
        pub use ::dafny_runtime::string_utf16_of;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError::UnsupportedEscape;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError::EscapeAtEOS;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError::EmptyNumber;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError::ExpectingEOF;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError::IntOverflow;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError::ReachedEOF;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError::ExpectingByte;
        pub use ::dafny_runtime::truncate;
        pub use ::dafny_runtime::int;
        pub use ::dafny_runtime::seq;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError::ExpectingAnyByte;
        pub use ::dafny_runtime::DafnyInt;
        pub use ::dafny_runtime::integer_range;
        pub use ::dafny_runtime::Zero;
        pub use ::std::fmt::Debug;
        pub use ::std::fmt::Formatter;
        pub use ::std::fmt::Result;
        pub use ::dafny_runtime::DafnyPrint;
        pub use ::std::cmp::Eq;
        pub use ::std::hash::Hash;
        pub use ::std::hash::Hasher;
        pub use ::std::default::Default;
        pub use ::std::convert::AsRef;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::SerializationError::OutOfMemory;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::SerializationError::IntTooLarge;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::SerializationError::StringTooLong;

        /// ../mpl/libraries/src/JSON/Errors.dfy(12,3)
        #[derive(PartialEq, Clone)]
        pub enum DeserializationError {
            UnterminatedSequence {},
            UnsupportedEscape {
                str: Sequence<DafnyCharUTF16>
            },
            EscapeAtEOS {},
            EmptyNumber {},
            ExpectingEOF {},
            IntOverflow {},
            ReachedEOF {},
            ExpectingByte {
                expected: u8,
                b: i16
            },
            ExpectingAnyByte {
                expected_sq: Sequence<u8>,
                b: i16
            },
            InvalidUnicode {}
        }

        impl DeserializationError {
            /// ../mpl/libraries/src/JSON/Errors.dfy(24,5)
            pub fn ToString(self: &Arc<Self>) -> Sequence<DafnyCharUTF16> {
                let mut _source0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError> = self.clone();
                if matches!((&_source0).as_ref(), UnterminatedSequence{ .. }) {
                    string_utf16_of("Unterminated sequence")
                } else {
                    if matches!((&_source0).as_ref(), UnsupportedEscape{ .. }) {
                        let mut ___mcc_h0: Sequence<DafnyCharUTF16> = _source0.str().clone();
                        let mut str: Sequence<DafnyCharUTF16> = ___mcc_h0.clone();
                        string_utf16_of("Unsupported escape sequence: ").concat(&str)
                    } else {
                        if matches!((&_source0).as_ref(), EscapeAtEOS{ .. }) {
                            string_utf16_of("Escape character at end of string")
                        } else {
                            if matches!((&_source0).as_ref(), EmptyNumber{ .. }) {
                                string_utf16_of("Number must contain at least one digit")
                            } else {
                                if matches!((&_source0).as_ref(), ExpectingEOF{ .. }) {
                                    string_utf16_of("Expecting EOF")
                                } else {
                                    if matches!((&_source0).as_ref(), IntOverflow{ .. }) {
                                        string_utf16_of("Input length does not fit in a 32-bit counter")
                                    } else {
                                        if matches!((&_source0).as_ref(), ReachedEOF{ .. }) {
                                            string_utf16_of("Reached EOF")
                                        } else {
                                            if matches!((&_source0).as_ref(), ExpectingByte{ .. }) {
                                                let mut ___mcc_h1: u8 = _source0.expected().clone();
                                                let mut ___mcc_h2: i16 = _source0.b().clone();
                                                let mut b: i16 = ___mcc_h2;
                                                let mut b0: u8 = ___mcc_h1;
                                                let mut c: Sequence<DafnyCharUTF16> = if truncate!(int!(0), i16) < b {
                                                        string_utf16_of("'").concat(&seq![DafnyCharUTF16(b as u16)]).concat(&string_utf16_of("'"))
                                                    } else {
                                                        string_utf16_of("EOF")
                                                    };
                                                string_utf16_of("Expecting '").concat(&seq![DafnyCharUTF16(b0 as u16)]).concat(&string_utf16_of("', read ")).concat(&c)
                                            } else {
                                                if matches!((&_source0).as_ref(), ExpectingAnyByte{ .. }) {
                                                    let mut ___mcc_h3: Sequence<u8> = _source0.expected_sq().clone();
                                                    let mut ___mcc_h4: i16 = _source0.b().clone();
                                                    let mut b: i16 = ___mcc_h4;
                                                    let mut bs0: Sequence<u8> = ___mcc_h3.clone();
                                                    let mut c: Sequence<DafnyCharUTF16> = if truncate!(int!(0), i16) < b {
                                                            string_utf16_of("'").concat(&seq![DafnyCharUTF16(b as u16)]).concat(&string_utf16_of("'"))
                                                        } else {
                                                            string_utf16_of("EOF")
                                                        };
                                                    let mut c0s: Sequence<DafnyCharUTF16> = {
                                                            let _initializer = {
                                                                    let bs0: Sequence<u8> = bs0.clone();
                                                                    {
                                                                        let mut bs0 = bs0.clone();
                                                                        Arc::new(move |idx: &DafnyInt| -> DafnyCharUTF16{
                                                                                DafnyCharUTF16(bs0.get(idx) as u16)
                                                                            })
                                                                    }
                                                                };
                                                            integer_range(Zero::zero(), bs0.cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                                                        };
                                                    string_utf16_of("Expecting one of '").concat(&c0s).concat(&string_utf16_of("', read ")).concat(&c)
                                                } else {
                                                    string_utf16_of("Invalid Unicode sequence")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            /// Gets the field str for all enum members which have it
            pub fn str(&self) -> &Sequence<DafnyCharUTF16> {
                match self {
                    DeserializationError::UnterminatedSequence{} => panic!("field does not exist on this variant"),
                    DeserializationError::UnsupportedEscape{str, } => str,
                    DeserializationError::EscapeAtEOS{} => panic!("field does not exist on this variant"),
                    DeserializationError::EmptyNumber{} => panic!("field does not exist on this variant"),
                    DeserializationError::ExpectingEOF{} => panic!("field does not exist on this variant"),
                    DeserializationError::IntOverflow{} => panic!("field does not exist on this variant"),
                    DeserializationError::ReachedEOF{} => panic!("field does not exist on this variant"),
                    DeserializationError::ExpectingByte{expected, b, } => panic!("field does not exist on this variant"),
                    DeserializationError::ExpectingAnyByte{expected_sq, b, } => panic!("field does not exist on this variant"),
                    DeserializationError::InvalidUnicode{} => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field expected for all enum members which have it
            pub fn expected(&self) -> &u8 {
                match self {
                    DeserializationError::UnterminatedSequence{} => panic!("field does not exist on this variant"),
                    DeserializationError::UnsupportedEscape{str, } => panic!("field does not exist on this variant"),
                    DeserializationError::EscapeAtEOS{} => panic!("field does not exist on this variant"),
                    DeserializationError::EmptyNumber{} => panic!("field does not exist on this variant"),
                    DeserializationError::ExpectingEOF{} => panic!("field does not exist on this variant"),
                    DeserializationError::IntOverflow{} => panic!("field does not exist on this variant"),
                    DeserializationError::ReachedEOF{} => panic!("field does not exist on this variant"),
                    DeserializationError::ExpectingByte{expected, b, } => expected,
                    DeserializationError::ExpectingAnyByte{expected_sq, b, } => panic!("field does not exist on this variant"),
                    DeserializationError::InvalidUnicode{} => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field b for all enum members which have it
            pub fn b(&self) -> &i16 {
                match self {
                    DeserializationError::UnterminatedSequence{} => panic!("field does not exist on this variant"),
                    DeserializationError::UnsupportedEscape{str, } => panic!("field does not exist on this variant"),
                    DeserializationError::EscapeAtEOS{} => panic!("field does not exist on this variant"),
                    DeserializationError::EmptyNumber{} => panic!("field does not exist on this variant"),
                    DeserializationError::ExpectingEOF{} => panic!("field does not exist on this variant"),
                    DeserializationError::IntOverflow{} => panic!("field does not exist on this variant"),
                    DeserializationError::ReachedEOF{} => panic!("field does not exist on this variant"),
                    DeserializationError::ExpectingByte{expected, b, } => b,
                    DeserializationError::ExpectingAnyByte{expected_sq, b, } => b,
                    DeserializationError::InvalidUnicode{} => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field expected_sq for all enum members which have it
            pub fn expected_sq(&self) -> &Sequence<u8> {
                match self {
                    DeserializationError::UnterminatedSequence{} => panic!("field does not exist on this variant"),
                    DeserializationError::UnsupportedEscape{str, } => panic!("field does not exist on this variant"),
                    DeserializationError::EscapeAtEOS{} => panic!("field does not exist on this variant"),
                    DeserializationError::EmptyNumber{} => panic!("field does not exist on this variant"),
                    DeserializationError::ExpectingEOF{} => panic!("field does not exist on this variant"),
                    DeserializationError::IntOverflow{} => panic!("field does not exist on this variant"),
                    DeserializationError::ReachedEOF{} => panic!("field does not exist on this variant"),
                    DeserializationError::ExpectingByte{expected, b, } => panic!("field does not exist on this variant"),
                    DeserializationError::ExpectingAnyByte{expected_sq, b, } => expected_sq,
                    DeserializationError::InvalidUnicode{} => panic!("field does not exist on this variant"),
                }
            }
        }

        impl Debug
            for DeserializationError {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl DafnyPrint
            for DeserializationError {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    DeserializationError::UnterminatedSequence{} => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.DeserializationError.UnterminatedSequence")?;
                        Ok(())
                    },
                    DeserializationError::UnsupportedEscape{str, } => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.DeserializationError.UnsupportedEscape(")?;
                        DafnyPrint::fmt_print(str, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    DeserializationError::EscapeAtEOS{} => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.DeserializationError.EscapeAtEOS")?;
                        Ok(())
                    },
                    DeserializationError::EmptyNumber{} => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.DeserializationError.EmptyNumber")?;
                        Ok(())
                    },
                    DeserializationError::ExpectingEOF{} => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.DeserializationError.ExpectingEOF")?;
                        Ok(())
                    },
                    DeserializationError::IntOverflow{} => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.DeserializationError.IntOverflow")?;
                        Ok(())
                    },
                    DeserializationError::ReachedEOF{} => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.DeserializationError.ReachedEOF")?;
                        Ok(())
                    },
                    DeserializationError::ExpectingByte{expected, b, } => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.DeserializationError.ExpectingByte(")?;
                        DafnyPrint::fmt_print(expected, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(b, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    DeserializationError::ExpectingAnyByte{expected_sq, b, } => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.DeserializationError.ExpectingAnyByte(")?;
                        DafnyPrint::fmt_print(expected_sq, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(b, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    DeserializationError::InvalidUnicode{} => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.DeserializationError.InvalidUnicode")?;
                        Ok(())
                    },
                }
            }
        }

        impl Eq
            for DeserializationError {}

        impl Hash
            for DeserializationError {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    DeserializationError::UnterminatedSequence{} => {

                    },
                    DeserializationError::UnsupportedEscape{str, } => {
                        Hash::hash(str, _state)
                    },
                    DeserializationError::EscapeAtEOS{} => {

                    },
                    DeserializationError::EmptyNumber{} => {

                    },
                    DeserializationError::ExpectingEOF{} => {

                    },
                    DeserializationError::IntOverflow{} => {

                    },
                    DeserializationError::ReachedEOF{} => {

                    },
                    DeserializationError::ExpectingByte{expected, b, } => {
                        Hash::hash(expected, _state);
                        Hash::hash(b, _state)
                    },
                    DeserializationError::ExpectingAnyByte{expected_sq, b, } => {
                        Hash::hash(expected_sq, _state);
                        Hash::hash(b, _state)
                    },
                    DeserializationError::InvalidUnicode{} => {

                    },
                }
            }
        }

        impl Default
            for DeserializationError {
            fn default() -> DeserializationError {
                DeserializationError::UnterminatedSequence {}
            }
        }

        impl AsRef<DeserializationError>
            for DeserializationError {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Errors.dfy(44,3)
        #[derive(PartialEq, Clone)]
        pub enum SerializationError {
            OutOfMemory {},
            IntTooLarge {
                i: DafnyInt
            },
            StringTooLong {
                s: Sequence<DafnyCharUTF16>
            },
            InvalidUnicode {}
        }

        impl SerializationError {
            /// ../mpl/libraries/src/JSON/Errors.dfy(50,5)
            pub fn ToString(self: &Arc<Self>) -> Sequence<DafnyCharUTF16> {
                let mut _source0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::SerializationError> = self.clone();
                if matches!((&_source0).as_ref(), OutOfMemory{ .. }) {
                    string_utf16_of("Out of memory")
                } else {
                    if matches!((&_source0).as_ref(), IntTooLarge{ .. }) {
                        let mut ___mcc_h0: DafnyInt = _source0.i().clone();
                        let mut i: DafnyInt = ___mcc_h0.clone();
                        string_utf16_of("Integer too large: ").concat(&_default::OfInt(&i, &int!(10)))
                    } else {
                        if matches!((&_source0).as_ref(), StringTooLong{ .. }) {
                            let mut ___mcc_h1: Sequence<DafnyCharUTF16> = _source0.s().clone();
                            let mut s: Sequence<DafnyCharUTF16> = ___mcc_h1.clone();
                            string_utf16_of("String too long: ").concat(&s)
                        } else {
                            string_utf16_of("Invalid Unicode sequence")
                        }
                    }
                }
            }
            /// Gets the field i for all enum members which have it
            pub fn i(&self) -> &DafnyInt {
                match self {
                    SerializationError::OutOfMemory{} => panic!("field does not exist on this variant"),
                    SerializationError::IntTooLarge{i, } => i,
                    SerializationError::StringTooLong{s, } => panic!("field does not exist on this variant"),
                    SerializationError::InvalidUnicode{} => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field s for all enum members which have it
            pub fn s(&self) -> &Sequence<DafnyCharUTF16> {
                match self {
                    SerializationError::OutOfMemory{} => panic!("field does not exist on this variant"),
                    SerializationError::IntTooLarge{i, } => panic!("field does not exist on this variant"),
                    SerializationError::StringTooLong{s, } => s,
                    SerializationError::InvalidUnicode{} => panic!("field does not exist on this variant"),
                }
            }
        }

        impl Debug
            for SerializationError {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl DafnyPrint
            for SerializationError {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    SerializationError::OutOfMemory{} => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.SerializationError.OutOfMemory")?;
                        Ok(())
                    },
                    SerializationError::IntTooLarge{i, } => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.SerializationError.IntTooLarge(")?;
                        DafnyPrint::fmt_print(i, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    SerializationError::StringTooLong{s, } => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.SerializationError.StringTooLong(")?;
                        DafnyPrint::fmt_print(s, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    SerializationError::InvalidUnicode{} => {
                        write!(_formatter, "JSON_Compile.Errors_Compile.SerializationError.InvalidUnicode")?;
                        Ok(())
                    },
                }
            }
        }

        impl Eq
            for SerializationError {}

        impl Hash
            for SerializationError {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    SerializationError::OutOfMemory{} => {

                    },
                    SerializationError::IntTooLarge{i, } => {
                        Hash::hash(i, _state)
                    },
                    SerializationError::StringTooLong{s, } => {
                        Hash::hash(s, _state)
                    },
                    SerializationError::InvalidUnicode{} => {

                    },
                }
            }
        }

        impl Default
            for SerializationError {
            fn default() -> SerializationError {
                SerializationError::OutOfMemory {}
            }
        }

        impl AsRef<SerializationError>
            for SerializationError {
            fn as_ref(&self) -> &Self {
                self
            }
        }
    }

    /// ../mpl/libraries/src/JSON/Grammar.dfy(12,1)
    pub mod _Grammar_Compile {
        pub use ::dafny_runtime::truncate;
        pub use ::dafny_runtime::int;
        pub use ::dafny_runtime::DafnyCharUTF16;
        pub use ::dafny_runtime::Sequence;
        pub use ::dafny_runtime::seq;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_;
        pub use ::std::sync::Arc;
        pub use ::dafny_runtime::DafnyType;
        pub use ::std::fmt::Debug;
        pub use ::std::fmt::Formatter;
        pub use ::std::fmt::Result;
        pub use ::dafny_runtime::DafnyPrint;
        pub use ::dafny_runtime::upcast_id;
        pub use ::std::cmp::Eq;
        pub use ::std::hash::Hash;
        pub use ::std::hash::Hasher;
        pub use ::std::default::Default;
        pub use ::std::convert::AsRef;
        pub use ::dafny_runtime::rc_coerce;

        pub struct _default {}

        impl _default {
            /// ../mpl/libraries/src/JSON/Grammar.dfy(41,3)
            pub fn _Blank_q(b: u8) -> bool {
                b == truncate!(int!(32), u8) || b == truncate!(int!(9), u8) || b == truncate!(int!(10), u8) || b == truncate!(int!(13), u8)
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(67,3)
            pub fn _Digit_q(b: u8) -> bool {
                !(b < DafnyCharUTF16(48 as u16).0 as u8) && !((DafnyCharUTF16(57 as u16).0 as u8) < b)
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(61,3)
            pub fn NULL() -> Sequence<u8> {
                seq![DafnyCharUTF16(110 as u16).0 as u8, DafnyCharUTF16(117 as u16).0 as u8, DafnyCharUTF16(108 as u16).0 as u8, DafnyCharUTF16(108 as u16).0 as u8]
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(62,3)
            pub fn TRUE() -> Sequence<u8> {
                seq![DafnyCharUTF16(116 as u16).0 as u8, DafnyCharUTF16(114 as u16).0 as u8, DafnyCharUTF16(117 as u16).0 as u8, DafnyCharUTF16(101 as u16).0 as u8]
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(63,3)
            pub fn FALSE() -> Sequence<u8> {
                seq![DafnyCharUTF16(102 as u16).0 as u8, DafnyCharUTF16(97 as u16).0 as u8, DafnyCharUTF16(108 as u16).0 as u8, DafnyCharUTF16(115 as u16).0 as u8, DafnyCharUTF16(101 as u16).0 as u8]
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(17,3)
            pub fn DOUBLEQUOTE() -> View {
                View_::OfBytes(&seq![DafnyCharUTF16(34 as u16).0 as u8])
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(18,3)
            pub fn PERIOD() -> View {
                View_::OfBytes(&seq![DafnyCharUTF16(46 as u16).0 as u8])
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(19,3)
            pub fn E() -> View {
                View_::OfBytes(&seq![DafnyCharUTF16(101 as u16).0 as u8])
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(20,3)
            pub fn COLON() -> View {
                View_::OfBytes(&seq![DafnyCharUTF16(58 as u16).0 as u8])
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(21,3)
            pub fn COMMA() -> View {
                View_::OfBytes(&seq![DafnyCharUTF16(44 as u16).0 as u8])
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(22,3)
            pub fn LBRACE() -> View {
                View_::OfBytes(&seq![DafnyCharUTF16(123 as u16).0 as u8])
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(23,3)
            pub fn RBRACE() -> View {
                View_::OfBytes(&seq![DafnyCharUTF16(125 as u16).0 as u8])
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(24,3)
            pub fn LBRACKET() -> View {
                View_::OfBytes(&seq![DafnyCharUTF16(91 as u16).0 as u8])
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(25,3)
            pub fn RBRACKET() -> View {
                View_::OfBytes(&seq![DafnyCharUTF16(93 as u16).0 as u8])
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(26,3)
            pub fn MINUS() -> View {
                View_::OfBytes(&seq![DafnyCharUTF16(45 as u16).0 as u8])
            }
            /// ../mpl/libraries/src/JSON/Grammar.dfy(16,3)
            pub fn EMPTY() -> View {
                View_::OfBytes(&(seq![] as Sequence<u8>))
            }
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(28,3)
        pub type jchar = Arc<View_>;

        /// An element of jchar
        pub fn __init_jchar() -> Arc<View_> {
            View_::OfBytes(&seq![DafnyCharUTF16(98 as u16).0 as u8])
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(29,3)
        pub type jquote = Arc<View_>;

        /// An element of jquote
        pub fn __init_jquote() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::DOUBLEQUOTE()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(30,3)
        pub type jperiod = Arc<View_>;

        /// An element of jperiod
        pub fn __init_jperiod() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::PERIOD()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(31,3)
        pub type je = Arc<View_>;

        /// An element of je
        pub fn __init_je() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::E()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(32,3)
        pub type jcolon = Arc<View_>;

        /// An element of jcolon
        pub fn __init_jcolon() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::COLON()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(33,3)
        pub type jcomma = Arc<View_>;

        /// An element of jcomma
        pub fn __init_jcomma() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::COMMA()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(34,3)
        pub type jlbrace = Arc<View_>;

        /// An element of jlbrace
        pub fn __init_jlbrace() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::LBRACE()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(35,3)
        pub type jrbrace = Arc<View_>;

        /// An element of jrbrace
        pub fn __init_jrbrace() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::RBRACE()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(36,3)
        pub type jlbracket = Arc<View_>;

        /// An element of jlbracket
        pub fn __init_jlbracket() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::LBRACKET()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(37,3)
        pub type jrbracket = Arc<View_>;

        /// An element of jrbracket
        pub fn __init_jrbracket() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::RBRACKET()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(38,3)
        pub type jminus = Arc<View_>;

        /// An element of jminus
        pub fn __init_jminus() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::MINUS()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(39,3)
        pub type jsign = Arc<View_>;

        /// An element of jsign
        pub fn __init_jsign() -> Arc<View_> {
            crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::EMPTY()
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(43,3)
        pub type jblanks = Arc<View_>;

        /// An element of jblanks
        pub fn __init_jblanks() -> Arc<View_> {
            View_::OfBytes(&(seq![] as Sequence<u8>))
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(45,3)
        #[derive(PartialEq, Clone)]
        pub enum Structural<T: DafnyType> {
            Structural {
                before: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jblanks,
                t: T,
                after: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jblanks
            }
        }

        impl<T: DafnyType> Structural<T> {
            /// Returns a borrow of the field before
            pub fn before(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jblanks {
                match self {
                    Structural::Structural{before, t, after, } => before,
                }
            }
            /// Returns a borrow of the field t
            pub fn t(&self) -> &T {
                match self {
                    Structural::Structural{before, t, after, } => t,
                }
            }
            /// Returns a borrow of the field after
            pub fn after(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jblanks {
                match self {
                    Structural::Structural{before, t, after, } => after,
                }
            }
        }

        impl<T: DafnyType> Debug
            for Structural<T> {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl<T: DafnyType> DafnyPrint
            for Structural<T> {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    Structural::Structural{before, t, after, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Structural.Structural(")?;
                        DafnyPrint::fmt_print(before, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(t, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(after, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl<T: DafnyType> Structural<T> {
            /// Given type parameter conversions, returns a lambda to convert this structure
            pub fn coerce<__T0: DafnyType>(f_0: Arc<impl ::std::ops::Fn(T) -> __T0 + 'static>) -> Arc<impl ::std::ops::Fn(Structural<T>) -> Structural<__T0>> {
                Arc::new(move |this: Self| -> Structural<__T0>{
                        match this {
                            Structural::Structural{before, t, after, } => {
                                Structural::Structural {
                                    before: upcast_id::<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jblanks>()(before),
                                    t: f_0.clone()(t),
                                    after: upcast_id::<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jblanks>()(after)
                                }
                            },
                        }
                    })
            }
        }

        impl<T: DafnyType + Eq> Eq
            for Structural<T> {}

        impl<T: DafnyType + Hash> Hash
            for Structural<T> {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    Structural::Structural{before, t, after, } => {
                        Hash::hash(before, _state);
                        Hash::hash(t, _state);
                        Hash::hash(after, _state)
                    },
                }
            }
        }

        impl<T: DafnyType + Default> Default
            for Structural<T> {
            fn default() -> Structural<T> {
                Structural::Structural {
                    before: Default::default(),
                    t: Default::default(),
                    after: Default::default()
                }
            }
        }

        impl<T: DafnyType> AsRef<Structural<T>>
            for Structural<T> {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(48,3)
        #[derive(PartialEq, Clone)]
        pub enum Maybe<T: DafnyType> {
            Empty {},
            NonEmpty {
                t: T
            }
        }

        impl<T: DafnyType> Maybe<T> {
            /// Gets the field t for all enum members which have it
            pub fn t(&self) -> &T {
                match self {
                    Maybe::Empty{} => panic!("field does not exist on this variant"),
                    Maybe::NonEmpty{t, } => t,
                }
            }
        }

        impl<T: DafnyType> Debug
            for Maybe<T> {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl<T: DafnyType> DafnyPrint
            for Maybe<T> {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    Maybe::Empty{} => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Maybe.Empty")?;
                        Ok(())
                    },
                    Maybe::NonEmpty{t, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Maybe.NonEmpty(")?;
                        DafnyPrint::fmt_print(t, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl<T: DafnyType> Maybe<T> {
            /// Given type parameter conversions, returns a lambda to convert this structure
            pub fn coerce<__T0: DafnyType>(f_0: Arc<impl ::std::ops::Fn(T) -> __T0 + 'static>) -> Arc<impl ::std::ops::Fn(Maybe<T>) -> Maybe<__T0>> {
                Arc::new(move |this: Self| -> Maybe<__T0>{
                        match this {
                            Maybe::Empty{} => {
                                Maybe::Empty {}
                            },
                            Maybe::NonEmpty{t, } => {
                                Maybe::NonEmpty {
                                    t: f_0.clone()(t)
                                }
                            },
                        }
                    })
            }
        }

        impl<T: DafnyType + Eq> Eq
            for Maybe<T> {}

        impl<T: DafnyType + Hash> Hash
            for Maybe<T> {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    Maybe::Empty{} => {

                    },
                    Maybe::NonEmpty{t, } => {
                        Hash::hash(t, _state)
                    },
                }
            }
        }

        impl<T: DafnyType + Default> Default
            for Maybe<T> {
            fn default() -> Maybe<T> {
                Maybe::Empty {}
            }
        }

        impl<T: DafnyType> AsRef<Maybe<T>>
            for Maybe<T> {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(50,3)
        #[derive(PartialEq, Clone)]
        pub enum Suffixed<T: DafnyType, S: DafnyType> {
            Suffixed {
                t: T,
                suffix: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe<Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural<S>>>>
            }
        }

        impl<T: DafnyType, S: DafnyType> Suffixed<T, S> {
            /// Returns a borrow of the field t
            pub fn t(&self) -> &T {
                match self {
                    Suffixed::Suffixed{t, suffix, } => t,
                }
            }
            /// Returns a borrow of the field suffix
            pub fn suffix(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe<Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural<S>>>> {
                match self {
                    Suffixed::Suffixed{t, suffix, } => suffix,
                }
            }
        }

        impl<T: DafnyType, S: DafnyType> Debug
            for Suffixed<T, S> {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl<T: DafnyType, S: DafnyType> DafnyPrint
            for Suffixed<T, S> {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    Suffixed::Suffixed{t, suffix, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Suffixed.Suffixed(")?;
                        DafnyPrint::fmt_print(t, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(suffix, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl<T: DafnyType, S: DafnyType> Suffixed<T, S> {
            /// Given type parameter conversions, returns a lambda to convert this structure
            pub fn coerce<__T0: DafnyType, __T1: DafnyType>(f_0: Arc<impl ::std::ops::Fn(T) -> __T0 + 'static>, f_1: Arc<impl ::std::ops::Fn(S) -> __T1 + 'static>) -> Arc<impl ::std::ops::Fn(Suffixed<T, S>) -> Suffixed<__T0, __T1>> {
                Arc::new(move |this: Self| -> Suffixed<__T0, __T1>{
                        match this {
                            Suffixed::Suffixed{t, suffix, } => {
                                Suffixed::Suffixed {
                                    t: f_0.clone()(t),
                                    suffix: rc_coerce(crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural<S>>>::coerce(rc_coerce(crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural::<S>::coerce(f_1.clone()))))(suffix)
                                }
                            },
                        }
                    })
            }
        }

        impl<T: DafnyType + Eq, S: DafnyType + Eq> Eq
            for Suffixed<T, S> {}

        impl<T: DafnyType + Hash, S: DafnyType + Hash> Hash
            for Suffixed<T, S> {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    Suffixed::Suffixed{t, suffix, } => {
                        Hash::hash(t, _state);
                        Hash::hash(suffix, _state)
                    },
                }
            }
        }

        impl<T: DafnyType + Default, S: DafnyType + Default> Default
            for Suffixed<T, S> {
            fn default() -> Suffixed<T, S> {
                Suffixed::Suffixed {
                    t: Default::default(),
                    suffix: Default::default()
                }
            }
        }

        impl<T: DafnyType, S: DafnyType> AsRef<Suffixed<T, S>>
            for Suffixed<T, S> {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(53,3)
        pub type SuffixedSequence<D: DafnyType, S: DafnyType> = Sequence<Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Suffixed<D, S>>>;

        /// ../mpl/libraries/src/JSON/Grammar.dfy(58,3)
        #[derive(PartialEq, Clone)]
        pub enum Bracketed<L: DafnyType, D: DafnyType, S: DafnyType, R: DafnyType> {
            Bracketed {
                l: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural<L>>,
                data: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::SuffixedSequence<D, S>,
                r: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural<R>>
            }
        }

        impl<L: DafnyType, D: DafnyType, S: DafnyType, R: DafnyType> Bracketed<L, D, S, R> {
            /// Returns a borrow of the field l
            pub fn l(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural<L>> {
                match self {
                    Bracketed::Bracketed{l, data, r, } => l,
                }
            }
            /// Returns a borrow of the field data
            pub fn data(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::SuffixedSequence<D, S> {
                match self {
                    Bracketed::Bracketed{l, data, r, } => data,
                }
            }
            /// Returns a borrow of the field r
            pub fn r(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural<R>> {
                match self {
                    Bracketed::Bracketed{l, data, r, } => r,
                }
            }
        }

        impl<L: DafnyType, D: DafnyType, S: DafnyType, R: DafnyType> Debug
            for Bracketed<L, D, S, R> {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl<L: DafnyType, D: DafnyType, S: DafnyType, R: DafnyType> DafnyPrint
            for Bracketed<L, D, S, R> {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    Bracketed::Bracketed{l, data, r, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Bracketed.Bracketed(")?;
                        DafnyPrint::fmt_print(l, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(data, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(r, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl<L: DafnyType, D: DafnyType, S: DafnyType, R: DafnyType> Bracketed<L, D, S, R> {
            /// Given type parameter conversions, returns a lambda to convert this structure
            pub fn coerce<__T0: DafnyType, __T1: DafnyType, __T2: DafnyType, __T3: DafnyType>(f_0: Arc<impl ::std::ops::Fn(L) -> __T0 + 'static>, f_1: Arc<impl ::std::ops::Fn(D) -> __T1 + 'static>, f_2: Arc<impl ::std::ops::Fn(S) -> __T2 + 'static>, f_3: Arc<impl ::std::ops::Fn(R) -> __T3 + 'static>) -> Arc<impl ::std::ops::Fn(Bracketed<L, D, S, R>) -> Bracketed<__T0, __T1, __T2, __T3>> {
                Arc::new(move |this: Self| -> Bracketed<__T0, __T1, __T2, __T3>{
                        match this {
                            Bracketed::Bracketed{l, data, r, } => {
                                Bracketed::Bracketed {
                                    l: rc_coerce(crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural::<L>::coerce(f_0.clone()))(l),
                                    data: todo!("Could not generate coercion function for contructor 1 of Bracketed"),
                                    r: rc_coerce(crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural::<R>::coerce(f_3.clone()))(r)
                                }
                            },
                        }
                    })
            }
        }

        impl<L: DafnyType + Eq, D: DafnyType + Eq, S: DafnyType + Eq, R: DafnyType + Eq> Eq
            for Bracketed<L, D, S, R> {}

        impl<L: DafnyType + Hash, D: DafnyType + Hash, S: DafnyType + Hash, R: DafnyType + Hash> Hash
            for Bracketed<L, D, S, R> {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    Bracketed::Bracketed{l, data, r, } => {
                        Hash::hash(l, _state);
                        Hash::hash(data, _state);
                        Hash::hash(r, _state)
                    },
                }
            }
        }

        impl<L: DafnyType + Default, D: DafnyType + Default, S: DafnyType + Default, R: DafnyType + Default> Default
            for Bracketed<L, D, S, R> {
            fn default() -> Bracketed<L, D, S, R> {
                Bracketed::Bracketed {
                    l: Default::default(),
                    data: Default::default(),
                    r: Default::default()
                }
            }
        }

        impl<L: DafnyType, D: DafnyType, S: DafnyType, R: DafnyType> AsRef<Bracketed<L, D, S, R>>
            for Bracketed<L, D, S, R> {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(72,3)
        pub type jnull = Arc<View_>;

        /// An element of jnull
        pub fn __init_jnull() -> Arc<View_> {
            View_::OfBytes(&crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::NULL())
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(73,3)
        pub type jbool = Arc<View_>;

        /// An element of jbool
        pub fn __init_jbool() -> Arc<View_> {
            View_::OfBytes(&crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::TRUE())
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(74,3)
        pub type jdigits = Arc<View_>;

        /// An element of jdigits
        pub fn __init_jdigits() -> Arc<View_> {
            View_::OfBytes(&(seq![] as Sequence<u8>))
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(75,3)
        pub type jnum = Arc<View_>;

        /// An element of jnum
        pub fn __init_jnum() -> Arc<View_> {
            View_::OfBytes(&seq![DafnyCharUTF16(48 as u16).0 as u8])
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(76,3)
        pub type jint = Arc<View_>;

        /// An element of jint
        pub fn __init_jint() -> Arc<View_> {
            View_::OfBytes(&seq![DafnyCharUTF16(48 as u16).0 as u8])
        }

        /// TODO: Enforce quoting and escaping
        /// ../mpl/libraries/src/JSON/Grammar.dfy(77,3)
        pub type jstr = Arc<View_>;

        /// An element of jstr
        pub fn __init_jstr() -> Arc<View_> {
            View_::OfBytes(&(seq![] as Sequence<u8>))
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(78,3)
        #[derive(PartialEq, Clone)]
        pub enum jstring {
            JString {
                lq: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jquote,
                contents: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstr,
                rq: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jquote
            }
        }

        impl jstring {
            /// Returns a borrow of the field lq
            pub fn lq(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jquote {
                match self {
                    jstring::JString{lq, contents, rq, } => lq,
                }
            }
            /// Returns a borrow of the field contents
            pub fn contents(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstr {
                match self {
                    jstring::JString{lq, contents, rq, } => contents,
                }
            }
            /// Returns a borrow of the field rq
            pub fn rq(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jquote {
                match self {
                    jstring::JString{lq, contents, rq, } => rq,
                }
            }
        }

        impl Debug
            for jstring {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl DafnyPrint
            for jstring {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    jstring::JString{lq, contents, rq, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.jstring.JString(")?;
                        DafnyPrint::fmt_print(lq, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(contents, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(rq, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl Eq
            for jstring {}

        impl Hash
            for jstring {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    jstring::JString{lq, contents, rq, } => {
                        Hash::hash(lq, _state);
                        Hash::hash(contents, _state);
                        Hash::hash(rq, _state)
                    },
                }
            }
        }

        impl Default
            for jstring {
            fn default() -> jstring {
                jstring::JString {
                    lq: Default::default(),
                    contents: Default::default(),
                    rq: Default::default()
                }
            }
        }

        impl AsRef<jstring>
            for jstring {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(79,3)
        #[derive(PartialEq, Clone)]
        pub enum jKeyValue {
            KeyValue {
                k: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring>,
                colon: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcolon>>,
                v: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value>
            }
        }

        impl jKeyValue {
            /// Returns a borrow of the field k
            pub fn k(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring> {
                match self {
                    jKeyValue::KeyValue{k, colon, v, } => k,
                }
            }
            /// Returns a borrow of the field colon
            pub fn colon(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcolon>> {
                match self {
                    jKeyValue::KeyValue{k, colon, v, } => colon,
                }
            }
            /// Returns a borrow of the field v
            pub fn v(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value> {
                match self {
                    jKeyValue::KeyValue{k, colon, v, } => v,
                }
            }
        }

        impl Debug
            for jKeyValue {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl DafnyPrint
            for jKeyValue {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    jKeyValue::KeyValue{k, colon, v, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.jKeyValue.KeyValue(")?;
                        DafnyPrint::fmt_print(k, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(colon, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(v, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl Eq
            for jKeyValue {}

        impl Hash
            for jKeyValue {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    jKeyValue::KeyValue{k, colon, v, } => {
                        Hash::hash(k, _state);
                        Hash::hash(colon, _state);
                        Hash::hash(v, _state)
                    },
                }
            }
        }

        impl Default
            for jKeyValue {
            fn default() -> jKeyValue {
                jKeyValue::KeyValue {
                    k: Default::default(),
                    colon: Default::default(),
                    v: Default::default()
                }
            }
        }

        impl AsRef<jKeyValue>
            for jKeyValue {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(89,3)
        #[derive(PartialEq, Clone)]
        pub enum jfrac {
            JFrac {
                period: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jperiod,
                num: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnum
            }
        }

        impl jfrac {
            /// Returns a borrow of the field period
            pub fn period(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jperiod {
                match self {
                    jfrac::JFrac{period, num, } => period,
                }
            }
            /// Returns a borrow of the field num
            pub fn num(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnum {
                match self {
                    jfrac::JFrac{period, num, } => num,
                }
            }
        }

        impl Debug
            for jfrac {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl DafnyPrint
            for jfrac {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    jfrac::JFrac{period, num, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.jfrac.JFrac(")?;
                        DafnyPrint::fmt_print(period, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(num, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl Eq
            for jfrac {}

        impl Hash
            for jfrac {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    jfrac::JFrac{period, num, } => {
                        Hash::hash(period, _state);
                        Hash::hash(num, _state)
                    },
                }
            }
        }

        impl Default
            for jfrac {
            fn default() -> jfrac {
                jfrac::JFrac {
                    period: Default::default(),
                    num: Default::default()
                }
            }
        }

        impl AsRef<jfrac>
            for jfrac {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(90,3)
        #[derive(PartialEq, Clone)]
        pub enum jexp {
            JExp {
                e: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::je,
                sign: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jsign,
                num: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnum
            }
        }

        impl jexp {
            /// Returns a borrow of the field e
            pub fn e(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::je {
                match self {
                    jexp::JExp{e, sign, num, } => e,
                }
            }
            /// Returns a borrow of the field sign
            pub fn sign(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jsign {
                match self {
                    jexp::JExp{e, sign, num, } => sign,
                }
            }
            /// Returns a borrow of the field num
            pub fn num(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnum {
                match self {
                    jexp::JExp{e, sign, num, } => num,
                }
            }
        }

        impl Debug
            for jexp {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl DafnyPrint
            for jexp {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    jexp::JExp{e, sign, num, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.jexp.JExp(")?;
                        DafnyPrint::fmt_print(e, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(sign, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(num, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl Eq
            for jexp {}

        impl Hash
            for jexp {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    jexp::JExp{e, sign, num, } => {
                        Hash::hash(e, _state);
                        Hash::hash(sign, _state);
                        Hash::hash(num, _state)
                    },
                }
            }
        }

        impl Default
            for jexp {
            fn default() -> jexp {
                jexp::JExp {
                    e: Default::default(),
                    sign: Default::default(),
                    num: Default::default()
                }
            }
        }

        impl AsRef<jexp>
            for jexp {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(91,3)
        #[derive(PartialEq, Clone)]
        pub enum jnumber {
            JNumber {
                minus: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jminus,
                num: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnum,
                frac: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe<Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jfrac>>>,
                exp: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe<Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jexp>>>
            }
        }

        impl jnumber {
            /// Returns a borrow of the field minus
            pub fn minus(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jminus {
                match self {
                    jnumber::JNumber{minus, num, frac, exp, } => minus,
                }
            }
            /// Returns a borrow of the field num
            pub fn num(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnum {
                match self {
                    jnumber::JNumber{minus, num, frac, exp, } => num,
                }
            }
            /// Returns a borrow of the field frac
            pub fn frac(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe<Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jfrac>>> {
                match self {
                    jnumber::JNumber{minus, num, frac, exp, } => frac,
                }
            }
            /// Returns a borrow of the field exp
            pub fn exp(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe<Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jexp>>> {
                match self {
                    jnumber::JNumber{minus, num, frac, exp, } => exp,
                }
            }
        }

        impl Debug
            for jnumber {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl DafnyPrint
            for jnumber {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    jnumber::JNumber{minus, num, frac, exp, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.jnumber.JNumber(")?;
                        DafnyPrint::fmt_print(minus, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(num, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(frac, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(exp, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl Eq
            for jnumber {}

        impl Hash
            for jnumber {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    jnumber::JNumber{minus, num, frac, exp, } => {
                        Hash::hash(minus, _state);
                        Hash::hash(num, _state);
                        Hash::hash(frac, _state);
                        Hash::hash(exp, _state)
                    },
                }
            }
        }

        impl Default
            for jnumber {
            fn default() -> jnumber {
                jnumber::JNumber {
                    minus: Default::default(),
                    num: Default::default(),
                    frac: Default::default(),
                    exp: Default::default()
                }
            }
        }

        impl AsRef<jnumber>
            for jnumber {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Grammar.dfy(93,3)
        #[derive(PartialEq, Clone)]
        pub enum Value {
            Null {
                n: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnull
            },
            Bool {
                b: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jbool
            },
            String {
                str: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring>
            },
            Number {
                num: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnumber>
            },
            Object {
                obj: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbrace, Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jKeyValue>, crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma, crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbrace>>
            },
            Array {
                arr: Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbracket, Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value>, crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma, crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbracket>>
            }
        }

        impl Value {
            /// Gets the field n for all enum members which have it
            pub fn n(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnull {
                match self {
                    Value::Null{n, } => n,
                    Value::Bool{b, } => panic!("field does not exist on this variant"),
                    Value::String{str, } => panic!("field does not exist on this variant"),
                    Value::Number{num, } => panic!("field does not exist on this variant"),
                    Value::Object{obj, } => panic!("field does not exist on this variant"),
                    Value::Array{arr, } => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field b for all enum members which have it
            pub fn b(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jbool {
                match self {
                    Value::Null{n, } => panic!("field does not exist on this variant"),
                    Value::Bool{b, } => b,
                    Value::String{str, } => panic!("field does not exist on this variant"),
                    Value::Number{num, } => panic!("field does not exist on this variant"),
                    Value::Object{obj, } => panic!("field does not exist on this variant"),
                    Value::Array{arr, } => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field str for all enum members which have it
            pub fn str(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring> {
                match self {
                    Value::Null{n, } => panic!("field does not exist on this variant"),
                    Value::Bool{b, } => panic!("field does not exist on this variant"),
                    Value::String{str, } => str,
                    Value::Number{num, } => panic!("field does not exist on this variant"),
                    Value::Object{obj, } => panic!("field does not exist on this variant"),
                    Value::Array{arr, } => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field num for all enum members which have it
            pub fn num(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnumber> {
                match self {
                    Value::Null{n, } => panic!("field does not exist on this variant"),
                    Value::Bool{b, } => panic!("field does not exist on this variant"),
                    Value::String{str, } => panic!("field does not exist on this variant"),
                    Value::Number{num, } => num,
                    Value::Object{obj, } => panic!("field does not exist on this variant"),
                    Value::Array{arr, } => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field obj for all enum members which have it
            pub fn obj(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbrace, Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jKeyValue>, crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma, crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbrace>> {
                match self {
                    Value::Null{n, } => panic!("field does not exist on this variant"),
                    Value::Bool{b, } => panic!("field does not exist on this variant"),
                    Value::String{str, } => panic!("field does not exist on this variant"),
                    Value::Number{num, } => panic!("field does not exist on this variant"),
                    Value::Object{obj, } => obj,
                    Value::Array{arr, } => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field arr for all enum members which have it
            pub fn arr(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbracket, Arc<crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value>, crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma, crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbracket>> {
                match self {
                    Value::Null{n, } => panic!("field does not exist on this variant"),
                    Value::Bool{b, } => panic!("field does not exist on this variant"),
                    Value::String{str, } => panic!("field does not exist on this variant"),
                    Value::Number{num, } => panic!("field does not exist on this variant"),
                    Value::Object{obj, } => panic!("field does not exist on this variant"),
                    Value::Array{arr, } => arr,
                }
            }
        }

        impl Debug
            for Value {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl DafnyPrint
            for Value {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    Value::Null{n, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Value.Null(")?;
                        DafnyPrint::fmt_print(n, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    Value::Bool{b, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Value.Bool(")?;
                        DafnyPrint::fmt_print(b, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    Value::String{str, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Value.String(")?;
                        DafnyPrint::fmt_print(str, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    Value::Number{num, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Value.Number(")?;
                        DafnyPrint::fmt_print(num, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    Value::Object{obj, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Value.Object(")?;
                        DafnyPrint::fmt_print(obj, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    Value::Array{arr, } => {
                        write!(_formatter, "JSON_Compile.Grammar_Compile.Value.Array(")?;
                        DafnyPrint::fmt_print(arr, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl Eq
            for Value {}

        impl Hash
            for Value {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    Value::Null{n, } => {
                        Hash::hash(n, _state)
                    },
                    Value::Bool{b, } => {
                        Hash::hash(b, _state)
                    },
                    Value::String{str, } => {
                        Hash::hash(str, _state)
                    },
                    Value::Number{num, } => {
                        Hash::hash(num, _state)
                    },
                    Value::Object{obj, } => {
                        Hash::hash(obj, _state)
                    },
                    Value::Array{arr, } => {
                        Hash::hash(arr, _state)
                    },
                }
            }
        }

        impl Default
            for Value {
            fn default() -> Value {
                Value::Null {
                    n: Default::default()
                }
            }
        }

        impl AsRef<Value>
            for Value {
            fn as_ref(&self) -> &Self {
                self
            }
        }
    }

    /// ../mpl/libraries/src/JSON/Serializer.dfy(21,1)
    pub mod _Serializer_Compile {
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jbool;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_;
        pub use ::dafny_runtime::DafnyType;
        pub use ::dafny_runtime::Sequence;
        pub use ::std::sync::Arc;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::SerializationError;
        pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
        pub use ::dafny_runtime::DafnyCharUTF16;
        pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring;
        pub use ::dafny_runtime::int;
        pub use ::dafny_runtime::DafnyInt;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jminus;
        pub use ::dafny_runtime::seq;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::Decimal;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnumber;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnum;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jfrac;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jexp;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::je;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jsign;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jKeyValue;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
        pub use ::dafny_runtime::_System::nat;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::SuffixedSequence;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Suffixed;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbrace;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbrace;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbracket;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbracket;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON::Null;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON::Bool;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON::String;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON::Number;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON::Object;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcolon;

        pub struct _default {}

        impl _default {
            /// ../mpl/libraries/src/JSON/Serializer.dfy(41,3)
            pub fn Bool(b: bool) -> jbool {
                View_::OfBytes(&(if b {
                        crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::TRUE()
                    } else {
                        crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::FALSE()
                    }))
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(45,3)
            pub fn CheckLength<_T: DafnyType>(s: &Sequence<_T>, err: &Arc<SerializationError>) -> Arc<Outcome<Arc<SerializationError>>> {
                crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<SerializationError>>(s.cardinality() < crate::implementation_from_dafny::_BoundedInts_Compile::_default::TWO_TO_THE_32(), err)
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(49,3)
            pub fn String(str: &Sequence<DafnyCharUTF16>) -> Arc<Result<Arc<jstring>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::EscapeToUTF8(str, &int!(0));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<jstring>>()
                } else {
                    let mut bs: Sequence<u8> = valueOrError0.Extract();
                    let mut valueOrError1: Arc<Outcome<Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::CheckLength::<u8>(&bs, &Arc::new(SerializationError::StringTooLong {
                                    s: str.clone()
                                }));
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Arc<jstring>>()
                    } else {
                        Arc::new(Result::<Arc<jstring>, Arc<SerializationError>>::Success {
                                value: Arc::new(jstring::JString {
                                            lq: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::DOUBLEQUOTE(),
                                            contents: View_::OfBytes(&bs),
                                            rq: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::DOUBLEQUOTE()
                                        })
                            })
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(55,3)
            pub fn Sign(n: &DafnyInt) -> jminus {
                View_::OfBytes(&(if n.clone() < int!(0) {
                        seq![DafnyCharUTF16(45 as u16).0 as u8]
                    } else {
                        seq![] as Sequence<u8>
                    }))
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(72,3)
            pub fn _Int_k(n: &DafnyInt) -> Sequence<u8> {
                crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_ByteStrConversion_Compile::_default::OfInt_any(n, &crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::DIGITS(), crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::MINUS())
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(78,3)
            pub fn Int(n: &DafnyInt) -> Arc<Result<View, Arc<SerializationError>>> {
                let mut bs: Sequence<u8> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::_Int_k(n);
                let mut valueOrError0: Arc<Outcome<Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::CheckLength::<u8>(&bs, &Arc::new(SerializationError::IntTooLarge {
                                i: n.clone()
                            }));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<View>()
                } else {
                    Arc::new(Result::<View, Arc<SerializationError>>::Success {
                            value: View_::OfBytes(&bs)
                        })
                }
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(84,3)
            pub fn Number(dec: &Arc<Decimal>) -> Arc<Result<Arc<jnumber>, Arc<SerializationError>>> {
                let mut minus: jminus = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Sign(dec.n());
                let mut valueOrError0: Arc<Result<View, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Int(&crate::implementation_from_dafny::_Math_Compile::_default::Abs(dec.n()));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<jnumber>>()
                } else {
                    let mut num: jnum = valueOrError0.Extract();
                    let mut frac: Arc<Maybe<Arc<jfrac>>> = Arc::new(Maybe::<Arc<jfrac>>::Empty {});
                    let mut valueOrError1: Arc<Result<Arc<Maybe<Arc<jexp>>>, Arc<SerializationError>>> = if dec.e10().clone() == int!(0) {
                            Arc::new(Result::<Arc<Maybe<Arc<jexp>>>, Arc<SerializationError>>::Success {
                                    value: Arc::new(Maybe::<Arc<jexp>>::Empty {})
                                })
                        } else {
                            {
                                let __pat_let12_0: View = View_::OfBytes(&seq![DafnyCharUTF16(101 as u16).0 as u8]);
                                {
                                    let e: je = __pat_let12_0.clone();
                                    {
                                        let __pat_let13_0: jminus = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Sign(dec.e10());
                                        {
                                            let sign: jsign = __pat_let13_0.clone();
                                            {
                                                let __pat_let14_0: Arc<Result<View, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Int(&crate::implementation_from_dafny::_Math_Compile::_default::Abs(dec.e10()));
                                                {
                                                    let valueOrError2: Arc<Result<View, Arc<SerializationError>>> = __pat_let14_0.clone();
                                                    if valueOrError2.IsFailure() {
                                                        valueOrError2.PropagateFailure::<Arc<Maybe<Arc<jexp>>>>()
                                                    } else {
                                                        {
                                                            let __pat_let15_0: View = valueOrError2.Extract();
                                                            {
                                                                let num: jnum = __pat_let15_0.clone();
                                                                Arc::new(Result::<Arc<Maybe<Arc<jexp>>>, Arc<SerializationError>>::Success {
                                                                        value: Arc::new(Maybe::<Arc<jexp>>::NonEmpty {
                                                                                    t: Arc::new(jexp::JExp {
                                                                                                e: e.clone(),
                                                                                                sign: sign.clone(),
                                                                                                num: num.clone()
                                                                                            })
                                                                                })
                                                                    })
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        };
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Arc<jnumber>>()
                    } else {
                        let mut exp: Arc<Maybe<Arc<jexp>>> = valueOrError1.Extract();
                        Arc::new(Result::<Arc<jnumber>, Arc<SerializationError>>::Success {
                                value: Arc::new(jnumber::JNumber {
                                            minus: minus.clone(),
                                            num: num.clone(),
                                            frac: Arc::new(Maybe::<Arc<jfrac>>::Empty {}),
                                            exp: exp.clone()
                                        })
                            })
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(99,3)
            pub fn MkStructural<_T: DafnyType>(v: &_T) -> Arc<Structural<_T>> {
                Arc::new(Structural::<_T>::Structural {
                        before: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::EMPTY(),
                        t: v.clone(),
                        after: crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::EMPTY()
                    })
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(106,3)
            pub fn KeyValue(kv: &(Sequence<DafnyCharUTF16>, Arc<JSON>)) -> Arc<Result<Arc<jKeyValue>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Arc<jstring>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::String(&kv.0.clone());
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<jKeyValue>>()
                } else {
                    let mut k: Arc<jstring> = valueOrError0.Extract();
                    let mut valueOrError1: Arc<Result<Arc<Value>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Value(&kv.1.clone());
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Arc<jKeyValue>>()
                    } else {
                        let mut v: Arc<Value> = valueOrError1.Extract();
                        Arc::new(Result::<Arc<jKeyValue>, Arc<SerializationError>>::Success {
                                value: Arc::new(jKeyValue::KeyValue {
                                            k: k.clone(),
                                            colon: crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::COLON(),
                                            v: v.clone()
                                        })
                            })
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(112,3)
            pub fn MkSuffixedSequence<_D: DafnyType, _S: DafnyType>(ds: &Sequence<_D>, suffix: &Arc<Structural<_S>>, start: &nat) -> SuffixedSequence<_D, _S> {
                let mut _accumulator: SuffixedSequence<_D, _S> = seq![] as Sequence<Arc<Suffixed<_D, _S>>>;
                let mut _r0 = ds.clone();
                let mut _r1 = suffix.clone();
                let mut _r2 = start.clone();
                'TAIL_CALL_START: loop {
                    let ds = _r0;
                    let suffix = _r1;
                    let start = _r2;
                    if !(start.clone() < ds.cardinality()) {
                        return _accumulator.concat(&(seq![] as Sequence<Arc<Suffixed<_D, _S>>>));
                    } else {
                        if start.clone() == ds.cardinality() - int!(1) {
                            return _accumulator.concat(&seq![Arc::new(Suffixed::<_D, _S>::Suffixed {
                                                t: ds.get(&start),
                                                suffix: Arc::new(Maybe::<Arc<Structural<_S>>>::Empty {})
                                            })]);
                        } else {
                            _accumulator = _accumulator.concat(&seq![Arc::new(Suffixed::<_D, _S>::Suffixed {
                                                t: ds.get(&start),
                                                suffix: Arc::new(Maybe::<Arc<Structural<_S>>>::NonEmpty {
                                                            t: suffix.clone()
                                                        })
                                            })]);
                            let mut _in0: Sequence<_D> = ds.clone();
                            let mut _in1: Arc<Structural<_S>> = suffix.clone();
                            let mut _in2: DafnyInt = start.clone() + int!(1);
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            _r2 = _in2.clone();
                            continue 'TAIL_CALL_START;
                        }
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(124,3)
            pub fn Object(obj: &Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)>) -> Arc<Result<Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Sequence<Arc<jKeyValue>>, Arc<SerializationError>>> = crate::implementation_from_dafny::_Seq_Compile::_default::MapWithResult::<(Sequence<DafnyCharUTF16>, Arc<JSON>), Arc<jKeyValue>, Arc<SerializationError>>({
                            let obj: Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)> = obj.clone();
                            &({
                                Arc::new(move |v: &(Sequence<DafnyCharUTF16>, Arc<JSON>)| -> Arc<Result<Arc<jKeyValue>, Arc<SerializationError>>>{
                                        crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::KeyValue(v)
                                    })
                            })
                        }, obj);
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<Bracketed<View, Arc<jKeyValue>, jcomma, View>>>()
                } else {
                    let mut items: Sequence<Arc<jKeyValue>> = valueOrError0.Extract();
                    Arc::new(Result::<Arc<Bracketed<View, Arc<jKeyValue>, jcomma, View>>, Arc<SerializationError>>::Success {
                            value: Arc::new(Bracketed::<View, Arc<jKeyValue>, jcomma, View>::Bracketed {
                                        l: crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::MkStructural::<View>(&crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::LBRACE()),
                                        data: crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::MkSuffixedSequence::<Arc<jKeyValue>, jcomma>(&items, &crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::COMMA(), &int!(0)),
                                        r: crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::MkStructural::<View>(&crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::RBRACE())
                                    })
                        })
                }
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(132,3)
            pub fn Array(arr: &Sequence<Arc<JSON>>) -> Arc<Result<Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Sequence<Arc<Value>>, Arc<SerializationError>>> = crate::implementation_from_dafny::_Seq_Compile::_default::MapWithResult::<Arc<JSON>, Arc<Value>, Arc<SerializationError>>({
                            let arr: Sequence<Arc<JSON>> = arr.clone();
                            &({
                                Arc::new(move |v: &Arc<JSON>| -> Arc<Result<Arc<Value>, Arc<SerializationError>>>{
                                        crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Value(v)
                                    })
                            })
                        }, arr);
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<Bracketed<View, Arc<Value>, jcomma, View>>>()
                } else {
                    let mut items: Sequence<Arc<Value>> = valueOrError0.Extract();
                    Arc::new(Result::<Arc<Bracketed<View, Arc<Value>, jcomma, View>>, Arc<SerializationError>>::Success {
                            value: Arc::new(Bracketed::<View, Arc<Value>, jcomma, View>::Bracketed {
                                        l: crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::MkStructural::<View>(&crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::LBRACKET()),
                                        data: crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::MkSuffixedSequence::<Arc<Value>, jcomma>(&items, &crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::COMMA(), &int!(0)),
                                        r: crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::MkStructural::<View>(&crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::RBRACKET())
                                    })
                        })
                }
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(139,3)
            pub fn Value(js: &Arc<JSON>) -> Arc<Result<Arc<Value>, Arc<SerializationError>>> {
                let mut _source0: Arc<JSON> = js.clone();
                if matches!((&_source0).as_ref(), Null{ .. }) {
                    Arc::new(Result::<Arc<Value>, Arc<SerializationError>>::Success {
                            value: Arc::new(Value::Null {
                                        n: View_::OfBytes(&crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::NULL())
                                    })
                        })
                } else {
                    if matches!((&_source0).as_ref(), Bool{ .. }) {
                        let mut ___mcc_h0: bool = _source0.b().clone();
                        let mut b: bool = ___mcc_h0;
                        Arc::new(Result::<Arc<Value>, Arc<SerializationError>>::Success {
                                value: Arc::new(Value::Bool {
                                            b: crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Bool(b)
                                        })
                            })
                    } else {
                        if matches!((&_source0).as_ref(), String{ .. }) {
                            let mut ___mcc_h1: Sequence<DafnyCharUTF16> = _source0.str().clone();
                            let mut str: Sequence<DafnyCharUTF16> = ___mcc_h1.clone();
                            let mut valueOrError0: Arc<Result<Arc<jstring>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::String(&str);
                            if valueOrError0.IsFailure() {
                                valueOrError0.PropagateFailure::<Arc<Value>>()
                            } else {
                                let mut s: Arc<jstring> = valueOrError0.Extract();
                                Arc::new(Result::<Arc<Value>, Arc<SerializationError>>::Success {
                                        value: Arc::new(Value::String {
                                                    str: s.clone()
                                                })
                                    })
                            }
                        } else {
                            if matches!((&_source0).as_ref(), Number{ .. }) {
                                let mut ___mcc_h2: Arc<Decimal> = _source0.num().clone();
                                let mut dec: Arc<Decimal> = ___mcc_h2.clone();
                                let mut valueOrError1: Arc<Result<Arc<jnumber>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Number(&dec);
                                if valueOrError1.IsFailure() {
                                    valueOrError1.PropagateFailure::<Arc<Value>>()
                                } else {
                                    let mut n: Arc<jnumber> = valueOrError1.Extract();
                                    Arc::new(Result::<Arc<Value>, Arc<SerializationError>>::Success {
                                            value: Arc::new(Value::Number {
                                                        num: n.clone()
                                                    })
                                        })
                                }
                            } else {
                                if matches!((&_source0).as_ref(), Object{ .. }) {
                                    let mut ___mcc_h3: Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)> = _source0.obj().clone();
                                    let mut obj: Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)> = ___mcc_h3.clone();
                                    let mut valueOrError2: Arc<Result<Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Object(&obj);
                                    if valueOrError2.IsFailure() {
                                        valueOrError2.PropagateFailure::<Arc<Value>>()
                                    } else {
                                        let mut o: Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>> = valueOrError2.Extract();
                                        Arc::new(Result::<Arc<Value>, Arc<SerializationError>>::Success {
                                                value: Arc::new(Value::Object {
                                                            obj: o.clone()
                                                        })
                                            })
                                    }
                                } else {
                                    let mut ___mcc_h4: Sequence<Arc<JSON>> = _source0.arr().clone();
                                    let mut arr: Sequence<Arc<JSON>> = ___mcc_h4.clone();
                                    let mut valueOrError3: Arc<Result<Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Array(&arr);
                                    if valueOrError3.IsFailure() {
                                        valueOrError3.PropagateFailure::<Arc<Value>>()
                                    } else {
                                        let mut a: Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>> = valueOrError3.Extract();
                                        Arc::new(Result::<Arc<Value>, Arc<SerializationError>>::Success {
                                                value: Arc::new(Value::Array {
                                                            arr: a.clone()
                                                        })
                                            })
                                    }
                                }
                            }
                        }
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(149,3)
            pub fn JSON(js: &Arc<JSON>) -> Arc<Result<Arc<Structural<Arc<Value>>>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Arc<Value>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::Value(js);
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<Structural<Arc<Value>>>>()
                } else {
                    let mut val: Arc<Value> = valueOrError0.Extract();
                    Arc::new(Result::<Arc<Structural<Arc<Value>>>, Arc<SerializationError>>::Success {
                            value: crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::MkStructural::<Arc<Value>>(&val)
                        })
                }
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(64,3)
            pub fn DIGITS() -> Sequence<u8> {
                seq![DafnyCharUTF16(48 as u16).0 as u8, DafnyCharUTF16(49 as u16).0 as u8, DafnyCharUTF16(50 as u16).0 as u8, DafnyCharUTF16(51 as u16).0 as u8, DafnyCharUTF16(52 as u16).0 as u8, DafnyCharUTF16(53 as u16).0 as u8, DafnyCharUTF16(54 as u16).0 as u8, DafnyCharUTF16(55 as u16).0 as u8, DafnyCharUTF16(56 as u16).0 as u8, DafnyCharUTF16(57 as u16).0 as u8]
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(70,3)
            pub fn MINUS() -> u8 {
                DafnyCharUTF16(45 as u16).0 as u8
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(103,3)
            pub fn COLON() -> Arc<Structural<jcolon>> {
                crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::MkStructural::<View>(&crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::COLON())
            }
            /// ../mpl/libraries/src/JSON/Serializer.dfy(121,3)
            pub fn COMMA() -> Arc<Structural<jcomma>> {
                crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_default::MkStructural::<View>(&crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::COMMA())
            }
        }

        /// ../mpl/libraries/src/JSON/Serializer.dfy(38,3)
        pub type bytes32 = Sequence<u8>;

        /// ../mpl/libraries/src/JSON/Serializer.dfy(39,3)
        pub type string32 = Sequence<DafnyCharUTF16>;

        /// ../mpl/libraries/src/JSON/Serializer.dfy(59,3)
        pub mod _ByteStrConversion_Compile {
            pub use ::dafny_runtime::_System::nat;
            pub use ::dafny_runtime::DafnyInt;
            pub use ::dafny_runtime::Sequence;
            pub use ::dafny_runtime::int;
            pub use ::dafny_runtime::seq;
            pub use ::dafny_runtime::euclidian_division;
            pub use ::dafny_runtime::euclidian_modulo;
            pub use ::std::sync::Arc;
            pub use ::std::marker::Sync;
            pub use ::std::marker::Send;
            pub use ::dafny_runtime::itertools::Itertools;
            pub use ::dafny_runtime::Map;

            pub struct _default {}

            impl _default {
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(27,5)
                pub fn Digits(n: &nat, base: &DafnyInt) -> Sequence<DafnyInt> {
                    if n.clone() == int!(0) {
                        seq![] as Sequence<DafnyInt>
                    } else {
                        let mut _digits_k: Sequence<DafnyInt> = crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_ByteStrConversion_Compile::_default::Digits(&euclidian_division(n.clone(), base.clone()), base);
                        let mut digits: Sequence<DafnyInt> = _digits_k.concat(&seq![euclidian_modulo(n.clone(), base.clone())]);
                        digits.clone()
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(54,5)
                pub fn OfDigits(digits: &Sequence<DafnyInt>, chars: &Sequence<u8>) -> Sequence<u8> {
                    let mut _accumulator: Sequence<u8> = seq![] as Sequence<u8>;
                    let mut _r0 = digits.clone();
                    let mut _r1 = chars.clone();
                    'TAIL_CALL_START: loop {
                        let digits = _r0;
                        let chars = _r1;
                        if digits.clone().to_array().len() == 0 {
                            return _accumulator.concat(&(seq![] as Sequence<u8>));
                        } else {
                            _accumulator = _accumulator.concat(&seq![chars.get(&digits.get(&int!(0)))]);
                            let mut _in0: Sequence<DafnyInt> = digits.drop(&int!(1));
                            let mut _in1: Sequence<u8> = chars.clone();
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            continue 'TAIL_CALL_START;
                        }
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(66,5)
                pub fn OfNat_any(n: &nat, chars: &Sequence<u8>) -> Sequence<u8> {
                    let mut base: DafnyInt = chars.cardinality();
                    if n.clone() == int!(0) {
                        seq![chars.get(&int!(0))]
                    } else {
                        crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_ByteStrConversion_Compile::_default::OfDigits(&crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_ByteStrConversion_Compile::_default::Digits(n, &base), chars)
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(76,5)
                pub fn NumberStr(str: &Sequence<u8>, minus: u8, is_digit: &Arc<dyn ::std::ops::Fn(&u8) -> bool + Sync + Send>) -> bool {
                    !(!(str.clone().to_array().len() == 0)) || (str.get(&int!(0)) == minus || is_digit(&str.get(&int!(0)))) && Itertools::unique((&str.drop(&int!(1))).iter()).all(({
                            let mut str = str.clone();
                            let mut is_digit = is_digit.clone();
                            Arc::new(move |__forall_var_0: u8| -> bool{
                                    let mut c: u8 = __forall_var_0;
                                    !str.drop(&int!(1)).contains(&c) || (&is_digit)(&c)
                                })
                        }).as_ref())
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(82,5)
                pub fn OfInt_any(n: &DafnyInt, chars: &Sequence<u8>, minus: u8) -> Sequence<u8> {
                    if !(n.clone() < int!(0)) {
                        crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_ByteStrConversion_Compile::_default::OfNat_any(n, chars)
                    } else {
                        seq![minus].concat(&crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_ByteStrConversion_Compile::_default::OfNat_any(&(int!(0) - n.clone()), chars))
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(90,5)
                pub fn ToNat_any(str: &Sequence<u8>, base: &nat, digits: &Map<u8, nat>) -> nat {
                    if str.clone().to_array().len() == 0 {
                        int!(0)
                    } else {
                        crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_ByteStrConversion_Compile::_default::ToNat_any(&str.take(&(str.cardinality() - int!(1))), base, digits) * base.clone() + digits.get(&str.get(&(str.cardinality() - int!(1))))
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(124,5)
                pub fn ToInt_any(str: &Sequence<u8>, minus: u8, base: &nat, digits: &Map<u8, nat>) -> DafnyInt {
                    if seq![minus] <= str.clone() {
                        int!(0) - crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_ByteStrConversion_Compile::_default::ToNat_any(&str.drop(&int!(1)), base, digits)
                    } else {
                        crate::implementation_from_dafny::_JSON_Compile::_Serializer_Compile::_ByteStrConversion_Compile::_default::ToNat_any(str, base, digits)
                    }
                }
            }
        }
    }

    /// ../mpl/libraries/src/JSON/Spec.dfy(22,1)
    pub mod _Spec_Compile {
        pub use ::dafny_runtime::Sequence;
        pub use ::dafny_runtime::DafnyCharUTF16;
        pub use ::dafny_runtime::int;
        pub use ::std::sync::Arc;
        pub use ::dafny_runtime::DafnyInt;
        pub use ::dafny_runtime::integer_range;
        pub use ::dafny_runtime::Zero;
        pub use ::dafny_runtime::_System::nat;
        pub use ::dafny_runtime::seq;
        pub use ::dafny_runtime::truncate;
        pub use ::dafny_runtime::string_utf16_of;
        pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::SerializationError;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::Decimal;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON::Null;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON::Bool;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON::String;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON::Number;
        pub use crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON::Object;

        pub struct _default {}

        impl _default {
            /// ../mpl/libraries/src/JSON/Spec.dfy(37,3)
            pub fn EscapeUnicode(c: u16) -> Sequence<u16> {
                let mut sStr: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::OfNat(&int!((&c).clone()), &int!(16));
                let mut s: Sequence<u16> = crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&sStr);
                ({
                    let _initializer = {
                            Arc::new(move |_v0: &DafnyInt| -> u16{
                                    DafnyCharUTF16(48 as u16).0 as u16
                                })
                        };
                    integer_range(Zero::zero(), int!(4) - s.cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                }).concat(&s)
            }
            /// ../mpl/libraries/src/JSON/Spec.dfy(51,3)
            pub fn Escape(str: &Sequence<u16>, start: &nat) -> Sequence<u16> {
                let mut _accumulator: Sequence<u16> = seq![] as Sequence<u16>;
                let mut _r0 = str.clone();
                let mut _r1 = start.clone();
                'TAIL_CALL_START: loop {
                    let str = _r0;
                    let start = _r1;
                    if !(start.clone() < str.cardinality()) {
                        return _accumulator.concat(&(seq![] as Sequence<u16>));
                    } else {
                        _accumulator = _accumulator.concat(&(if str.get(&start) == truncate!(int!(34), u16) {
                                    crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&string_utf16_of("\\\""))
                                } else {
                                    if str.get(&start) == truncate!(int!(92), u16) {
                                        crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&string_utf16_of("\\\\"))
                                    } else {
                                        if str.get(&start) == truncate!(int!(8), u16) {
                                            crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&string_utf16_of("\\b"))
                                        } else {
                                            if str.get(&start) == truncate!(int!(12), u16) {
                                                crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&string_utf16_of("\\f"))
                                            } else {
                                                if str.get(&start) == truncate!(int!(10), u16) {
                                                    crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&string_utf16_of("\\n"))
                                                } else {
                                                    if str.get(&start) == truncate!(int!(13), u16) {
                                                        crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&string_utf16_of("\\r"))
                                                    } else {
                                                        if str.get(&start) == truncate!(int!(9), u16) {
                                                            crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&string_utf16_of("\\t"))
                                                        } else {
                                                            {
                                                                let __pat_let16_0: u16 = str.get(&start);
                                                                {
                                                                    let c: u16 = __pat_let16_0;
                                                                    if c < truncate!(int!(31), u16) {
                                                                        crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF16(&string_utf16_of("\\u")).concat(&crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::EscapeUnicode(c))
                                                                    } else {
                                                                        seq![str.get(&start)]
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }));
                        let mut _in0: Sequence<u16> = str.clone();
                        let mut _in1: DafnyInt = start.clone() + int!(1);
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Spec.dfy(70,3)
            pub fn EscapeToUTF8(str: &Sequence<DafnyCharUTF16>, start: &nat) -> Arc<Result<Sequence<u8>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Sequence<u16>, Arc<SerializationError>>> = crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ToUTF16Checked(str)._ToResult_k::<Arc<SerializationError>>(&Arc::new(SerializationError::InvalidUnicode {}));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Sequence<u8>>()
                } else {
                    let mut utf16: Sequence<u16> = valueOrError0.Extract();
                    let mut escaped: Sequence<u16> = crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::Escape(&utf16, &int!(0));
                    let mut valueOrError1: Arc<Result<Sequence<DafnyCharUTF16>, Arc<SerializationError>>> = crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::FromUTF16Checked(&escaped)._ToResult_k::<Arc<SerializationError>>(&Arc::new(SerializationError::InvalidUnicode {}));
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Sequence<u8>>()
                    } else {
                        let mut utf32: Sequence<DafnyCharUTF16> = valueOrError1.Extract();
                        crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ToUTF8Checked(&utf32)._ToResult_k::<Arc<SerializationError>>(&Arc::new(SerializationError::InvalidUnicode {}))
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Spec.dfy(78,3)
            pub fn String(str: &Sequence<DafnyCharUTF16>) -> Arc<Result<Sequence<u8>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::EscapeToUTF8(str, &int!(0));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Sequence<u8>>()
                } else {
                    let mut inBytes: Sequence<u8> = valueOrError0.Extract();
                    Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                            value: crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of("\"")).concat(&inBytes).concat(&crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of("\"")))
                        })
                }
            }
            /// ../mpl/libraries/src/JSON/Spec.dfy(99,3)
            pub fn IntToBytes(n: &DafnyInt) -> Sequence<u8> {
                let mut s: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::OfInt(n, &int!(10));
                crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&s)
            }
            /// ../mpl/libraries/src/JSON/Spec.dfy(105,3)
            pub fn Number(dec: &Arc<Decimal>) -> Arc<Result<Sequence<u8>, Arc<SerializationError>>> {
                Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                        value: crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::IntToBytes(dec.n()).concat(&(if dec.e10().clone() == int!(0) {
                                    seq![] as Sequence<u8>
                                } else {
                                    crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of("e")).concat(&crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::IntToBytes(dec.e10()))
                                }))
                    })
            }
            /// ../mpl/libraries/src/JSON/Spec.dfy(111,3)
            pub fn KeyValue(kv: &(Sequence<DafnyCharUTF16>, Arc<JSON>)) -> Arc<Result<Sequence<u8>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::String(&kv.0.clone());
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Sequence<u8>>()
                } else {
                    let mut key: Sequence<u8> = valueOrError0.Extract();
                    let mut valueOrError1: Arc<Result<Sequence<u8>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::JSON(&kv.1.clone());
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Sequence<u8>>()
                    } else {
                        let mut value: Sequence<u8> = valueOrError1.Extract();
                        Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                                value: key.concat(&crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of(":"))).concat(&value)
                            })
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Spec.dfy(117,3)
            pub fn Join(sep: &Sequence<u8>, items: &Sequence<Arc<Result<Sequence<u8>, Arc<SerializationError>>>>) -> Arc<Result<Sequence<u8>, Arc<SerializationError>>> {
                if items.cardinality() == int!(0) {
                    Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                            value: seq![] as Sequence<u8>
                        })
                } else {
                    let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<SerializationError>>> = items.get(&int!(0));
                    if valueOrError0.IsFailure() {
                        valueOrError0.PropagateFailure::<Sequence<u8>>()
                    } else {
                        let mut first: Sequence<u8> = valueOrError0.Extract();
                        if items.cardinality() == int!(1) {
                            Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                                    value: first.clone()
                                })
                        } else {
                            let mut valueOrError1: Arc<Result<Sequence<u8>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::Join(sep, &items.drop(&int!(1)));
                            if valueOrError1.IsFailure() {
                                valueOrError1.PropagateFailure::<Sequence<u8>>()
                            } else {
                                let mut rest: Sequence<u8> = valueOrError1.Extract();
                                Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                                        value: first.concat(sep).concat(&rest)
                                    })
                            }
                        }
                    }
                }
            }
            /// ../mpl/libraries/src/JSON/Spec.dfy(129,3)
            pub fn Object(obj: &Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)>) -> Arc<Result<Sequence<u8>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::Join(&crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of(",")), &({
                            let _initializer = {
                                    let obj: Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)> = obj.clone();
                                    {
                                        let mut obj = obj.clone();
                                        Arc::new(move |i: &DafnyInt| -> Arc<Result<Sequence<u8>, Arc<SerializationError>>>{
                                                crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::KeyValue(&obj.get(i))
                                            })
                                    }
                                };
                            integer_range(Zero::zero(), obj.cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                        }));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Sequence<u8>>()
                } else {
                    let mut middle: Sequence<u8> = valueOrError0.Extract();
                    Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                            value: crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of("{")).concat(&middle).concat(&crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of("}")))
                        })
                }
            }
            /// ../mpl/libraries/src/JSON/Spec.dfy(134,3)
            pub fn Array(arr: &Sequence<Arc<JSON>>) -> Arc<Result<Sequence<u8>, Arc<SerializationError>>> {
                let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<SerializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::Join(&crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of(",")), &({
                            let _initializer = {
                                    let arr: Sequence<Arc<JSON>> = arr.clone();
                                    {
                                        let mut arr = arr.clone();
                                        Arc::new(move |i: &DafnyInt| -> Arc<Result<Sequence<u8>, Arc<SerializationError>>>{
                                                crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::JSON(&arr.get(i))
                                            })
                                    }
                                };
                            integer_range(Zero::zero(), arr.cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                        }));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Sequence<u8>>()
                } else {
                    let mut middle: Sequence<u8> = valueOrError0.Extract();
                    Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                            value: crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of("[")).concat(&middle).concat(&crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of("]")))
                        })
                }
            }
            /// ../mpl/libraries/src/JSON/Spec.dfy(139,3)
            pub fn JSON(js: &Arc<JSON>) -> Arc<Result<Sequence<u8>, Arc<SerializationError>>> {
                let mut _source0: Arc<JSON> = js.clone();
                if matches!((&_source0).as_ref(), Null{ .. }) {
                    Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                            value: crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of("null"))
                        })
                } else {
                    if matches!((&_source0).as_ref(), Bool{ .. }) {
                        let mut ___mcc_h0: bool = _source0.b().clone();
                        let mut b: bool = ___mcc_h0;
                        Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                                value: if b {
                                        crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of("true"))
                                    } else {
                                        crate::implementation_from_dafny::_UnicodeStrings_Compile::_default::ASCIIToUTF8(&string_utf16_of("false"))
                                    }
                            })
                    } else {
                        if matches!((&_source0).as_ref(), String{ .. }) {
                            let mut ___mcc_h1: Sequence<DafnyCharUTF16> = _source0.str().clone();
                            let mut str: Sequence<DafnyCharUTF16> = ___mcc_h1.clone();
                            crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::String(&str)
                        } else {
                            if matches!((&_source0).as_ref(), Number{ .. }) {
                                let mut ___mcc_h2: Arc<Decimal> = _source0.num().clone();
                                let mut dec: Arc<Decimal> = ___mcc_h2.clone();
                                crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::Number(&dec)
                            } else {
                                if matches!((&_source0).as_ref(), Object{ .. }) {
                                    let mut ___mcc_h3: Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)> = _source0.obj().clone();
                                    let mut obj: Sequence<(Sequence<DafnyCharUTF16>, Arc<JSON>)> = ___mcc_h3.clone();
                                    crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::Object(&obj)
                                } else {
                                    let mut ___mcc_h4: Sequence<Arc<JSON>> = _source0.arr().clone();
                                    let mut arr: Sequence<Arc<JSON>> = ___mcc_h4.clone();
                                    crate::implementation_from_dafny::_JSON_Compile::_Spec_Compile::_default::Array(&arr)
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    pub mod _Utils_Compile {
        /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(8,1)
        pub mod _Cursors_Compile {
            pub use ::dafny_runtime::DafnyType;
            pub use ::std::fmt::Debug;
            pub use ::std::fmt::Formatter;
            pub use ::dafny_runtime::DafnyPrint;
            pub use ::std::sync::Arc;
            pub use ::dafny_runtime::upcast_id;
            pub use ::std::cmp::Eq;
            pub use ::std::hash::Hash;
            pub use ::std::hash::Hasher;
            pub use ::std::default::Default;
            pub use ::std::convert::AsRef;
            pub use ::dafny_runtime::seq;
            pub use ::dafny_runtime::Sequence;
            pub use ::dafny_runtime::truncate;
            pub use ::dafny_runtime::int;
            pub use ::dafny_runtime::DafnyCharUTF16;
            pub use ::std::marker::Sync;
            pub use ::std::marker::Send;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError::EOF;
            pub use ::dafny_runtime::string_utf16_of;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError::ExpectingByte;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError::ExpectingAnyByte;
            pub use ::dafny_runtime::DafnyInt;
            pub use ::dafny_runtime::integer_range;
            pub use ::dafny_runtime::Zero;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Core_Compile::LexerResult;
            pub use ::dafny_runtime::MaybePlacebo;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Core_Compile::LexerResult::Accept;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Core_Compile::LexerResult::Reject;

            /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(15,3)
            #[derive(PartialEq, Clone)]
            pub enum Split<T: DafnyType> {
                SP {
                    t: T,
                    cs: crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor
                }
            }

            impl<T: DafnyType> Split<T> {
                /// Returns a borrow of the field t
                pub fn t(&self) -> &T {
                    match self {
                        Split::SP{t, cs, } => t,
                    }
                }
                /// Returns a borrow of the field cs
                pub fn cs(&self) -> &crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor {
                    match self {
                        Split::SP{t, cs, } => cs,
                    }
                }
            }

            impl<T: DafnyType> Debug
                for Split<T> {
                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                    DafnyPrint::fmt_print(self, f, true)
                }
            }

            impl<T: DafnyType> DafnyPrint
                for Split<T> {
                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                    match self {
                        Split::SP{t, cs, } => {
                            write!(_formatter, "JSON_Compile.Utils_Compile.Cursors_Compile.Split.SP(")?;
                            DafnyPrint::fmt_print(t, _formatter, false)?;
                            write!(_formatter, ", ")?;
                            DafnyPrint::fmt_print(cs, _formatter, false)?;
                            write!(_formatter, ")")?;
                            Ok(())
                        },
                    }
                }
            }

            impl<T: DafnyType> Split<T> {
                /// Given type parameter conversions, returns a lambda to convert this structure
                pub fn coerce<__T0: DafnyType>(f_0: Arc<impl ::std::ops::Fn(T) -> __T0 + 'static>) -> Arc<impl ::std::ops::Fn(Split<T>) -> Split<__T0>> {
                    Arc::new(move |this: Self| -> Split<__T0>{
                            match this {
                                Split::SP{t, cs, } => {
                                    Split::SP {
                                        t: f_0.clone()(t),
                                        cs: upcast_id::<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor>()(cs)
                                    }
                                },
                            }
                        })
                }
            }

            impl<T: DafnyType + Eq> Eq
                for Split<T> {}

            impl<T: DafnyType + Hash> Hash
                for Split<T> {
                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                    match self {
                        Split::SP{t, cs, } => {
                            Hash::hash(t, _state);
                            Hash::hash(cs, _state)
                        },
                    }
                }
            }

            impl<T: DafnyType + Default> Default
                for Split<T> {
                fn default() -> Split<T> {
                    Split::SP {
                        t: Default::default(),
                        cs: Default::default()
                    }
                }
            }

            impl<T: DafnyType> AsRef<Split<T>>
                for Split<T> {
                fn as_ref(&self) -> &Self {
                    self
                }
            }

            /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(30,3)
            pub type Cursor = Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_>;

            /// An element of Cursor
            pub fn __init_Cursor() -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_> {
                Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_::Cursor {
                        s: seq![] as Sequence<u8>,
                        beg: truncate!(int!(0), u32),
                        point: truncate!(int!(0), u32),
                        end: truncate!(int!(0), u32)
                    })
            }

            /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(32,3)
            pub type FreshCursor = Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_>;

            /// An element of FreshCursor
            pub fn __init_FreshCursor() -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_> {
                Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_::Cursor {
                        s: seq![] as Sequence<u8>,
                        beg: truncate!(int!(0), u32),
                        point: truncate!(int!(0), u32),
                        end: truncate!(int!(0), u32)
                    })
            }

            /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(35,3)
            #[derive(PartialEq, Clone)]
            pub enum CursorError<R: DafnyType> {
                EOF {},
                ExpectingByte {
                    expected: u8,
                    b: i16
                },
                ExpectingAnyByte {
                    expected_sq: Sequence<u8>,
                    b: i16
                },
                OtherError {
                    err: R
                }
            }

            impl<R: DafnyType> CursorError<R> {
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(41,5)
                pub fn ToString(self: &Arc<Self>, pr: &Arc<dyn ::std::ops::Fn(&R) -> Sequence<DafnyCharUTF16> + Sync + Send>) -> Sequence<DafnyCharUTF16> {
                    let mut _source0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<R>> = self.clone();
                    if matches!((&_source0).as_ref(), EOF{ .. }) {
                        string_utf16_of("Reached EOF")
                    } else {
                        if matches!((&_source0).as_ref(), ExpectingByte{ .. }) {
                            let mut ___mcc_h0: u8 = _source0.expected().clone();
                            let mut ___mcc_h1: i16 = _source0.b().clone();
                            let mut b: i16 = ___mcc_h1;
                            let mut b0: u8 = ___mcc_h0;
                            let mut c: Sequence<DafnyCharUTF16> = if truncate!(int!(0), i16) < b {
                                    string_utf16_of("'").concat(&seq![DafnyCharUTF16(b as u16)]).concat(&string_utf16_of("'"))
                                } else {
                                    string_utf16_of("EOF")
                                };
                            string_utf16_of("Expecting '").concat(&seq![DafnyCharUTF16(b0 as u16)]).concat(&string_utf16_of("', read ")).concat(&c)
                        } else {
                            if matches!((&_source0).as_ref(), ExpectingAnyByte{ .. }) {
                                let mut ___mcc_h2: Sequence<u8> = _source0.expected_sq().clone();
                                let mut ___mcc_h3: i16 = _source0.b().clone();
                                let mut b: i16 = ___mcc_h3;
                                let mut bs0: Sequence<u8> = ___mcc_h2.clone();
                                let mut c: Sequence<DafnyCharUTF16> = if truncate!(int!(0), i16) < b {
                                        string_utf16_of("'").concat(&seq![DafnyCharUTF16(b as u16)]).concat(&string_utf16_of("'"))
                                    } else {
                                        string_utf16_of("EOF")
                                    };
                                let mut c0s: Sequence<DafnyCharUTF16> = {
                                        let _initializer = {
                                                let bs0: Sequence<u8> = bs0.clone();
                                                {
                                                    let mut bs0 = bs0.clone();
                                                    Arc::new(move |idx: &DafnyInt| -> DafnyCharUTF16{
                                                            DafnyCharUTF16(bs0.get(idx) as u16)
                                                        })
                                                }
                                            };
                                        integer_range(Zero::zero(), bs0.cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                                    };
                                string_utf16_of("Expecting one of '").concat(&c0s).concat(&string_utf16_of("', read ")).concat(&c)
                            } else {
                                let mut ___mcc_h4: R = _source0.err().clone();
                                let mut err: R = ___mcc_h4.clone();
                                pr(&err)
                            }
                        }
                    }
                }
                /// Gets the field expected for all enum members which have it
                pub fn expected(&self) -> &u8 {
                    match self {
                        CursorError::EOF{} => panic!("field does not exist on this variant"),
                        CursorError::ExpectingByte{expected, b, } => expected,
                        CursorError::ExpectingAnyByte{expected_sq, b, } => panic!("field does not exist on this variant"),
                        CursorError::OtherError{err, } => panic!("field does not exist on this variant"),
                    }
                }
                /// Gets the field b for all enum members which have it
                pub fn b(&self) -> &i16 {
                    match self {
                        CursorError::EOF{} => panic!("field does not exist on this variant"),
                        CursorError::ExpectingByte{expected, b, } => b,
                        CursorError::ExpectingAnyByte{expected_sq, b, } => b,
                        CursorError::OtherError{err, } => panic!("field does not exist on this variant"),
                    }
                }
                /// Gets the field expected_sq for all enum members which have it
                pub fn expected_sq(&self) -> &Sequence<u8> {
                    match self {
                        CursorError::EOF{} => panic!("field does not exist on this variant"),
                        CursorError::ExpectingByte{expected, b, } => panic!("field does not exist on this variant"),
                        CursorError::ExpectingAnyByte{expected_sq, b, } => expected_sq,
                        CursorError::OtherError{err, } => panic!("field does not exist on this variant"),
                    }
                }
                /// Gets the field err for all enum members which have it
                pub fn err(&self) -> &R {
                    match self {
                        CursorError::EOF{} => panic!("field does not exist on this variant"),
                        CursorError::ExpectingByte{expected, b, } => panic!("field does not exist on this variant"),
                        CursorError::ExpectingAnyByte{expected_sq, b, } => panic!("field does not exist on this variant"),
                        CursorError::OtherError{err, } => err,
                    }
                }
            }

            impl<R: DafnyType> Debug
                for CursorError<R> {
                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                    DafnyPrint::fmt_print(self, f, true)
                }
            }

            impl<R: DafnyType> DafnyPrint
                for CursorError<R> {
                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                    match self {
                        CursorError::EOF{} => {
                            write!(_formatter, "JSON_Compile.Utils_Compile.Cursors_Compile.CursorError.EOF")?;
                            Ok(())
                        },
                        CursorError::ExpectingByte{expected, b, } => {
                            write!(_formatter, "JSON_Compile.Utils_Compile.Cursors_Compile.CursorError.ExpectingByte(")?;
                            DafnyPrint::fmt_print(expected, _formatter, false)?;
                            write!(_formatter, ", ")?;
                            DafnyPrint::fmt_print(b, _formatter, false)?;
                            write!(_formatter, ")")?;
                            Ok(())
                        },
                        CursorError::ExpectingAnyByte{expected_sq, b, } => {
                            write!(_formatter, "JSON_Compile.Utils_Compile.Cursors_Compile.CursorError.ExpectingAnyByte(")?;
                            DafnyPrint::fmt_print(expected_sq, _formatter, false)?;
                            write!(_formatter, ", ")?;
                            DafnyPrint::fmt_print(b, _formatter, false)?;
                            write!(_formatter, ")")?;
                            Ok(())
                        },
                        CursorError::OtherError{err, } => {
                            write!(_formatter, "JSON_Compile.Utils_Compile.Cursors_Compile.CursorError.OtherError(")?;
                            DafnyPrint::fmt_print(err, _formatter, false)?;
                            write!(_formatter, ")")?;
                            Ok(())
                        },
                    }
                }
            }

            impl<R: DafnyType> CursorError<R> {
                /// Given type parameter conversions, returns a lambda to convert this structure
                pub fn coerce<__T0: DafnyType>(f_0: Arc<impl ::std::ops::Fn(R) -> __T0 + 'static>) -> Arc<impl ::std::ops::Fn(CursorError<R>) -> CursorError<__T0>> {
                    Arc::new(move |this: Self| -> CursorError<__T0>{
                            match this {
                                CursorError::EOF{} => {
                                    CursorError::EOF {}
                                },
                                CursorError::ExpectingByte{expected, b, } => {
                                    CursorError::ExpectingByte {
                                        expected: upcast_id::<u8>()(expected),
                                        b: upcast_id::<i16>()(b)
                                    }
                                },
                                CursorError::ExpectingAnyByte{expected_sq, b, } => {
                                    CursorError::ExpectingAnyByte {
                                        expected_sq: upcast_id::<Sequence<u8>>()(expected_sq),
                                        b: upcast_id::<i16>()(b)
                                    }
                                },
                                CursorError::OtherError{err, } => {
                                    CursorError::OtherError {
                                        err: f_0.clone()(err)
                                    }
                                },
                            }
                        })
                }
            }

            impl<R: DafnyType + Eq> Eq
                for CursorError<R> {}

            impl<R: DafnyType + Hash> Hash
                for CursorError<R> {
                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                    match self {
                        CursorError::EOF{} => {

                        },
                        CursorError::ExpectingByte{expected, b, } => {
                            Hash::hash(expected, _state);
                            Hash::hash(b, _state)
                        },
                        CursorError::ExpectingAnyByte{expected_sq, b, } => {
                            Hash::hash(expected_sq, _state);
                            Hash::hash(b, _state)
                        },
                        CursorError::OtherError{err, } => {
                            Hash::hash(err, _state)
                        },
                    }
                }
            }

            impl<R: DafnyType + Default> Default
                for CursorError<R> {
                fn default() -> CursorError<R> {
                    CursorError::EOF {}
                }
            }

            impl<R: DafnyType> AsRef<CursorError<R>>
                for CursorError<R> {
                fn as_ref(&self) -> &Self {
                    self
                }
            }

            /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(56,3)
            #[derive(PartialEq, Clone)]
            pub enum Cursor_ {
                Cursor {
                    s: Sequence<u8>,
                    beg: u32,
                    point: u32,
                    end: u32
                }
            }

            impl Cursor_ {
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(66,5)
                pub fn OfView(v: &View) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor {
                    Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_::Cursor {
                            s: v.s().clone(),
                            beg: v.beg().clone(),
                            point: v.beg().clone(),
                            end: v.end().clone()
                        })
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(70,5)
                pub fn OfBytes(bs: &Sequence<u8>) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor {
                    Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_::Cursor {
                            s: bs.clone(),
                            beg: truncate!(int!(0), u32),
                            point: truncate!(int!(0), u32),
                            end: truncate!(bs.cardinality(), u32)
                        })
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(76,5)
                pub fn Bytes(self: &Arc<Self>) -> Sequence<u8> {
                    self.s().slice(&int!(self.beg().clone()), &int!(self.end().clone()))
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(134,5)
                pub fn Prefix(self: &Arc<Self>) -> View {
                    Arc::new(View_::View {
                            s: self.s().clone(),
                            beg: self.beg().clone(),
                            end: self.point().clone()
                        })
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(138,5)
                pub fn Suffix(self: &Arc<Self>) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor {
                    let mut _dt__update__tmp_h0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_> = self.clone();
                    let mut _dt__update_hbeg_h0: u32 = self.point().clone();
                    Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_::Cursor {
                            s: _dt__update__tmp_h0.s().clone(),
                            beg: _dt__update_hbeg_h0,
                            point: _dt__update__tmp_h0.point().clone(),
                            end: _dt__update__tmp_h0.end().clone()
                        })
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(142,5)
                pub fn Split(self: &Arc<Self>) -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split<View>> {
                    Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split::<View>::SP {
                            t: self.Prefix(),
                            cs: self.Suffix()
                        })
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(151,5)
                pub fn PrefixLength(self: &Arc<Self>) -> u32 {
                    self.point().clone() - self.beg().clone()
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(155,5)
                pub fn SuffixLength(self: &Arc<Self>) -> u32 {
                    self.end().clone() - self.point().clone()
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(159,5)
                pub fn Length(self: &Arc<Self>) -> u32 {
                    self.end().clone() - self.beg().clone()
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(172,5)
                pub fn At(self: &Arc<Self>, idx: u32) -> u8 {
                    self.s().get(&int!((&(self.beg().clone() + idx)).clone()))
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(183,5)
                pub fn SuffixAt(self: &Arc<Self>, idx: u32) -> u8 {
                    self.s().get(&int!((&(self.point().clone() + idx)).clone()))
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(190,5)
                pub fn Peek(self: &Arc<Self>) -> i16 {
                    if self._EOF_q() {
                        truncate!(int!(-1), i16)
                    } else {
                        self.SuffixAt(truncate!(int!(0), u32)) as i16
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(198,5)
                pub fn LookingAt(self: &Arc<Self>, c: &DafnyCharUTF16) -> bool {
                    self.Peek() == c.clone().0 as i16
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(206,5)
                pub fn Skip(self: &Arc<Self>, n: u32) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor {
                    let mut _dt__update__tmp_h0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_> = self.clone();
                    let mut _dt__update_hpoint_h0: u32 = self.point().clone() + n;
                    Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_::Cursor {
                            s: _dt__update__tmp_h0.s().clone(),
                            beg: _dt__update__tmp_h0.beg().clone(),
                            point: _dt__update_hpoint_h0,
                            end: _dt__update__tmp_h0.end().clone()
                        })
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(215,5)
                pub fn Unskip(self: &Arc<Self>, n: u32) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor {
                    let mut _dt__update__tmp_h0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_> = self.clone();
                    let mut _dt__update_hpoint_h0: u32 = self.point().clone() - n;
                    Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_::Cursor {
                            s: _dt__update__tmp_h0.s().clone(),
                            beg: _dt__update__tmp_h0.beg().clone(),
                            point: _dt__update_hpoint_h0,
                            end: _dt__update__tmp_h0.end().clone()
                        })
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(222,5)
                pub fn Get<_R: DafnyType>(self: &Arc<Self>, err: &_R) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>> {
                    if self._EOF_q() {
                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError::<_R>::OtherError {
                                            err: err.clone()
                                        })
                            })
                    } else {
                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>::Success {
                                value: self.Skip(truncate!(int!(1), u32))
                            })
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(230,5)
                pub fn AssertByte<_R: DafnyType>(self: &Arc<Self>, b: u8) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>> {
                    let mut nxt: i16 = self.Peek();
                    if nxt == b as i16 {
                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>::Success {
                                value: self.Skip(truncate!(int!(1), u32))
                            })
                    } else {
                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError::<_R>::ExpectingByte {
                                            expected: b,
                                            b: nxt
                                        })
                            })
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(241,5)
                pub fn AssertBytes<_R: DafnyType>(self: &Arc<Self>, bs: &Sequence<u8>, offset: u32) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>> {
                    let mut _this = self.clone();
                    let mut _r0 = bs.clone();
                    let mut _r1 = offset;
                    'TAIL_CALL_START: loop {
                        let bs = _r0;
                        let offset = _r1;
                        if offset == truncate!(bs.cardinality(), u32) {
                            return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>::Success {
                                        value: _this.clone()
                                    });
                        } else {
                            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>> = _this.AssertByte::<_R>(bs.get(&int!((&offset).clone())));
                            if valueOrError0.IsFailure() {
                                return valueOrError0.PropagateFailure::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_>>();
                            } else {
                                let mut ps: crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor = valueOrError0.Extract();
                                let mut _in0: crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor = ps.clone();
                                let mut _in1: Sequence<u8> = bs.clone();
                                let mut _in2: u32 = offset + truncate!(int!(1), u32);
                                _this = _in0.clone();
                                _r0 = _in1.clone();
                                _r1 = _in2;
                                continue 'TAIL_CALL_START;
                            }
                        }
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(257,5)
                pub fn AssertChar<_R: DafnyType>(self: &Arc<Self>, c0: &DafnyCharUTF16) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>> {
                    self.AssertByte::<_R>(c0.clone().0 as u8)
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(265,5)
                pub fn SkipByte(self: &Arc<Self>) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor {
                    if self._EOF_q() {
                        self.clone()
                    } else {
                        self.Skip(truncate!(int!(1), u32))
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(275,5)
                pub fn SkipIf(self: &Arc<Self>, p: &Arc<dyn ::std::ops::Fn(&u8) -> bool + Sync + Send>) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor {
                    if self._EOF_q() || !p(&self.SuffixAt(truncate!(int!(0), u32))) {
                        self.clone()
                    } else {
                        self.Skip(truncate!(int!(1), u32))
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(285,5)
                pub fn SkipWhile(self: &Arc<Self>, p: &Arc<dyn ::std::ops::Fn(&u8) -> bool + Sync + Send>) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor {
                    let mut ps: crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor = Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_::Cursor {
                                s: seq![] as Sequence<u8>,
                                beg: truncate!(int!(0), u32),
                                point: truncate!(int!(0), u32),
                                end: truncate!(int!(0), u32)
                            });
                    let mut _point_k: u32 = self.point().clone();
                    let mut end: u32 = self.end().clone();
                    while _point_k < end && p(&self.s().get(&int!((&_point_k).clone()))) {
                        _point_k = _point_k + truncate!(int!(1), u32);
                    };
                    ps = Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_::Cursor {
                                s: self.s().clone(),
                                beg: self.beg().clone(),
                                point: _point_k,
                                end: self.end().clone()
                            });
                    return ps.clone();
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(305,5)
                pub fn SkipWhileLexer<_A: DafnyType, _R: DafnyType>(self: &Arc<Self>, step: &Arc<dyn ::std::ops::Fn(&_A, &i16) -> Arc<LexerResult<_A, _R>> + Sync + Send>, st: &_A) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>> {
                    let mut pr = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>>>::new();
                    let mut _point_k: u32 = self.point().clone();
                    let mut end: u32 = self.end().clone();
                    let mut _st_k: _A = st.clone();
                    while true {
                        let mut eof: bool = _point_k == end;
                        let mut minusone: i16 = truncate!(int!(-1), i16);
                        let mut c: i16;
                        if eof {
                            c = minusone;
                        } else {
                            c = self.s().get(&int!((&_point_k).clone())) as i16;
                        };
                        let mut _source0: Arc<LexerResult<_A, _R>> = step(&_st_k, &c);
                        if matches!((&_source0).as_ref(), Accept{ .. }) {
                            pr = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>::Success {
                                            value: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_::Cursor {
                                                        s: self.s().clone(),
                                                        beg: self.beg().clone(),
                                                        point: _point_k,
                                                        end: self.end().clone()
                                                    })
                                        }));
                            return pr.read();
                        } else {
                            if matches!((&_source0).as_ref(), Reject{ .. }) {
                                let mut ___mcc_h0: _R = _source0.err().clone();
                                let mut err: _R = ___mcc_h0.clone();
                                pr = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>::Failure {
                                                error: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError::<_R>::OtherError {
                                                            err: err.clone()
                                                        })
                                            }));
                                return pr.read();
                            } else {
                                let mut ___mcc_h1: _A = _source0.st().clone();
                                let mut _st_k_k: _A = ___mcc_h1.clone();
                                if eof {
                                    pr = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError<_R>>>::Failure {
                                                    error: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError::<_R>::EOF {})
                                                }));
                                    return pr.read();
                                } else {
                                    _st_k = _st_k_k.clone();
                                    _point_k = _point_k + truncate!(int!(1), u32);
                                }
                            }
                        }
                    };
                    return pr.read();
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(60,5)
                pub fn _BOF_q(self: &Arc<Self>) -> bool {
                    self.point().clone() == self.beg().clone()
                }
                /// ../mpl/libraries/src/JSON/Utils/Cursors.dfy(63,5)
                pub fn _EOF_q(self: &Arc<Self>) -> bool {
                    self.point().clone() == self.end().clone()
                }
                /// Returns a borrow of the field s
                pub fn s(&self) -> &Sequence<u8> {
                    match self {
                        Cursor_::Cursor{s, beg, point, end, } => s,
                    }
                }
                /// Returns a borrow of the field beg
                pub fn beg(&self) -> &u32 {
                    match self {
                        Cursor_::Cursor{s, beg, point, end, } => beg,
                    }
                }
                /// Returns a borrow of the field point
                pub fn point(&self) -> &u32 {
                    match self {
                        Cursor_::Cursor{s, beg, point, end, } => point,
                    }
                }
                /// Returns a borrow of the field end
                pub fn end(&self) -> &u32 {
                    match self {
                        Cursor_::Cursor{s, beg, point, end, } => end,
                    }
                }
            }

            impl Debug
                for Cursor_ {
                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                    DafnyPrint::fmt_print(self, f, true)
                }
            }

            impl DafnyPrint
                for Cursor_ {
                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                    match self {
                        Cursor_::Cursor{s, beg, point, end, } => {
                            write!(_formatter, "JSON_Compile.Utils_Compile.Cursors_Compile.Cursor__.Cursor(")?;
                            DafnyPrint::fmt_print(s, _formatter, false)?;
                            write!(_formatter, ", ")?;
                            DafnyPrint::fmt_print(beg, _formatter, false)?;
                            write!(_formatter, ", ")?;
                            DafnyPrint::fmt_print(point, _formatter, false)?;
                            write!(_formatter, ", ")?;
                            DafnyPrint::fmt_print(end, _formatter, false)?;
                            write!(_formatter, ")")?;
                            Ok(())
                        },
                    }
                }
            }

            impl Eq
                for Cursor_ {}

            impl Hash
                for Cursor_ {
                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                    match self {
                        Cursor_::Cursor{s, beg, point, end, } => {
                            Hash::hash(s, _state);
                            Hash::hash(beg, _state);
                            Hash::hash(point, _state);
                            Hash::hash(end, _state)
                        },
                    }
                }
            }

            impl Default
                for Cursor_ {
                fn default() -> Cursor_ {
                    Cursor_::Cursor {
                        s: Default::default(),
                        beg: Default::default(),
                        point: Default::default(),
                        end: Default::default()
                    }
                }
            }

            impl AsRef<Cursor_>
                for Cursor_ {
                fn as_ref(&self) -> &Self {
                    self
                }
            }
        }

        /// ../mpl/libraries/src/JSON/Utils/Lexers.dfy(6,1)
        pub mod _Lexers_Compile {
            /// ../mpl/libraries/src/JSON/Utils/Lexers.dfy(7,3)
            pub mod _Core_Compile {
                pub use ::dafny_runtime::DafnyType;
                pub use ::std::fmt::Debug;
                pub use ::std::fmt::Formatter;
                pub use ::std::fmt::Result;
                pub use ::dafny_runtime::DafnyPrint;
                pub use ::std::sync::Arc;
                pub use ::std::cmp::Eq;
                pub use ::std::hash::Hash;
                pub use ::std::hash::Hasher;
                pub use ::std::default::Default;
                pub use ::std::convert::AsRef;

                /// ../mpl/libraries/src/JSON/Utils/Lexers.dfy(11,5)
                #[derive(PartialEq, Clone)]
                pub enum LexerResult<T: DafnyType, R: DafnyType> {
                    /// The input is valid.
                    Accept {},
                    /// The input is not valid; `err` says why.
                    Reject {
                        err: R
                    },
                    /// More input is needed to finish lexing.
                    Partial {
                        st: T
                    }
                }

                impl<T: DafnyType, R: DafnyType> LexerResult<T, R> {
                    /// Gets the field err for all enum members which have it
                    pub fn err(&self) -> &R {
                        match self {
                            LexerResult::Accept{} => panic!("field does not exist on this variant"),
                            LexerResult::Reject{err, } => err,
                            LexerResult::Partial{st, } => panic!("field does not exist on this variant"),
                        }
                    }
                    /// Gets the field st for all enum members which have it
                    pub fn st(&self) -> &T {
                        match self {
                            LexerResult::Accept{} => panic!("field does not exist on this variant"),
                            LexerResult::Reject{err, } => panic!("field does not exist on this variant"),
                            LexerResult::Partial{st, } => st,
                        }
                    }
                }

                impl<T: DafnyType, R: DafnyType> Debug
                    for LexerResult<T, R> {
                    fn fmt(&self, f: &mut Formatter) -> Result {
                        DafnyPrint::fmt_print(self, f, true)
                    }
                }

                impl<T: DafnyType, R: DafnyType> DafnyPrint
                    for LexerResult<T, R> {
                    fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                        match self {
                            LexerResult::Accept{} => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Lexers_Compile.Core_Compile.LexerResult.Accept")?;
                                Ok(())
                            },
                            LexerResult::Reject{err, } => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Lexers_Compile.Core_Compile.LexerResult.Reject(")?;
                                DafnyPrint::fmt_print(err, _formatter, false)?;
                                write!(_formatter, ")")?;
                                Ok(())
                            },
                            LexerResult::Partial{st, } => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Lexers_Compile.Core_Compile.LexerResult.Partial(")?;
                                DafnyPrint::fmt_print(st, _formatter, false)?;
                                write!(_formatter, ")")?;
                                Ok(())
                            },
                        }
                    }
                }

                impl<T: DafnyType, R: DafnyType> LexerResult<T, R> {
                    /// Given type parameter conversions, returns a lambda to convert this structure
                    pub fn coerce<__T0: DafnyType, __T1: DafnyType>(f_0: Arc<impl ::std::ops::Fn(T) -> __T0 + 'static>, f_1: Arc<impl ::std::ops::Fn(R) -> __T1 + 'static>) -> Arc<impl ::std::ops::Fn(LexerResult<T, R>) -> LexerResult<__T0, __T1>> {
                        Arc::new(move |this: Self| -> LexerResult<__T0, __T1>{
                                match this {
                                    LexerResult::Accept{} => {
                                        LexerResult::Accept {}
                                    },
                                    LexerResult::Reject{err, } => {
                                        LexerResult::Reject {
                                            err: f_1.clone()(err)
                                        }
                                    },
                                    LexerResult::Partial{st, } => {
                                        LexerResult::Partial {
                                            st: f_0.clone()(st)
                                        }
                                    },
                                }
                            })
                    }
                }

                impl<T: DafnyType + Eq, R: DafnyType + Eq> Eq
                    for LexerResult<T, R> {}

                impl<T: DafnyType + Hash, R: DafnyType + Hash> Hash
                    for LexerResult<T, R> {
                    fn hash<_H: Hasher>(&self, _state: &mut _H) {
                        match self {
                            LexerResult::Accept{} => {

                            },
                            LexerResult::Reject{err, } => {
                                Hash::hash(err, _state)
                            },
                            LexerResult::Partial{st, } => {
                                Hash::hash(st, _state)
                            },
                        }
                    }
                }

                impl<T: DafnyType + Default, R: DafnyType + Default> Default
                    for LexerResult<T, R> {
                    fn default() -> LexerResult<T, R> {
                        LexerResult::Accept {}
                    }
                }

                impl<T: DafnyType, R: DafnyType> AsRef<LexerResult<T, R>>
                    for LexerResult<T, R> {
                    fn as_ref(&self) -> &Self {
                        self
                    }
                }
            }

            /// ../mpl/libraries/src/JSON/Utils/Lexers.dfy(20,3)
            pub mod _Strings_Compile {
                pub use ::dafny_runtime::DafnyType;
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Core_Compile::LexerResult;
                pub use ::dafny_runtime::DafnyCharUTF16;
                pub use ::dafny_runtime::Sequence;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState::Start;
                pub use ::dafny_runtime::string_utf16_of;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState::Body;
                pub use ::std::fmt::Debug;
                pub use ::std::fmt::Formatter;
                pub use ::std::fmt::Result;
                pub use ::dafny_runtime::DafnyPrint;
                pub use ::std::cmp::Eq;
                pub use ::std::hash::Hash;
                pub use ::std::hash::Hasher;
                pub use ::std::default::Default;
                pub use ::std::convert::AsRef;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/Utils/Lexers.dfy(27,5)
                    pub fn StringBody<_R: DafnyType>(escaped: bool, byte: i16) -> Arc<LexerResult<bool, _R>> {
                        if byte == DafnyCharUTF16(92 as u16).0 as i16 {
                            Arc::new(LexerResult::<bool, _R>::Partial {
                                    st: !escaped
                                })
                        } else {
                            if byte == DafnyCharUTF16(34 as u16).0 as i16 && !escaped {
                                Arc::new(LexerResult::<bool, _R>::Accept {})
                            } else {
                                Arc::new(LexerResult::<bool, _R>::Partial {
                                        st: false
                                    })
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Lexers.dfy(38,5)
                    pub fn String(st: &Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState>, byte: i16) -> Arc<LexerResult<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState>, Sequence<DafnyCharUTF16>>> {
                        let mut _source0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState> = st.clone();
                        if matches!((&_source0).as_ref(), Start{ .. }) {
                            if byte == DafnyCharUTF16(34 as u16).0 as i16 {
                                Arc::new(LexerResult::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState>, Sequence<DafnyCharUTF16>>::Partial {
                                        st: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState::Body {
                                                    escaped: false
                                                })
                                    })
                            } else {
                                Arc::new(LexerResult::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState>, Sequence<DafnyCharUTF16>>::Reject {
                                        err: string_utf16_of("String must start with double quote")
                                    })
                            }
                        } else {
                            if matches!((&_source0).as_ref(), Body{ .. }) {
                                let mut ___mcc_h0: bool = _source0.escaped().clone();
                                let mut escaped: bool = ___mcc_h0;
                                if byte == DafnyCharUTF16(92 as u16).0 as i16 {
                                    Arc::new(LexerResult::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState>, Sequence<DafnyCharUTF16>>::Partial {
                                            st: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState::Body {
                                                        escaped: !escaped
                                                    })
                                        })
                                } else {
                                    if byte == DafnyCharUTF16(34 as u16).0 as i16 && !escaped {
                                        Arc::new(LexerResult::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState>, Sequence<DafnyCharUTF16>>::Partial {
                                                st: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState::End {})
                                            })
                                    } else {
                                        Arc::new(LexerResult::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState>, Sequence<DafnyCharUTF16>>::Partial {
                                                st: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState::Body {
                                                            escaped: false
                                                        })
                                            })
                                    }
                                }
                            } else {
                                Arc::new(LexerResult::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState>, Sequence<DafnyCharUTF16>>::Accept {})
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Lexers.dfy(25,5)
                    pub fn StringBodyLexerStart() -> bool {
                        false
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Lexers.dfy(36,5)
                    pub fn StringLexerStart() -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState> {
                        Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Lexers_Compile::_Strings_Compile::StringLexerState::Start {})
                    }
                }

                /// ../mpl/libraries/src/JSON/Utils/Lexers.dfy(35,5)
                #[derive(PartialEq, Clone)]
                pub enum StringLexerState {
                    Start {},
                    Body {
                        escaped: bool
                    },
                    End {}
                }

                impl StringLexerState {
                    /// Gets the field escaped for all enum members which have it
                    pub fn escaped(&self) -> &bool {
                        match self {
                            StringLexerState::Start{} => panic!("field does not exist on this variant"),
                            StringLexerState::Body{escaped, } => escaped,
                            StringLexerState::End{} => panic!("field does not exist on this variant"),
                        }
                    }
                }

                impl Debug
                    for StringLexerState {
                    fn fmt(&self, f: &mut Formatter) -> Result {
                        DafnyPrint::fmt_print(self, f, true)
                    }
                }

                impl DafnyPrint
                    for StringLexerState {
                    fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                        match self {
                            StringLexerState::Start{} => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Lexers_Compile.Strings_Compile.StringLexerState.Start")?;
                                Ok(())
                            },
                            StringLexerState::Body{escaped, } => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Lexers_Compile.Strings_Compile.StringLexerState.Body(")?;
                                DafnyPrint::fmt_print(escaped, _formatter, false)?;
                                write!(_formatter, ")")?;
                                Ok(())
                            },
                            StringLexerState::End{} => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Lexers_Compile.Strings_Compile.StringLexerState.End")?;
                                Ok(())
                            },
                        }
                    }
                }

                impl Eq
                    for StringLexerState {}

                impl Hash
                    for StringLexerState {
                    fn hash<_H: Hasher>(&self, _state: &mut _H) {
                        match self {
                            StringLexerState::Start{} => {

                            },
                            StringLexerState::Body{escaped, } => {
                                Hash::hash(escaped, _state)
                            },
                            StringLexerState::End{} => {

                            },
                        }
                    }
                }

                impl Default
                    for StringLexerState {
                    fn default() -> StringLexerState {
                        StringLexerState::Start {}
                    }
                }

                impl AsRef<StringLexerState>
                    for StringLexerState {
                    fn as_ref(&self) -> &Self {
                        self
                    }
                }
            }
        }

        /// ../mpl/libraries/src/JSON/Utils/Parsers.dfy(7,1)
        pub mod _Parsers_Compile {
            pub use ::dafny_runtime::DafnyType;
            pub use ::std::sync::Arc;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
            pub use ::std::default::Default;
            pub use ::std::marker::Sync;
            pub use ::std::marker::Send;
            pub use ::std::fmt::Debug;
            pub use ::std::fmt::Formatter;
            pub use ::dafny_runtime::DafnyPrint;
            pub use ::std::hash::Hash;
            pub use ::std::hash::Hasher;
            pub use ::std::convert::AsRef;

            pub struct _default {}

            impl _default {
                /// ../mpl/libraries/src/JSON/Utils/Parsers.dfy(26,3)
                pub fn ParserWitness<_T: DafnyType, _R: DafnyType>() -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::Parser_<_T, _R>> {
                    Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::Parser_::<_T, _R>::Parser {
                            r#fn: {
                                    Arc::new(move |_v0: &FreshCursor| -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Split<_T>>, Arc<CursorError<_R>>>>{
                                            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Split<_T>>, Arc<CursorError<_R>>>::Failure {
                                                    error: Arc::new(CursorError::<_R>::EOF {})
                                                })
                                        })
                                }
                        })
                }
                /// ../mpl/libraries/src/JSON/Utils/Parsers.dfy(55,3)
                pub fn SubParserWitness<_T: DafnyType, _R: DafnyType>() -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::SubParser_<_T, _R>> {
                    Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::SubParser_::<_T, _R>::SubParser {
                            r#fn: {
                                    Arc::new(move |cs: &FreshCursor| -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Split<_T>>, Arc<CursorError<_R>>>>{
                                            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<Split<_T>>, Arc<CursorError<_R>>>::Failure {
                                                    error: Arc::new(CursorError::<_R>::EOF {})
                                                })
                                        })
                                }
                        })
                }
            }

            /// BUG(https://github.com/dafny-lang/dafny/issues/2175)
            /// ../mpl/libraries/src/JSON/Utils/Parsers.dfy(16,3)
            pub type Parser<T: DafnyType, R: DafnyType> = Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::Parser_<T, R>>;

            /// An element of Parser
            pub fn __init_Parser<T: DafnyType + Default, R: DafnyType + Default>() -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::Parser_<T, R>> {
                crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::_default::ParserWitness::<T, R>()
            }

            /// ../mpl/libraries/src/JSON/Utils/Parsers.dfy(19,3)
            #[derive(Clone)]
            pub enum Parser_<T: DafnyType, R: DafnyType> {
                Parser {
                    r#fn: Arc<dyn ::std::ops::Fn(&FreshCursor) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Split<T>>, Arc<CursorError<R>>>> + Sync + Send>
                }
            }

            impl<T: DafnyType, R: DafnyType> Parser_<T, R> {
                /// Returns a borrow of the field r#fn
                pub fn r#fn(&self) -> &Arc<dyn ::std::ops::Fn(&FreshCursor) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Split<T>>, Arc<CursorError<R>>>> + Sync + Send> {
                    match self {
                        Parser_::Parser{r#fn, } => r#fn,
                    }
                }
            }

            impl<T: DafnyType, R: DafnyType> Debug
                for Parser_<T, R> {
                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                    DafnyPrint::fmt_print(self, f, true)
                }
            }

            impl<T: DafnyType, R: DafnyType> DafnyPrint
                for Parser_<T, R> {
                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                    match self {
                        Parser_::Parser{r#fn, } => {
                            write!(_formatter, "JSON_Compile.Utils_Compile.Parsers_Compile.Parser__.Parser(")?;
                            write!(_formatter, "<function>")?;
                            write!(_formatter, ")")?;
                            Ok(())
                        },
                    }
                }
            }

            impl<T: DafnyType, R: DafnyType> Parser_<T, R> {
                /// Given type parameter conversions, returns a lambda to convert this structure
                pub fn coerce<__T1: DafnyType>(f_1: Arc<impl ::std::ops::Fn(R) -> __T1 + 'static>) -> Arc<impl ::std::ops::Fn(Parser_<T, R>) -> Parser_<T, __T1>> {
                    Arc::new(move |this: Self| -> Parser_<T, __T1>{
                            match this {
                                Parser_::Parser{r#fn, } => {
                                    Parser_::Parser {
                                        r#fn: todo!("Could not generate coercion function for contructor 0 of Parser_")
                                    }
                                },
                            }
                        })
                }
            }

            impl<T: DafnyType + Hash, R: DafnyType + Hash> Hash
                for Parser_<T, R> {
                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                    match self {
                        Parser_::Parser{r#fn, } => {
                            0.hash(_state)
                        },
                    }
                }
            }

            impl<T: DafnyType, R: DafnyType> AsRef<Parser_<T, R>>
                for Parser_<T, R> {
                fn as_ref(&self) -> &Self {
                    self
                }
            }

            /// ../mpl/libraries/src/JSON/Utils/Parsers.dfy(39,3)
            #[derive(Clone)]
            pub enum SubParser_<T: DafnyType, R: DafnyType> {
                SubParser {
                    r#fn: Arc<dyn ::std::ops::Fn(&FreshCursor) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Split<T>>, Arc<CursorError<R>>>> + Sync + Send>
                }
            }

            impl<T: DafnyType, R: DafnyType> SubParser_<T, R> {
                /// Returns a borrow of the field r#fn
                pub fn r#fn(&self) -> &Arc<dyn ::std::ops::Fn(&FreshCursor) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<Split<T>>, Arc<CursorError<R>>>> + Sync + Send> {
                    match self {
                        SubParser_::SubParser{r#fn, } => r#fn,
                    }
                }
            }

            impl<T: DafnyType, R: DafnyType> Debug
                for SubParser_<T, R> {
                fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                    DafnyPrint::fmt_print(self, f, true)
                }
            }

            impl<T: DafnyType, R: DafnyType> DafnyPrint
                for SubParser_<T, R> {
                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                    match self {
                        SubParser_::SubParser{r#fn, } => {
                            write!(_formatter, "JSON_Compile.Utils_Compile.Parsers_Compile.SubParser__.SubParser(")?;
                            write!(_formatter, "<function>")?;
                            write!(_formatter, ")")?;
                            Ok(())
                        },
                    }
                }
            }

            impl<T: DafnyType, R: DafnyType> SubParser_<T, R> {
                /// Given type parameter conversions, returns a lambda to convert this structure
                pub fn coerce<__T1: DafnyType>(f_1: Arc<impl ::std::ops::Fn(R) -> __T1 + 'static>) -> Arc<impl ::std::ops::Fn(SubParser_<T, R>) -> SubParser_<T, __T1>> {
                    Arc::new(move |this: Self| -> SubParser_<T, __T1>{
                            match this {
                                SubParser_::SubParser{r#fn, } => {
                                    SubParser_::SubParser {
                                        r#fn: todo!("Could not generate coercion function for contructor 0 of SubParser_")
                                    }
                                },
                            }
                        })
                }
            }

            impl<T: DafnyType + Hash, R: DafnyType + Hash> Hash
                for SubParser_<T, R> {
                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                    match self {
                        SubParser_::SubParser{r#fn, } => {
                            0.hash(_state)
                        },
                    }
                }
            }

            impl<T: DafnyType, R: DafnyType> AsRef<SubParser_<T, R>>
                for SubParser_<T, R> {
                fn as_ref(&self) -> &Self {
                    self
                }
            }

            /// BUG(https://github.com/dafny-lang/dafny/issues/2175)
            /// ../mpl/libraries/src/JSON/Utils/Parsers.dfy(52,3)
            pub type SubParser<T: DafnyType, R: DafnyType> = Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::SubParser_<T, R>>;

            /// An element of SubParser
            pub fn __init_SubParser<T: DafnyType + Default, R: DafnyType + Default>() -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::SubParser_<T, R>> {
                crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::_default::SubParserWitness::<T, R>()
            }
        }

        /// ../mpl/libraries/src/JSON/Utils/Seq.dfy(3,1)
        pub mod _Seq_Compile {

        }

        /// ../mpl/libraries/src/JSON/Utils/Str.dfy(10,1)
        pub mod _Str_Compile {
            pub use ::dafny_runtime::_System::nat;
            pub use ::dafny_runtime::DafnyInt;
            pub use ::dafny_runtime::Sequence;
            pub use ::dafny_runtime::DafnyCharUTF16;
            pub use ::dafny_runtime::set;
            pub use ::std::sync::Arc;
            pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::UnescapeError;
            pub use ::dafny_runtime::int;
            pub use ::dafny_runtime::string_utf16_of;
            pub use ::dafny_runtime::DafnyPrintWrapper;
            pub use ::dafny_runtime::seq;
            pub use ::dafny_runtime::Map;
            pub use ::dafny_runtime::map;

            pub struct _default {}

            impl _default {
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(188,3)
                pub fn OfNat(n: &nat, base: &DafnyInt) -> Sequence<DafnyCharUTF16> {
                    crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::OfNat_any(n, &crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::HEX_DIGITS().take(base))
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(196,3)
                pub fn OfInt(n: &DafnyInt, base: &DafnyInt) -> Sequence<DafnyCharUTF16> {
                    crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::OfInt_any(n, &crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::HEX_DIGITS().take(base), &DafnyCharUTF16(45 as u16))
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(203,3)
                pub fn ToNat(str: &Sequence<DafnyCharUTF16>, base: &DafnyInt) -> nat {
                    crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::ToNat_any(str, base, &crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::HEX_TABLE())
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(212,3)
                pub fn ToInt(str: &Sequence<DafnyCharUTF16>, base: &DafnyInt) -> DafnyInt {
                    crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::ToInt_any(str, &DafnyCharUTF16(45 as u16), base, &crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::HEX_TABLE())
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(220,3)
                pub fn EscapeQuotes(str: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
                    crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::_default::Escape(str, &set!{DafnyCharUTF16(34 as u16), DafnyCharUTF16(39 as u16)}, &DafnyCharUTF16(92 as u16))
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(224,3)
                pub fn UnescapeQuotes(str: &Sequence<DafnyCharUTF16>) -> Arc<Result<Sequence<DafnyCharUTF16>, Arc<UnescapeError>>> {
                    crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::_default::Unescape(str, &DafnyCharUTF16(92 as u16))
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(228,3)
                pub fn Test() -> () {
                    let mut _e00: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::OfInt(&int!(0), &int!(10));
                    let mut _e10: Sequence<DafnyCharUTF16> = string_utf16_of("0");
                    if !(_e00.clone() == _e10.clone()) {
                        print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                        print!("{}", DafnyPrintWrapper(&_e00));
                        print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                        print!("{}", DafnyPrintWrapper(&_e10));
                        panic!("Halt")
                    };
                    let mut _e01: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::OfInt(&int!(3), &int!(10));
                    let mut _e11: Sequence<DafnyCharUTF16> = string_utf16_of("3");
                    if !(_e01.clone() == _e11.clone()) {
                        print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                        print!("{}", DafnyPrintWrapper(&_e01));
                        print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                        print!("{}", DafnyPrintWrapper(&_e11));
                        panic!("Halt")
                    };
                    let mut _e02: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::OfInt(&int!(302), &int!(10));
                    let mut _e12: Sequence<DafnyCharUTF16> = string_utf16_of("302");
                    if !(_e02.clone() == _e12.clone()) {
                        print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                        print!("{}", DafnyPrintWrapper(&_e02));
                        print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                        print!("{}", DafnyPrintWrapper(&_e12));
                        panic!("Halt")
                    };
                    let mut _e03: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::OfInt(&int!(-3), &int!(10));
                    let mut _e13: Sequence<DafnyCharUTF16> = string_utf16_of("-3");
                    if !(_e03.clone() == _e13.clone()) {
                        print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                        print!("{}", DafnyPrintWrapper(&_e03));
                        print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                        print!("{}", DafnyPrintWrapper(&_e13));
                        panic!("Halt")
                    };
                    let mut _e04: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_default::OfInt(&int!(-302), &int!(10));
                    let mut _e14: Sequence<DafnyCharUTF16> = string_utf16_of("-302");
                    if !(_e04.clone() == _e14.clone()) {
                        print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                        print!("{}", DafnyPrintWrapper(&_e04));
                        print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                        print!("{}", DafnyPrintWrapper(&_e14));
                        panic!("Halt")
                    };
                    return ();
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(236,3)
                pub fn OfBool(b: bool) -> Sequence<DafnyCharUTF16> {
                    if b {
                        string_utf16_of("true")
                    } else {
                        string_utf16_of("false")
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(240,3)
                pub fn OfChar(c: &DafnyCharUTF16) -> Sequence<DafnyCharUTF16> {
                    seq![c.clone()]
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(244,3)
                pub fn Join(sep: &Sequence<DafnyCharUTF16>, strs: &Sequence<Sequence<DafnyCharUTF16>>) -> Sequence<DafnyCharUTF16> {
                    let mut _accumulator: Sequence<DafnyCharUTF16> = seq![] as Sequence<DafnyCharUTF16>;
                    let mut _r0 = sep.clone();
                    let mut _r1 = strs.clone();
                    'TAIL_CALL_START: loop {
                        let sep = _r0;
                        let strs = _r1;
                        if strs.cardinality() == int!(0) {
                            return _accumulator.concat(&string_utf16_of(""));
                        } else {
                            if strs.cardinality() == int!(1) {
                                return _accumulator.concat(&strs.get(&int!(0)));
                            } else {
                                _accumulator = _accumulator.concat(&strs.get(&int!(0)).concat(&sep));
                                let mut _in0: Sequence<DafnyCharUTF16> = sep.clone();
                                let mut _in1: Sequence<Sequence<DafnyCharUTF16>> = strs.drop(&int!(1));
                                _r0 = _in0.clone();
                                _r1 = _in1.clone();
                                continue 'TAIL_CALL_START;
                            }
                        }
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(250,3)
                pub fn Concat(strs: &Sequence<Sequence<DafnyCharUTF16>>) -> Sequence<DafnyCharUTF16> {
                    let mut _accumulator: Sequence<DafnyCharUTF16> = seq![] as Sequence<DafnyCharUTF16>;
                    let mut _r0 = strs.clone();
                    'TAIL_CALL_START: loop {
                        let strs = _r0;
                        if strs.cardinality() == int!(0) {
                            return _accumulator.concat(&string_utf16_of(""));
                        } else {
                            _accumulator = _accumulator.concat(&strs.get(&int!(0)));
                            let mut _in0: Sequence<Sequence<DafnyCharUTF16>> = strs.drop(&int!(1));
                            _r0 = _in0.clone();
                            continue 'TAIL_CALL_START;
                        }
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(179,3)
                pub fn HEX_DIGITS() -> Sequence<DafnyCharUTF16> {
                    string_utf16_of("0123456789ABCDEF")
                }
                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(181,3)
                pub fn HEX_TABLE() -> Map<DafnyCharUTF16, DafnyInt> {
                    map![(DafnyCharUTF16(48 as u16)) => (int!(0)), (DafnyCharUTF16(49 as u16)) => (int!(1)), (DafnyCharUTF16(50 as u16)) => (int!(2)), (DafnyCharUTF16(51 as u16)) => (int!(3)), (DafnyCharUTF16(52 as u16)) => (int!(4)), (DafnyCharUTF16(53 as u16)) => (int!(5)), (DafnyCharUTF16(54 as u16)) => (int!(6)), (DafnyCharUTF16(55 as u16)) => (int!(7)), (DafnyCharUTF16(56 as u16)) => (int!(8)), (DafnyCharUTF16(57 as u16)) => (int!(9)), (DafnyCharUTF16(97 as u16)) => (int!(10)), (DafnyCharUTF16(98 as u16)) => (int!(11)), (DafnyCharUTF16(99 as u16)) => (int!(12)), (DafnyCharUTF16(100 as u16)) => (int!(13)), (DafnyCharUTF16(101 as u16)) => (int!(14)), (DafnyCharUTF16(102 as u16)) => (int!(15)), (DafnyCharUTF16(65 as u16)) => (int!(10)), (DafnyCharUTF16(66 as u16)) => (int!(11)), (DafnyCharUTF16(67 as u16)) => (int!(12)), (DafnyCharUTF16(68 as u16)) => (int!(13)), (DafnyCharUTF16(69 as u16)) => (int!(14)), (DafnyCharUTF16(70 as u16)) => (int!(15))]
                }
            }

            /// ../mpl/libraries/src/JSON/Utils/Str.dfy(171,3)
            pub mod _CharStrConversion_Compile {
                pub use ::dafny_runtime::_System::nat;
                pub use ::dafny_runtime::DafnyInt;
                pub use ::dafny_runtime::Sequence;
                pub use ::dafny_runtime::int;
                pub use ::dafny_runtime::seq;
                pub use ::dafny_runtime::euclidian_division;
                pub use ::dafny_runtime::euclidian_modulo;
                pub use ::dafny_runtime::DafnyCharUTF16;
                pub use ::std::sync::Arc;
                pub use ::std::marker::Sync;
                pub use ::std::marker::Send;
                pub use ::dafny_runtime::itertools::Itertools;
                pub use ::dafny_runtime::Map;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/Utils/Str.dfy(27,5)
                    pub fn Digits(n: &nat, base: &DafnyInt) -> Sequence<DafnyInt> {
                        if n.clone() == int!(0) {
                            seq![] as Sequence<DafnyInt>
                        } else {
                            let mut _digits_k: Sequence<DafnyInt> = crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::Digits(&euclidian_division(n.clone(), base.clone()), base);
                            let mut digits: Sequence<DafnyInt> = _digits_k.concat(&seq![euclidian_modulo(n.clone(), base.clone())]);
                            digits.clone()
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Str.dfy(54,5)
                    pub fn OfDigits(digits: &Sequence<DafnyInt>, chars: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
                        let mut _accumulator: Sequence<DafnyCharUTF16> = seq![] as Sequence<DafnyCharUTF16>;
                        let mut _r0 = digits.clone();
                        let mut _r1 = chars.clone();
                        'TAIL_CALL_START: loop {
                            let digits = _r0;
                            let chars = _r1;
                            if digits.clone().to_array().len() == 0 {
                                return _accumulator.concat(&(seq![] as Sequence<DafnyCharUTF16>));
                            } else {
                                _accumulator = _accumulator.concat(&seq![chars.get(&digits.get(&int!(0)))]);
                                let mut _in0: Sequence<DafnyInt> = digits.drop(&int!(1));
                                let mut _in1: Sequence<DafnyCharUTF16> = chars.clone();
                                _r0 = _in0.clone();
                                _r1 = _in1.clone();
                                continue 'TAIL_CALL_START;
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Str.dfy(66,5)
                    pub fn OfNat_any(n: &nat, chars: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
                        let mut base: DafnyInt = chars.cardinality();
                        if n.clone() == int!(0) {
                            seq![chars.get(&int!(0))]
                        } else {
                            crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::OfDigits(&crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::Digits(n, &base), chars)
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Str.dfy(76,5)
                    pub fn NumberStr(str: &Sequence<DafnyCharUTF16>, minus: &DafnyCharUTF16, is_digit: &Arc<dyn ::std::ops::Fn(&DafnyCharUTF16) -> bool + Sync + Send>) -> bool {
                        !(!(str.clone().to_array().len() == 0)) || (str.get(&int!(0)) == minus.clone() || is_digit(&str.get(&int!(0)))) && Itertools::unique((&str.drop(&int!(1))).iter()).all(({
                                let mut str = str.clone();
                                let mut is_digit = is_digit.clone();
                                Arc::new(move |__forall_var_0: DafnyCharUTF16| -> bool{
                                        let mut c: DafnyCharUTF16 = __forall_var_0.clone();
                                        !str.drop(&int!(1)).contains(&c) || (&is_digit)(&c)
                                    })
                            }).as_ref())
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Str.dfy(82,5)
                    pub fn OfInt_any(n: &DafnyInt, chars: &Sequence<DafnyCharUTF16>, minus: &DafnyCharUTF16) -> Sequence<DafnyCharUTF16> {
                        if !(n.clone() < int!(0)) {
                            crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::OfNat_any(n, chars)
                        } else {
                            seq![minus.clone()].concat(&crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::OfNat_any(&(int!(0) - n.clone()), chars))
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Str.dfy(90,5)
                    pub fn ToNat_any(str: &Sequence<DafnyCharUTF16>, base: &nat, digits: &Map<DafnyCharUTF16, nat>) -> nat {
                        if str.clone().to_array().len() == 0 {
                            int!(0)
                        } else {
                            crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::ToNat_any(&str.take(&(str.cardinality() - int!(1))), base, digits) * base.clone() + digits.get(&str.get(&(str.cardinality() - int!(1))))
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Str.dfy(124,5)
                    pub fn ToInt_any(str: &Sequence<DafnyCharUTF16>, minus: &DafnyCharUTF16, base: &nat, digits: &Map<DafnyCharUTF16, nat>) -> DafnyInt {
                        if seq![minus.clone()] <= str.clone() {
                            int!(0) - crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::ToNat_any(&str.drop(&int!(1)), base, digits)
                        } else {
                            crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrConversion_Compile::_default::ToNat_any(str, base, digits)
                        }
                    }
                }
            }

            /// ../mpl/libraries/src/JSON/Utils/Str.dfy(175,3)
            pub mod _CharStrEscaping_Compile {
                pub use ::dafny_runtime::Sequence;
                pub use ::dafny_runtime::DafnyCharUTF16;
                pub use ::dafny_runtime::Set;
                pub use ::dafny_runtime::seq;
                pub use ::dafny_runtime::int;
                pub use ::std::sync::Arc;
                pub use ::std::fmt::Debug;
                pub use ::std::fmt::Formatter;
                pub use ::dafny_runtime::DafnyPrint;
                pub use ::dafny_runtime::SequenceIter;
                pub use ::std::cmp::Eq;
                pub use ::std::hash::Hash;
                pub use ::std::hash::Hasher;
                pub use ::std::default::Default;
                pub use ::std::convert::AsRef;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/Utils/Str.dfy(142,5)
                    pub fn Escape(str: &Sequence<DafnyCharUTF16>, special: &Set<DafnyCharUTF16>, escape: &DafnyCharUTF16) -> Sequence<DafnyCharUTF16> {
                        let mut _accumulator: Sequence<DafnyCharUTF16> = seq![] as Sequence<DafnyCharUTF16>;
                        let mut _r0 = str.clone();
                        let mut _r1 = special.clone();
                        let mut _r2 = escape.clone();
                        'TAIL_CALL_START: loop {
                            let str = _r0;
                            let special = _r1;
                            let escape = _r2;
                            if str.clone().to_array().len() == 0 {
                                return _accumulator.concat(&str);
                            } else {
                                if special.contains(&str.get(&int!(0))) {
                                    _accumulator = _accumulator.concat(&seq![escape.clone(), str.get(&int!(0))]);
                                    let mut _in0: Sequence<DafnyCharUTF16> = str.drop(&int!(1));
                                    let mut _in1: Set<DafnyCharUTF16> = special.clone();
                                    let mut _in2: DafnyCharUTF16 = escape.clone();
                                    _r0 = _in0.clone();
                                    _r1 = _in1.clone();
                                    _r2 = _in2.clone();
                                    continue 'TAIL_CALL_START;
                                } else {
                                    _accumulator = _accumulator.concat(&seq![str.get(&int!(0))]);
                                    let mut _in3: Sequence<DafnyCharUTF16> = str.drop(&int!(1));
                                    let mut _in4: Set<DafnyCharUTF16> = special.clone();
                                    let mut _in5: DafnyCharUTF16 = escape.clone();
                                    _r0 = _in3.clone();
                                    _r1 = _in4.clone();
                                    _r2 = _in5.clone();
                                    continue 'TAIL_CALL_START;
                                }
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Str.dfy(151,5)
                    pub fn Unescape(str: &Sequence<DafnyCharUTF16>, escape: &DafnyCharUTF16) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::UnescapeError>>> {
                        if str.clone().to_array().len() == 0 {
                            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::UnescapeError>>::Success {
                                    value: str.clone()
                                })
                        } else {
                            if str.get(&int!(0)) == escape.clone() {
                                if int!(1) < str.cardinality() {
                                    let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::UnescapeError>>> = crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::_default::Unescape(&str.drop(&int!(2)), escape);
                                    if valueOrError0.IsFailure() {
                                        valueOrError0.PropagateFailure::<Sequence<DafnyCharUTF16>>()
                                    } else {
                                        let mut tl: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
                                        Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::UnescapeError>>::Success {
                                                value: seq![str.get(&int!(1))].concat(&tl)
                                            })
                                    }
                                } else {
                                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::UnescapeError>>::Failure {
                                            error: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::UnescapeError::EscapeAtEOS {})
                                        })
                                }
                            } else {
                                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::UnescapeError>>> = crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::_default::Unescape(&str.drop(&int!(1)), escape);
                                if valueOrError1.IsFailure() {
                                    valueOrError1.PropagateFailure::<Sequence<DafnyCharUTF16>>()
                                } else {
                                    let mut tl: Sequence<DafnyCharUTF16> = valueOrError1.Extract();
                                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Str_Compile::_CharStrEscaping_Compile::UnescapeError>>::Success {
                                            value: seq![str.get(&int!(0))].concat(&tl)
                                        })
                                }
                            }
                        }
                    }
                }

                /// ../mpl/libraries/src/JSON/Utils/Str.dfy(148,5)
                #[derive(PartialEq, Clone)]
                pub enum UnescapeError {
                    EscapeAtEOS {}
                }

                impl UnescapeError {}

                impl Debug
                    for UnescapeError {
                    fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
                        DafnyPrint::fmt_print(self, f, true)
                    }
                }

                impl DafnyPrint
                    for UnescapeError {
                    fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                        match self {
                            UnescapeError::EscapeAtEOS{} => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Str_Compile.CharStrEscaping_Compile.UnescapeError.EscapeAtEOS")?;
                                Ok(())
                            },
                        }
                    }
                }

                impl UnescapeError {
                    /// Enumerates all possible values of UnescapeError
                    pub fn _AllSingletonConstructors() -> SequenceIter<Arc<UnescapeError>> {
                        seq![Arc::new(UnescapeError::EscapeAtEOS {})].iter()
                    }
                }

                impl Eq
                    for UnescapeError {}

                impl Hash
                    for UnescapeError {
                    fn hash<_H: Hasher>(&self, _state: &mut _H) {
                        match self {
                            UnescapeError::EscapeAtEOS{} => {

                            },
                        }
                    }
                }

                impl Default
                    for UnescapeError {
                    fn default() -> UnescapeError {
                        UnescapeError::EscapeAtEOS {}
                    }
                }

                impl AsRef<UnescapeError>
                    for UnescapeError {
                    fn as_ref(&self) -> &Self {
                        self
                    }
                }
            }
        }

        /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(6,1)
        pub mod _Vectors_Compile {
            pub use ::std::sync::Arc;
            pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
            pub use ::std::fmt::Debug;
            pub use ::std::fmt::Formatter;
            pub use ::std::fmt::Result;
            pub use ::dafny_runtime::DafnyPrint;
            pub use ::dafny_runtime::SequenceIter;
            pub use ::dafny_runtime::seq;
            pub use ::std::cmp::Eq;
            pub use ::std::hash::Hash;
            pub use ::std::hash::Hasher;
            pub use ::std::default::Default;
            pub use ::std::convert::AsRef;
            pub use ::dafny_runtime::DafnyType;
            pub use ::dafny_runtime::Object;
            pub use ::dafny_runtime::allocate_object;
            pub use ::dafny_runtime::update_field_uninit_object;
            pub use ::dafny_runtime::update_field_mut_uninit_object;
            pub use ::dafny_runtime::truncate;
            pub use ::dafny_runtime::int;
            pub use ::dafny_runtime::_System::nat;
            pub use ::std::marker::Sync;
            pub use ::std::marker::Send;
            pub use ::std::mem::MaybeUninit;
            pub use ::dafny_runtime::array;
            pub use ::dafny_runtime::DafnyUsize;
            pub use ::dafny_runtime::integer_range;
            pub use ::dafny_runtime::rd;
            pub use ::dafny_runtime::read_field;
            pub use ::std::convert::Into;
            pub use ::dafny_runtime::modify_field;
            pub use ::dafny_runtime::MaybePlacebo;
            pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome::Fail;
            pub use ::dafny_runtime::UpcastObject;
            pub use ::dafny_runtime::DynAny;
            pub use ::dafny_runtime::UpcastObjectFn;

            pub struct _default {}

            impl _default {
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(11,3)
                pub fn OOM_FAILURE() -> Arc<Outcome<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>> {
                    Arc::new(Outcome::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>::Fail {
                            error: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError::OutOfMemory {})
                        })
                }
            }

            /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(10,3)
            #[derive(PartialEq, Clone)]
            pub enum VectorError {
                OutOfMemory {}
            }

            impl VectorError {}

            impl Debug
                for VectorError {
                fn fmt(&self, f: &mut Formatter) -> Result {
                    DafnyPrint::fmt_print(self, f, true)
                }
            }

            impl DafnyPrint
                for VectorError {
                fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                    match self {
                        VectorError::OutOfMemory{} => {
                            write!(_formatter, "JSON_Compile.Utils_Compile.Vectors_Compile.VectorError.OutOfMemory")?;
                            Ok(())
                        },
                    }
                }
            }

            impl VectorError {
                /// Enumerates all possible values of VectorError
                pub fn _AllSingletonConstructors() -> SequenceIter<Arc<VectorError>> {
                    seq![Arc::new(VectorError::OutOfMemory {})].iter()
                }
            }

            impl Eq
                for VectorError {}

            impl Hash
                for VectorError {
                fn hash<_H: Hasher>(&self, _state: &mut _H) {
                    match self {
                        VectorError::OutOfMemory{} => {

                        },
                    }
                }
            }

            impl Default
                for VectorError {
                fn default() -> VectorError {
                    VectorError::OutOfMemory {}
                }
            }

            impl AsRef<VectorError>
                for VectorError {
                fn as_ref(&self) -> &Self {
                    self
                }
            }

            /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(13,3)
            pub struct Vector<A: DafnyType> {
                pub size: ::dafny_runtime::Field<u32>,
                pub capacity: ::dafny_runtime::Field<u32>,
                pub data: ::dafny_runtime::Field<Object<[A]>>,
                pub __i_a: A
            }

            impl<A: DafnyType> Vector<A> {
                /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
                pub fn _allocate_object() -> Object<Self> {
                    allocate_object::<Self>()
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(37,5)
                pub fn _ctor(this: &Object<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::Vector<A>>, a0: &A, initial_capacity: u32) -> () {
                    let mut _set_size: bool = false;
                    let mut _set_capacity: bool = false;
                    let mut _set_data: bool = false;
                    let mut _set___i_a: bool = false;
                    update_field_uninit_object!(this.clone(), __i_a, _set___i_a, a0.clone());
                    update_field_mut_uninit_object!(this.clone(), size, _set_size, truncate!(int!(0), u32));
                    update_field_mut_uninit_object!(this.clone(), capacity, _set_capacity, initial_capacity);
                    let mut _init0: Arc<dyn ::std::ops::Fn(&nat) -> A + Sync + Send> = {
                            let a0: A = a0.clone();
                            {
                                let mut a0 = a0.clone();
                                Arc::new(move |_v0: &nat| -> A{
                                        a0.clone()
                                    })
                            }
                        };
                    let mut _nw0: Object<[MaybeUninit<A>]> = array::placebos_usize_object::<A>(DafnyUsize::into_usize(initial_capacity));
                    for __i0_0 in integer_range(truncate!(int!(0), usize), rd!(_nw0.clone()).len()) {
                        {
                            let __idx0 = DafnyUsize::into_usize(__i0_0.clone());
                            ::dafny_runtime::md!(_nw0)[__idx0] = MaybeUninit::new((&_init0)(&int!(__i0_0.clone())));
                        }
                    }
                    update_field_mut_uninit_object!(this.clone(), data, _set_data, array::construct_object(_nw0.clone()));
                    return ();
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(52,5)
                pub fn At(&self, idx: u32) -> A {
                    rd!(read_field!(self.data))[DafnyUsize::into_usize(idx)].clone()
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(61,5)
                pub fn Top(&self) -> A {
                    rd!(read_field!(self.data))[DafnyUsize::into_usize(read_field!(self.size) - truncate!(int!(1), u32))].clone()
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(70,5)
                pub fn Put(&self, idx: u32, a: &A) -> () {
                    {
                        let __idx0 = DafnyUsize::into_usize(idx);
                        ::dafny_runtime::md!(::dafny_runtime::read_field!(self.data))[__idx0] = a.clone();
                    };
                    return ();
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(81,5)
                pub fn CopyFrom(&self, new_data: &Object<[A]>, count: u32) -> () {
                    let mut _hi0: u32 = count;
                    for idx in integer_range(truncate!(int!(0), u32), _hi0).map(Into::<u32>::into) {
                        {
                            let __idx0 = DafnyUsize::into_usize(idx);
                            ::dafny_runtime::md!(::dafny_runtime::read_field!(self.data))[__idx0] = rd!(new_data)[DafnyUsize::into_usize(idx)].clone();
                        }
                    }
                    return ();
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(99,5)
                pub fn Realloc(&self, new_capacity: u32) -> () {
                    let mut old_data: Object<[A]>;
                    let mut old_capacity: u32;
                    let mut _rhs0: Object<[A]> = read_field!(self.data);
                    let mut _rhs1: u32 = read_field!(self.capacity);
                    old_data = _rhs0.clone();
                    old_capacity = _rhs1;
                    let mut _init0: Arc<dyn ::std::ops::Fn(&nat) -> A + Sync + Send> = {
                            let mut _this = Object::<_>::from_ref(self);
                            Arc::new(move |_v1: &nat| -> A{
                                    rd!((&_this).clone()).a().clone()
                                })
                        };
                    let mut _nw0: Object<[MaybeUninit<A>]> = array::placebos_usize_object::<A>(DafnyUsize::into_usize(new_capacity));
                    for __i0_0 in integer_range(truncate!(int!(0), usize), rd!(_nw0.clone()).len()) {
                        {
                            let __idx0 = DafnyUsize::into_usize(__i0_0.clone());
                            ::dafny_runtime::md!(_nw0)[__idx0] = MaybeUninit::new((&_init0)(&int!(__i0_0.clone())));
                        }
                    }
                    let mut _rhs2: Object<[A]> = array::construct_object(_nw0.clone());
                    let mut _rhs3: u32 = new_capacity;
                    let mut _lhs0: Object<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::Vector<A>> = Object::<_>::from_ref(self);
                    let mut _lhs1: Object<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::Vector<A>> = Object::<_>::from_ref(self);
                    modify_field!(rd!(_lhs0).data, _rhs2.clone());
                    modify_field!(rd!(_lhs1).capacity, _rhs3);
                    self.CopyFrom(&old_data, old_capacity);
                    return ();
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(113,5)
                pub fn DefaultNewCapacity(&self, capacity: u32) -> u32 {
                    if capacity < self.MAX_CAPACITY_BEFORE_DOUBLING().clone() {
                        truncate!(int!(2), u32) * capacity
                    } else {
                        self.MAX_CAPACITY().clone()
                    }
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(119,5)
                pub fn ReallocDefault(&self) -> Arc<Outcome<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>> {
                    let mut o = MaybePlacebo::<Arc<Outcome<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>>>::new();
                    if read_field!(self.capacity) == self.MAX_CAPACITY().clone() {
                        o = MaybePlacebo::from(Arc::new(Outcome::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>::Fail {
                                        error: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError::OutOfMemory {})
                                    }));
                        return o.read();
                    };
                    self.Realloc(self.DefaultNewCapacity(read_field!(self.capacity)));
                    o = MaybePlacebo::from(Arc::new(Outcome::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>::Pass {}));
                    return o.read();
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(141,5)
                pub fn Ensure(&self, reserved: u32) -> Arc<Outcome<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>> {
                    let mut o = MaybePlacebo::<Arc<Outcome<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>>>::new();
                    if self.MAX_CAPACITY().clone() - read_field!(self.size) < reserved {
                        o = MaybePlacebo::from(Arc::new(Outcome::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>::Fail {
                                        error: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError::OutOfMemory {})
                                    }));
                        return o.read();
                    };
                    if !(read_field!(self.capacity) - read_field!(self.size) < reserved) {
                        o = MaybePlacebo::from(Arc::new(Outcome::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>::Pass {}));
                        return o.read();
                    };
                    let mut new_capacity: u32 = read_field!(self.capacity);
                    while new_capacity - read_field!(self.size) < reserved {
                        new_capacity = self.DefaultNewCapacity(new_capacity);
                    };
                    self.Realloc(new_capacity);
                    o = MaybePlacebo::from(Arc::new(Outcome::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>::Pass {}));
                    return o.read();
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(170,5)
                pub fn PopFast(&self) -> () {
                    modify_field!(self.size, read_field!(self.size) - truncate!(int!(1), u32));
                    return ();
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(182,5)
                pub fn PushFast(&self, a: &A) -> () {
                    {
                        let __idx0 = DafnyUsize::into_usize(read_field!(self.size));
                        ::dafny_runtime::md!(::dafny_runtime::read_field!(self.data))[__idx0] = a.clone();
                    };
                    modify_field!(self.size, read_field!(self.size) + truncate!(int!(1), u32));
                    return ();
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(195,5)
                pub fn Push(&self, a: &A) -> Arc<Outcome<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>> {
                    let mut o = MaybePlacebo::<Arc<Outcome<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>>>::new();
                    if read_field!(self.size) == read_field!(self.capacity) {
                        let mut d: Arc<Outcome<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>>;
                        let mut _out0: Arc<Outcome<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>>;
                        _out0 = self.ReallocDefault();
                        d = _out0.clone();
                        if matches!((&d).as_ref(), Fail{ .. }) {
                            o = MaybePlacebo::from(d.clone());
                            return o.read();
                        }
                    };
                    self.PushFast(a);
                    o = MaybePlacebo::from(Arc::new(Outcome::<Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::VectorError>>::Pass {}));
                    return o.read();
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(17,5)
                pub fn a(&self) -> A {
                    self.__i_a.clone()
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(23,5)
                pub fn MAX_CAPACITY_BEFORE_DOUBLING(&self) -> u32 {
                    crate::implementation_from_dafny::_BoundedInts_Compile::_default::UINT32_MAX() / truncate!(int!(2), u32)
                }
                /// ../mpl/libraries/src/JSON/Utils/Vectors.dfy(22,5)
                pub fn MAX_CAPACITY(&self) -> u32 {
                    crate::implementation_from_dafny::_BoundedInts_Compile::_default::UINT32_MAX()
                }
            }

            impl<A: DafnyType> UpcastObject<DynAny>
                for crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Vectors_Compile::Vector<A> {
                UpcastObjectFn!(DynAny);
            }
        }

        pub mod _Views_Compile {
            /// ../mpl/libraries/src/JSON/Utils/Views.dfy(5,1)
            pub mod _Core_Compile {
                pub use ::std::sync::Arc;
                pub use ::dafny_runtime::seq;
                pub use ::dafny_runtime::Sequence;
                pub use ::dafny_runtime::truncate;
                pub use ::dafny_runtime::int;
                pub use ::dafny_runtime::DafnyCharUTF16;
                pub use ::dafny_runtime::DafnyInt;
                pub use ::dafny_runtime::integer_range;
                pub use ::dafny_runtime::Zero;
                pub use ::std::default::Default;
                pub use ::dafny_runtime::Object;
                pub use ::std::convert::Into;
                pub use ::dafny_runtime::DafnyUsize;
                pub use ::std::fmt::Debug;
                pub use ::std::fmt::Formatter;
                pub use ::std::fmt::Result;
                pub use ::dafny_runtime::DafnyPrint;
                pub use ::std::cmp::Eq;
                pub use ::std::hash::Hash;
                pub use ::std::hash::Hasher;
                pub use ::std::convert::AsRef;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(104,3)
                    pub fn Adjacent(lv: &crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View, rv: &crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View) -> bool {
                        lv.end().clone() == rv.beg().clone() && lv.s().clone() == rv.s().clone()
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(117,3)
                    pub fn Merge(lv: &crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View, rv: &crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View {
                        let mut _dt__update__tmp_h0: crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View = lv.clone();
                        let mut _dt__update_hend_h0: u32 = rv.end().clone();
                        Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_::View {
                                s: _dt__update__tmp_h0.s().clone(),
                                beg: _dt__update__tmp_h0.beg().clone(),
                                end: _dt__update_hend_h0
                            })
                    }
                }

                /// ../mpl/libraries/src/JSON/Utils/Views.dfy(8,3)
                pub type View = Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_>;

                /// An element of View
                pub fn __init_View() -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_> {
                    Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_::View {
                            s: seq![] as Sequence<u8>,
                            beg: truncate!(int!(0), u32),
                            end: truncate!(int!(0), u32)
                        })
                }

                /// ../mpl/libraries/src/JSON/Utils/Views.dfy(9,3)
                #[derive(PartialEq, Clone)]
                pub enum View_ {
                    View {
                        s: Sequence<u8>,
                        beg: u32,
                        end: u32
                    }
                }

                impl View_ {
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(19,5)
                    pub fn Length(self: &Arc<Self>) -> u32 {
                        self.end().clone() - self.beg().clone()
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(23,5)
                    pub fn Bytes(self: &Arc<Self>) -> Sequence<u8> {
                        self.s().slice(&int!(self.beg().clone()), &int!(self.end().clone()))
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(27,5)
                    pub fn OfBytes(bs: &Sequence<u8>) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View {
                        Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_::View {
                                s: bs.clone(),
                                beg: truncate!(int!(0), u32),
                                end: truncate!(bs.cardinality(), u32)
                            })
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(34,5)
                    pub fn OfString(s: &Sequence<DafnyCharUTF16>) -> Sequence<u8> {
                        {
                            let _initializer = {
                                    let s: Sequence<DafnyCharUTF16> = s.clone();
                                    {
                                        let mut s = s.clone();
                                        Arc::new(move |i: &DafnyInt| -> u8{
                                                s.get(i).0 as u8
                                            })
                                    }
                                };
                            integer_range(Zero::zero(), s.cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(53,5)
                    pub fn _Byte_q(self: &Arc<Self>, c: u8) -> bool {
                        let mut _hresult: bool = <bool as Default>::default();
                        _hresult = self.Length() == truncate!(int!(1), u32) && self.At(truncate!(int!(0), u32)) == c;
                        return _hresult;
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(61,5)
                    pub fn _Char_q(self: &Arc<Self>, c: &DafnyCharUTF16) -> bool {
                        self._Byte_q(c.clone().0 as u8)
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(72,5)
                    pub fn At(self: &Arc<Self>, idx: u32) -> u8 {
                        self.s().get(&int!((&(self.beg().clone() + idx)).clone()))
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(79,5)
                    pub fn Peek(self: &Arc<Self>) -> i16 {
                        if self._Empty_q() {
                            truncate!(int!(-1), i16)
                        } else {
                            self.At(truncate!(int!(0), u32)) as i16
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(87,5)
                    pub fn CopyTo(self: &Arc<Self>, dest: &Object<[u8]>, start: u32) -> () {
                        let mut _hi0: u32 = self.Length();
                        for idx in integer_range(truncate!(int!(0), u32), _hi0).map(Into::<u32>::into) {
                            {
                                let __idx0 = DafnyUsize::into_usize(start + idx);
                                ::dafny_runtime::md!(dest)[__idx0] = self.s().get(&int!((&(self.beg().clone() + idx)).clone()));
                            }
                        }
                        return ();
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(13,5)
                    pub fn Empty() -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View {
                        Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_::View {
                                s: seq![] as Sequence<u8>,
                                beg: truncate!(int!(0), u32),
                                end: truncate!(int!(0), u32)
                            })
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.dfy(16,5)
                    pub fn _Empty_q(self: &Arc<Self>) -> bool {
                        self.beg().clone() == self.end().clone()
                    }
                    /// Returns a borrow of the field s
                    pub fn s(&self) -> &Sequence<u8> {
                        match self {
                            View_::View{s, beg, end, } => s,
                        }
                    }
                    /// Returns a borrow of the field beg
                    pub fn beg(&self) -> &u32 {
                        match self {
                            View_::View{s, beg, end, } => beg,
                        }
                    }
                    /// Returns a borrow of the field end
                    pub fn end(&self) -> &u32 {
                        match self {
                            View_::View{s, beg, end, } => end,
                        }
                    }
                }

                impl Debug
                    for View_ {
                    fn fmt(&self, f: &mut Formatter) -> Result {
                        DafnyPrint::fmt_print(self, f, true)
                    }
                }

                impl DafnyPrint
                    for View_ {
                    fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                        match self {
                            View_::View{s, beg, end, } => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Views_Compile.Core_Compile.View__.View(")?;
                                DafnyPrint::fmt_print(s, _formatter, false)?;
                                write!(_formatter, ", ")?;
                                DafnyPrint::fmt_print(beg, _formatter, false)?;
                                write!(_formatter, ", ")?;
                                DafnyPrint::fmt_print(end, _formatter, false)?;
                                write!(_formatter, ")")?;
                                Ok(())
                            },
                        }
                    }
                }

                impl Eq
                    for View_ {}

                impl Hash
                    for View_ {
                    fn hash<_H: Hasher>(&self, _state: &mut _H) {
                        match self {
                            View_::View{s, beg, end, } => {
                                Hash::hash(s, _state);
                                Hash::hash(beg, _state);
                                Hash::hash(end, _state)
                            },
                        }
                    }
                }

                impl Default
                    for View_ {
                    fn default() -> View_ {
                        View_::View {
                            s: Default::default(),
                            beg: Default::default(),
                            end: Default::default()
                        }
                    }
                }

                impl AsRef<View_>
                    for View_ {
                    fn as_ref(&self) -> &Self {
                        self
                    }
                }
            }

            /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(7,1)
            pub mod _Writers_Compile {
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
                pub use ::dafny_runtime::_System::nat;
                pub use ::dafny_runtime::int;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain::Empty;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_;
                pub use ::dafny_runtime::Sequence;
                pub use ::dafny_runtime::seq;
                pub use ::dafny_runtime::Object;
                pub use ::std::fmt::Debug;
                pub use ::std::fmt::Formatter;
                pub use ::std::fmt::Result;
                pub use ::dafny_runtime::DafnyPrint;
                pub use ::std::cmp::Eq;
                pub use ::std::hash::Hash;
                pub use ::std::hash::Hasher;
                pub use ::std::default::Default;
                pub use ::std::convert::AsRef;
                pub use ::dafny_runtime::truncate;
                pub use ::std::marker::Sync;
                pub use ::std::marker::Send;
                pub use ::std::mem::MaybeUninit;
                pub use ::dafny_runtime::array;
                pub use ::dafny_runtime::DafnyUsize;

                /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(13,3)
                #[derive(PartialEq, Clone)]
                pub enum Chain {
                    Empty {},
                    Chain {
                        previous: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain>,
                        v: View
                    }
                }

                impl Chain {
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(17,5)
                    pub fn Length(self: &Arc<Self>) -> nat {
                        let mut _accumulator: nat = int!(0);
                        let mut _this = self.clone();
                        'TAIL_CALL_START: loop {
                            if matches!((&_this).as_ref(), Empty{ .. }) {
                                return int!(0) + _accumulator.clone();
                            } else {
                                _accumulator = int!(View_::Length(_this.v())) + _accumulator.clone();
                                let mut _in0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain> = _this.previous().clone();
                                _this = _in0.clone();
                                continue 'TAIL_CALL_START;
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(22,5)
                    pub fn Count(self: &Arc<Self>) -> nat {
                        let mut _accumulator: nat = int!(0);
                        let mut _this = self.clone();
                        'TAIL_CALL_START: loop {
                            if matches!((&_this).as_ref(), Empty{ .. }) {
                                return int!(0) + _accumulator.clone();
                            } else {
                                _accumulator = int!(1) + _accumulator.clone();
                                let mut _in0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain> = _this.previous().clone();
                                _this = _in0.clone();
                                continue 'TAIL_CALL_START;
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(27,5)
                    pub fn Bytes(self: &Arc<Self>) -> Sequence<u8> {
                        let mut _accumulator: Sequence<u8> = seq![] as Sequence<u8>;
                        let mut _this = self.clone();
                        'TAIL_CALL_START: loop {
                            if matches!((&_this).as_ref(), Empty{ .. }) {
                                return (seq![] as Sequence<u8>).concat(&_accumulator);
                            } else {
                                _accumulator = View_::Bytes(_this.v()).concat(&_accumulator);
                                let mut _in0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain> = _this.previous().clone();
                                _this = _in0.clone();
                                continue 'TAIL_CALL_START;
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(34,5)
                    pub fn Append(self: &Arc<Self>, _v_k: &View) -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain> {
                        if matches!(self.as_ref(), crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain::Chain{ .. }) && crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::_default::Adjacent(self.v(), _v_k) {
                            Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain::Chain {
                                    previous: self.previous().clone(),
                                    v: crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::_default::Merge(self.v(), _v_k)
                                })
                        } else {
                            Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain::Chain {
                                    previous: self.clone(),
                                    v: _v_k.clone()
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(43,5)
                    pub fn CopyTo(self: &Arc<Self>, dest: &Object<[u8]>, end: u32) -> () {
                        let mut _this = self.clone();
                        let mut _r0 = dest.clone();
                        let mut _r1 = end;
                        'TAIL_CALL_START: loop {
                            let dest = _r0;
                            let end = _r1;
                            if matches!((&_this).as_ref(), crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain::Chain{ .. }) {
                                let mut end: u32 = end - View_::Length(_this.v());
                                View_::CopyTo(_this.v(), &dest, end);
                                let mut _in0: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain> = _this.previous().clone();
                                let mut _in1: Object<[u8]> = dest.clone();
                                let mut _in2: u32 = end;
                                _this = _in0.clone();
                                _r0 = _in1.clone();
                                _r1 = _in2;
                                continue 'TAIL_CALL_START;
                            };
                            return ();
                        }
                    }
                    /// Gets the field previous for all enum members which have it
                    pub fn previous(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain> {
                        match self {
                            Chain::Empty{} => panic!("field does not exist on this variant"),
                            Chain::Chain{previous, v, } => previous,
                        }
                    }
                    /// Gets the field v for all enum members which have it
                    pub fn v(&self) -> &View {
                        match self {
                            Chain::Empty{} => panic!("field does not exist on this variant"),
                            Chain::Chain{previous, v, } => v,
                        }
                    }
                }

                impl Debug
                    for Chain {
                    fn fmt(&self, f: &mut Formatter) -> Result {
                        DafnyPrint::fmt_print(self, f, true)
                    }
                }

                impl DafnyPrint
                    for Chain {
                    fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                        match self {
                            Chain::Empty{} => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Views_Compile.Writers_Compile.Chain.Empty")?;
                                Ok(())
                            },
                            Chain::Chain{previous, v, } => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Views_Compile.Writers_Compile.Chain.Chain(")?;
                                DafnyPrint::fmt_print(previous, _formatter, false)?;
                                write!(_formatter, ", ")?;
                                DafnyPrint::fmt_print(v, _formatter, false)?;
                                write!(_formatter, ")")?;
                                Ok(())
                            },
                        }
                    }
                }

                impl Eq
                    for Chain {}

                impl Hash
                    for Chain {
                    fn hash<_H: Hasher>(&self, _state: &mut _H) {
                        match self {
                            Chain::Empty{} => {

                            },
                            Chain::Chain{previous, v, } => {
                                Hash::hash(previous, _state);
                                Hash::hash(v, _state)
                            },
                        }
                    }
                }

                impl Default
                    for Chain {
                    fn default() -> Chain {
                        Chain::Empty {}
                    }
                }

                impl AsRef<Chain>
                    for Chain {
                    fn as_ref(&self) -> &Self {
                        self
                    }
                }

                /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(57,3)
                pub type Writer = Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer_>;

                /// An element of Writer
                pub fn __init_Writer() -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer_> {
                    Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer_::Writer {
                            length: truncate!(int!(0), u32),
                            chain: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain::Empty {})
                        })
                }

                /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(58,3)
                #[derive(PartialEq, Clone)]
                pub enum Writer_ {
                    Writer {
                        length: u32,
                        chain: Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain>
                    }
                }

                impl Writer_ {
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(72,5)
                    pub fn Bytes(self: &Arc<Self>) -> Sequence<u8> {
                        self.chain().Bytes()
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(78,5)
                    pub fn SaturatedAddU32(a: u32, b: u32) -> u32 {
                        if !(crate::implementation_from_dafny::_BoundedInts_Compile::_default::UINT32_MAX() - b < a) {
                            a + b
                        } else {
                            crate::implementation_from_dafny::_BoundedInts_Compile::_default::UINT32_MAX()
                        }
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(83,5)
                    pub fn Append(self: &Arc<Self>, _v_k: &View) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer {
                        Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer_::Writer {
                                length: crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer_::SaturatedAddU32(self.length().clone(), View_::Length(_v_k)),
                                chain: self.chain().Append(_v_k)
                            })
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(92,5)
                    pub fn Then(self: &Arc<Self>, r#fn: &Arc<dyn ::std::ops::Fn(&crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer + Sync + Send>) -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer {
                        r#fn(self)
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(100,5)
                    pub fn CopyTo(self: &Arc<Self>, dest: &Object<[u8]>) -> () {
                        self.chain().CopyTo(dest, self.length().clone());
                        return ();
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(111,5)
                    pub fn ToArray(self: &Arc<Self>) -> Object<[u8]> {
                        let mut bs: Object<[u8]>;
                        let mut _nw0: Object<[MaybeUninit<u8>]> = array::placebos_usize_object::<u8>(DafnyUsize::into_usize(self.length().clone()));
                        bs = array::construct_object(_nw0.clone());
                        self.CopyTo(&bs);
                        return bs.clone();
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(60,5)
                    pub fn Empty() -> crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer {
                        Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer_::Writer {
                                length: truncate!(int!(0), u32),
                                chain: Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain::Empty {})
                            })
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(63,5)
                    pub fn _Unsaturated_q(self: &Arc<Self>) -> bool {
                        !(self.length().clone() == crate::implementation_from_dafny::_BoundedInts_Compile::_default::UINT32_MAX())
                    }
                    /// ../mpl/libraries/src/JSON/Utils/Views.Writers.dfy(62,5)
                    pub fn _Empty_q(self: &Arc<Self>) -> bool {
                        matches!(self.chain().as_ref(), Empty{ .. })
                    }
                    /// Returns a borrow of the field length
                    pub fn length(&self) -> &u32 {
                        match self {
                            Writer_::Writer{length, chain, } => length,
                        }
                    }
                    /// Returns a borrow of the field chain
                    pub fn chain(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain> {
                        match self {
                            Writer_::Writer{length, chain, } => chain,
                        }
                    }
                }

                impl Debug
                    for Writer_ {
                    fn fmt(&self, f: &mut Formatter) -> Result {
                        DafnyPrint::fmt_print(self, f, true)
                    }
                }

                impl DafnyPrint
                    for Writer_ {
                    fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                        match self {
                            Writer_::Writer{length, chain, } => {
                                write!(_formatter, "JSON_Compile.Utils_Compile.Views_Compile.Writers_Compile.Writer__.Writer(")?;
                                DafnyPrint::fmt_print(length, _formatter, false)?;
                                write!(_formatter, ", ")?;
                                DafnyPrint::fmt_print(chain, _formatter, false)?;
                                write!(_formatter, ")")?;
                                Ok(())
                            },
                        }
                    }
                }

                impl Eq
                    for Writer_ {}

                impl Hash
                    for Writer_ {
                    fn hash<_H: Hasher>(&self, _state: &mut _H) {
                        match self {
                            Writer_::Writer{length, chain, } => {
                                Hash::hash(length, _state);
                                Hash::hash(chain, _state)
                            },
                        }
                    }
                }

                impl Default
                    for Writer_ {
                    fn default() -> Writer_ {
                        Writer_::Writer {
                            length: Default::default(),
                            chain: Default::default()
                        }
                    }
                }

                impl AsRef<Writer_>
                    for Writer_ {
                    fn as_ref(&self) -> &Self {
                        self
                    }
                }
            }
        }
    }

    /// ../mpl/libraries/src/JSON/Values.dfy(3,1)
    pub mod _Values_Compile {
        pub use ::dafny_runtime::DafnyInt;
        pub use ::std::sync::Arc;
        pub use ::dafny_runtime::int;
        pub use ::std::fmt::Debug;
        pub use ::std::fmt::Formatter;
        pub use ::std::fmt::Result;
        pub use ::dafny_runtime::DafnyPrint;
        pub use ::std::cmp::Eq;
        pub use ::std::hash::Hash;
        pub use ::std::hash::Hasher;
        pub use ::std::default::Default;
        pub use ::std::convert::AsRef;
        pub use ::dafny_runtime::Sequence;
        pub use ::dafny_runtime::DafnyCharUTF16;

        pub struct _default {}

        impl _default {
            /// ../mpl/libraries/src/JSON/Values.dfy(7,3)
            pub fn Int(n: &DafnyInt) -> Arc<crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::Decimal> {
                Arc::new(crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::Decimal::Decimal {
                        n: n.clone(),
                        e10: int!(0)
                    })
            }
        }

        /// ../mpl/libraries/src/JSON/Values.dfy(4,3)
        #[derive(PartialEq, Clone)]
        pub enum Decimal {
            /// (n) * 10^(e10)
            Decimal {
                n: DafnyInt,
                e10: DafnyInt
            }
        }

        impl Decimal {
            /// Returns a borrow of the field n
            pub fn n(&self) -> &DafnyInt {
                match self {
                    Decimal::Decimal{n, e10, } => n,
                }
            }
            /// Returns a borrow of the field e10
            pub fn e10(&self) -> &DafnyInt {
                match self {
                    Decimal::Decimal{n, e10, } => e10,
                }
            }
        }

        impl Debug
            for Decimal {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl DafnyPrint
            for Decimal {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    Decimal::Decimal{n, e10, } => {
                        write!(_formatter, "JSON_Compile.Values_Compile.Decimal.Decimal(")?;
                        DafnyPrint::fmt_print(n, _formatter, false)?;
                        write!(_formatter, ", ")?;
                        DafnyPrint::fmt_print(e10, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl Eq
            for Decimal {}

        impl Hash
            for Decimal {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    Decimal::Decimal{n, e10, } => {
                        Hash::hash(n, _state);
                        Hash::hash(e10, _state)
                    },
                }
            }
        }

        impl Default
            for Decimal {
            fn default() -> Decimal {
                Decimal::Decimal {
                    n: Default::default(),
                    e10: Default::default()
                }
            }
        }

        impl AsRef<Decimal>
            for Decimal {
            fn as_ref(&self) -> &Self {
                self
            }
        }

        /// ../mpl/libraries/src/JSON/Values.dfy(11,3)
        #[derive(PartialEq, Clone)]
        pub enum JSON {
            Null {},
            Bool {
                b: bool
            },
            String {
                str: Sequence<DafnyCharUTF16>
            },
            Number {
                num: Arc<crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::Decimal>
            },
            /// Not a map to preserve order
            Object {
                obj: Sequence<(Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON>)>
            },
            Array {
                arr: Sequence<Arc<crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON>>
            }
        }

        impl JSON {
            /// Gets the field b for all enum members which have it
            pub fn b(&self) -> &bool {
                match self {
                    JSON::Null{} => panic!("field does not exist on this variant"),
                    JSON::Bool{b, } => b,
                    JSON::String{str, } => panic!("field does not exist on this variant"),
                    JSON::Number{num, } => panic!("field does not exist on this variant"),
                    JSON::Object{obj, } => panic!("field does not exist on this variant"),
                    JSON::Array{arr, } => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field str for all enum members which have it
            pub fn str(&self) -> &Sequence<DafnyCharUTF16> {
                match self {
                    JSON::Null{} => panic!("field does not exist on this variant"),
                    JSON::Bool{b, } => panic!("field does not exist on this variant"),
                    JSON::String{str, } => str,
                    JSON::Number{num, } => panic!("field does not exist on this variant"),
                    JSON::Object{obj, } => panic!("field does not exist on this variant"),
                    JSON::Array{arr, } => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field num for all enum members which have it
            pub fn num(&self) -> &Arc<crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::Decimal> {
                match self {
                    JSON::Null{} => panic!("field does not exist on this variant"),
                    JSON::Bool{b, } => panic!("field does not exist on this variant"),
                    JSON::String{str, } => panic!("field does not exist on this variant"),
                    JSON::Number{num, } => num,
                    JSON::Object{obj, } => panic!("field does not exist on this variant"),
                    JSON::Array{arr, } => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field obj for all enum members which have it
            pub fn obj(&self) -> &Sequence<(Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON>)> {
                match self {
                    JSON::Null{} => panic!("field does not exist on this variant"),
                    JSON::Bool{b, } => panic!("field does not exist on this variant"),
                    JSON::String{str, } => panic!("field does not exist on this variant"),
                    JSON::Number{num, } => panic!("field does not exist on this variant"),
                    JSON::Object{obj, } => obj,
                    JSON::Array{arr, } => panic!("field does not exist on this variant"),
                }
            }
            /// Gets the field arr for all enum members which have it
            pub fn arr(&self) -> &Sequence<Arc<crate::implementation_from_dafny::_JSON_Compile::_Values_Compile::JSON>> {
                match self {
                    JSON::Null{} => panic!("field does not exist on this variant"),
                    JSON::Bool{b, } => panic!("field does not exist on this variant"),
                    JSON::String{str, } => panic!("field does not exist on this variant"),
                    JSON::Number{num, } => panic!("field does not exist on this variant"),
                    JSON::Object{obj, } => panic!("field does not exist on this variant"),
                    JSON::Array{arr, } => arr,
                }
            }
        }

        impl Debug
            for JSON {
            fn fmt(&self, f: &mut Formatter) -> Result {
                DafnyPrint::fmt_print(self, f, true)
            }
        }

        impl DafnyPrint
            for JSON {
            fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
                match self {
                    JSON::Null{} => {
                        write!(_formatter, "JSON_Compile.Values_Compile.JSON.Null")?;
                        Ok(())
                    },
                    JSON::Bool{b, } => {
                        write!(_formatter, "JSON_Compile.Values_Compile.JSON.Bool(")?;
                        DafnyPrint::fmt_print(b, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    JSON::String{str, } => {
                        write!(_formatter, "JSON_Compile.Values_Compile.JSON.String(")?;
                        DafnyPrint::fmt_print(str, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    JSON::Number{num, } => {
                        write!(_formatter, "JSON_Compile.Values_Compile.JSON.Number(")?;
                        DafnyPrint::fmt_print(num, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    JSON::Object{obj, } => {
                        write!(_formatter, "JSON_Compile.Values_Compile.JSON.Object(")?;
                        DafnyPrint::fmt_print(obj, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                    JSON::Array{arr, } => {
                        write!(_formatter, "JSON_Compile.Values_Compile.JSON.Array(")?;
                        DafnyPrint::fmt_print(arr, _formatter, false)?;
                        write!(_formatter, ")")?;
                        Ok(())
                    },
                }
            }
        }

        impl Eq
            for JSON {}

        impl Hash
            for JSON {
            fn hash<_H: Hasher>(&self, _state: &mut _H) {
                match self {
                    JSON::Null{} => {

                    },
                    JSON::Bool{b, } => {
                        Hash::hash(b, _state)
                    },
                    JSON::String{str, } => {
                        Hash::hash(str, _state)
                    },
                    JSON::Number{num, } => {
                        Hash::hash(num, _state)
                    },
                    JSON::Object{obj, } => {
                        Hash::hash(obj, _state)
                    },
                    JSON::Array{arr, } => {
                        Hash::hash(arr, _state)
                    },
                }
            }
        }

        impl Default
            for JSON {
            fn default() -> JSON {
                JSON::Null {}
            }
        }

        impl AsRef<JSON>
            for JSON {
            fn as_ref(&self) -> &Self {
                self
            }
        }
    }

    pub mod _ZeroCopy_Compile {
        /// ../mpl/libraries/src/JSON/ZeroCopy/API.dfy(9,1)
        pub mod _API_Compile {
            pub use ::std::sync::Arc;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
            pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
            pub use ::dafny_runtime::Sequence;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::SerializationError;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer_;
            pub use ::dafny_runtime::Object;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;

            pub struct _default {}

            impl _default {
                /// ../mpl/libraries/src/JSON/ZeroCopy/API.dfy(19,3)
                pub fn Serialize(js: &Arc<Structural<Arc<Value>>>) -> Arc<Result<Sequence<u8>, Arc<SerializationError>>> {
                    Arc::new(Result::<Sequence<u8>, Arc<SerializationError>>::Success {
                            value: Writer_::Bytes(&crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Text(js))
                        })
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/API.dfy(25,3)
                pub fn SerializeAlloc(js: &Arc<Structural<Arc<Value>>>) -> Arc<Result<Object<[u8]>, Arc<SerializationError>>> {
                    let mut bs: Arc<Result<Object<[u8]>, Arc<SerializationError>>>;
                    let mut _out0: Arc<Result<Object<[u8]>, Arc<SerializationError>>>;
                    _out0 = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Serialize(js);
                    bs = _out0.clone();
                    return bs.clone();
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/API.dfy(32,3)
                pub fn SerializeInto(js: &Arc<Structural<Arc<Value>>>, bs: &Object<[u8]>) -> Arc<Result<u32, Arc<SerializationError>>> {
                    let mut len: Arc<Result<u32, Arc<SerializationError>>>;
                    let mut _out0: Arc<Result<u32, Arc<SerializationError>>>;
                    _out0 = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::SerializeTo(js, bs);
                    len = _out0.clone();
                    return len.clone();
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/API.dfy(42,3)
                pub fn Deserialize(bs: &Sequence<u8>) -> Arc<Result<Arc<Structural<Arc<Value>>>, Arc<DeserializationError>>> {
                    crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_API_Compile::_default::OfBytes(bs)
                }
            }
        }

        /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(10,1)
        pub mod _Deserializer_Compile {
            /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(457,3)
            pub mod _API_Compile {
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError::EOF;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError::ExpectingByte;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError::ExpectingAnyByte;
                pub use ::dafny_runtime::Sequence;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::Parser_;
                pub use ::std::marker::Sync;
                pub use ::std::marker::Send;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(468,5)
                    pub fn LiftCursorError(err: &Arc<CursorError<Arc<DeserializationError>>>) -> Arc<DeserializationError> {
                        let mut _source0: Arc<CursorError<Arc<DeserializationError>>> = err.clone();
                        if matches!((&_source0).as_ref(), EOF{ .. }) {
                            Arc::new(DeserializationError::ReachedEOF {})
                        } else {
                            if matches!((&_source0).as_ref(), ExpectingByte{ .. }) {
                                let mut ___mcc_h0: u8 = _source0.expected().clone();
                                let mut ___mcc_h1: i16 = _source0.b().clone();
                                let mut b: i16 = ___mcc_h1;
                                let mut expected: u8 = ___mcc_h0;
                                Arc::new(DeserializationError::ExpectingByte {
                                        expected: expected,
                                        b: b
                                    })
                            } else {
                                if matches!((&_source0).as_ref(), ExpectingAnyByte{ .. }) {
                                    let mut ___mcc_h2: Sequence<u8> = _source0.expected_sq().clone();
                                    let mut ___mcc_h3: i16 = _source0.b().clone();
                                    let mut b: i16 = ___mcc_h3;
                                    let mut expected_sq: Sequence<u8> = ___mcc_h2.clone();
                                    Arc::new(DeserializationError::ExpectingAnyByte {
                                            expected_sq: expected_sq.clone(),
                                            b: b
                                        })
                                } else {
                                    let mut ___mcc_h4: Arc<DeserializationError> = _source0.err().clone();
                                    let mut err: Arc<DeserializationError> = ___mcc_h4.clone();
                                    err.clone()
                                }
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(476,5)
                    pub fn JSON(cs: &FreshCursor) -> Arc<Result<Arc<Split<Arc<Structural<Arc<Value>>>>>, Arc<DeserializationError>>> {
                        crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::Structural::<Arc<Value>>(cs, &Arc::new(Parser_::<Arc<Value>, Arc<DeserializationError>>::Parser {
                                    r#fn: Arc::new(move |x0: &FreshCursor| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Values_Compile::_default::Value(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>
                                })).MapFailure::<Arc<DeserializationError>>(&(Arc::new(move |x0: &Arc<CursorError<Arc<DeserializationError>>>| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_API_Compile::_default::LiftCursorError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>))
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(482,5)
                    pub fn Text(v: &View) -> Arc<Result<Arc<Structural<Arc<Value>>>, Arc<DeserializationError>>> {
                        let mut valueOrError0: Arc<Result<Arc<Split<Arc<Structural<Arc<Value>>>>>, Arc<DeserializationError>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_API_Compile::_default::JSON(&Cursor_::OfView(v));
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Structural<Arc<Value>>>>()
                        } else {
                            let mut __let_tmp_rhs0: Arc<Split<Arc<Structural<Arc<Value>>>>> = valueOrError0.Extract();
                            let mut text: Arc<Structural<Arc<Value>>> = __let_tmp_rhs0.t().clone();
                            let mut cs: FreshCursor = __let_tmp_rhs0.cs().clone();
                            let mut valueOrError1: Arc<Outcome<Arc<DeserializationError>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<DeserializationError>>(cs._EOF_q(), &Arc::new(DeserializationError::ExpectingEOF {}));
                            if valueOrError1.IsFailure() {
                                valueOrError1.PropagateFailure::<Arc<Structural<Arc<Value>>>>()
                            } else {
                                Arc::new(Result::<Arc<Structural<Arc<Value>>>, Arc<DeserializationError>>::Success {
                                        value: text.clone()
                                    })
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(493,5)
                    pub fn OfBytes(bs: &Sequence<u8>) -> Arc<Result<Arc<Structural<Arc<Value>>>, Arc<DeserializationError>>> {
                        let mut valueOrError0: Arc<Outcome<Arc<DeserializationError>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<DeserializationError>>(bs.cardinality() < crate::implementation_from_dafny::_BoundedInts_Compile::_default::TWO_TO_THE_32(), &Arc::new(DeserializationError::IntOverflow {}));
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Structural<Arc<Value>>>>()
                        } else {
                            crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_API_Compile::_default::Text(&View_::OfBytes(bs))
                        }
                    }
                }
            }

            /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(826,3)
            pub mod _ArrayParams_Compile {
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
                pub use ::dafny_runtime::Sequence;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
                pub use crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::ValueParser;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
                pub use ::dafny_runtime::DafnyCharUTF16;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(835,5)
                    pub fn ElementSpec(t: &Arc<Value>) -> Sequence<u8> {
                        crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::Value(t)
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(839,5)
                    pub fn Element(cs: &FreshCursor, json: &ValueParser) -> Arc<Result<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        json.r#fn()(cs)
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(832,5)
                    pub fn OPEN() -> u8 {
                        DafnyCharUTF16(91 as u16).0 as u8
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(833,5)
                    pub fn CLOSE() -> u8 {
                        DafnyCharUTF16(93 as u16).0 as u8
                    }
                }
            }

            /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(845,3)
            pub mod _Arrays_Compile {
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
                pub use crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::ValueParser;
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbracket;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbracket;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
                pub use ::dafny_runtime::Sequence;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Suffixed;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe;
                pub use ::dafny_runtime::seq;
                pub use crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::jopt;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_;
                pub use ::dafny_runtime::truncate;
                pub use ::dafny_runtime::int;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::Parser_;
                pub use ::std::marker::Sync;
                pub use ::std::marker::Send;
                pub use ::dafny_runtime::DafnyCharUTF16;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(863,5)
                    pub fn Array(cs: &FreshCursor, json: &ValueParser) -> Arc<Result<Arc<Split<Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::Bracketed(cs, json);
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>>()
                        } else {
                            let mut sp: Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>> = valueOrError0.Extract();
                            Arc::new(Result::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: sp.clone()
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(146,5)
                    pub fn Open(cs: &FreshCursor) -> Arc<Result<Arc<Split<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>> = Cursor_::AssertByte::<Arc<DeserializationError>>(cs, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ArrayParams_Compile::_default::OPEN());
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<View>>>()
                        } else {
                            let mut cs: Cursor = valueOrError0.Extract();
                            Arc::new(Result::<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Cursor_::Split(&cs)
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(154,5)
                    pub fn Close(cs: &FreshCursor) -> Arc<Result<Arc<Split<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>> = Cursor_::AssertByte::<Arc<DeserializationError>>(cs, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ArrayParams_Compile::_default::CLOSE());
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<View>>>()
                        } else {
                            let mut cs: Cursor = valueOrError0.Extract();
                            Arc::new(Result::<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Cursor_::Split(&cs)
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(162,5)
                    pub fn BracketedFromParts(open: &Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen>>>>, elems: &Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>>, close: &Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>) -> Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>> {
                        let mut sp: Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>> = Arc::new(Split::<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>::SP {
                                    t: Arc::new(Bracketed::<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>::Bracketed {
                                                l: open.t().clone(),
                                                data: elems.t().clone(),
                                                r: close.t().clone()
                                            }),
                                    cs: close.cs().clone()
                                });
                        sp.clone()
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(191,5)
                    pub fn AppendWithSuffix(elems: &Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>>, elem: &Arc<Split<Arc<Value>>>, sep: &Arc<Split<Arc<Structural<jcomma>>>>) -> Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>> {
                        let mut suffixed: Arc<Suffixed<Arc<Value>, jcomma>> = Arc::new(Suffixed::<Arc<Value>, jcomma>::Suffixed {
                                    t: elem.t().clone(),
                                    suffix: Arc::new(Maybe::<Arc<Structural<jcomma>>>::NonEmpty {
                                                t: sep.t().clone()
                                            })
                                });
                        let mut _elems_k: Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>> = Arc::new(Split::<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>::SP {
                                    t: elems.t().concat(&seq![suffixed.clone()]),
                                    cs: sep.cs().clone()
                                });
                        _elems_k.clone()
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(245,5)
                    pub fn AppendLast(elems: &Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>>, elem: &Arc<Split<Arc<Value>>>, sep: &Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>) -> Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>> {
                        let mut suffixed: Arc<Suffixed<Arc<Value>, jcomma>> = Arc::new(Suffixed::<Arc<Value>, jcomma>::Suffixed {
                                    t: elem.t().clone(),
                                    suffix: Arc::new(Maybe::<Arc<Structural<jcomma>>>::Empty {})
                                });
                        let mut _elems_k: Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>> = Arc::new(Split::<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>::SP {
                                    t: elems.t().concat(&seq![suffixed.clone()]),
                                    cs: elem.cs().clone()
                                });
                        _elems_k.clone()
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(298,5)
                    pub fn Elements(json: &ValueParser, open: &Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen>>>>, elems: &Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>>) -> Arc<Result<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut _r0 = json.clone();
                        let mut _r1 = open.clone();
                        let mut _r2 = elems.clone();
                        'TAIL_CALL_START: loop {
                            let json = _r0;
                            let open = _r1;
                            let elems = _r2;
                            let mut valueOrError0: Arc<Result<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ArrayParams_Compile::_default::Element(elems.cs(), &json);
                            if valueOrError0.IsFailure() {
                                return valueOrError0.PropagateFailure::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>>();
                            } else {
                                let mut elem: Arc<Split<Arc<Value>>> = valueOrError0.Extract();
                                if elem.cs()._EOF_q() {
                                    return Arc::new(Result::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Failure {
                                                error: Arc::new(CursorError::<Arc<DeserializationError>>::EOF {})
                                            });
                                } else {
                                    let mut sep: Arc<Split<Arc<Structural<jopt>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::TryStructural(elem.cs());
                                    let mut s0: i16 = View_::Peek(sep.t().t());
                                    if s0 == crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::SEPARATOR() as i16 && View_::Length(sep.t().t()) == truncate!(int!(1), u32) {
                                        let mut sep: Arc<Split<Arc<Structural<jcomma>>>> = sep.clone();
                                        let mut elems: Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::AppendWithSuffix(&elems, &elem, &sep);
                                        let mut _in0: ValueParser = json.clone();
                                        let mut _in1: Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen>>>> = open.clone();
                                        let mut _in2: Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>> = elems.clone();
                                        _r0 = _in0.clone();
                                        _r1 = _in1.clone();
                                        _r2 = _in2.clone();
                                        continue 'TAIL_CALL_START;
                                    } else {
                                        if s0 == crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ArrayParams_Compile::_default::CLOSE() as i16 && View_::Length(sep.t().t()) == truncate!(int!(1), u32) {
                                            let mut sep: Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>> = sep.clone();
                                            let mut _elems_k: Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::AppendLast(&elems, &elem, &sep);
                                            let mut bracketed: Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::BracketedFromParts(&open, &_elems_k, &sep);
                                            return Arc::new(Result::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                                        value: bracketed.clone()
                                                    });
                                        } else {
                                            let mut separator: u8 = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::SEPARATOR();
                                            let mut pr: Arc<Result<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = Arc::new(Result::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Failure {
                                                        error: Arc::new(CursorError::<Arc<DeserializationError>>::ExpectingAnyByte {
                                                                    expected_sq: seq![crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ArrayParams_Compile::_default::CLOSE(), separator],
                                                                    b: s0
                                                                })
                                                    });
                                            return pr.clone();
                                        }
                                    }
                                }
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(419,5)
                    pub fn Bracketed(cs: &FreshCursor, json: &ValueParser) -> Arc<Result<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::Structural::<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen>(cs, &Arc::new(Parser_::<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<DeserializationError>>::Parser {
                                        r#fn: Arc::new(move |x0: &FreshCursor| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::Open(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>
                                    }));
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>>()
                        } else {
                            let mut open: Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen>>>> = valueOrError0.Extract();
                            let mut elems: Arc<Split<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>> = Arc::new(Split::<Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>>::SP {
                                        t: seq![] as Sequence<Arc<Suffixed<Arc<Value>, jcomma>>>,
                                        cs: open.cs().clone()
                                    });
                            if Cursor_::Peek(open.cs()) == crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ArrayParams_Compile::_default::CLOSE() as i16 {
                                let mut p: Arc<Parser_<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose, Arc<DeserializationError>>> = Arc::new(Parser_::<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose, Arc<DeserializationError>>::Parser {
                                            r#fn: Arc::new(move |x0: &FreshCursor| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::Close(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>
                                        });
                                let mut valueOrError1: Arc<Result<Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::Structural::<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>(open.cs(), &p);
                                if valueOrError1.IsFailure() {
                                    valueOrError1.PropagateFailure::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>>()
                                } else {
                                    let mut close: Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>> = valueOrError1.Extract();
                                    Arc::new(Result::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen, Arc<Value>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                            value: crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::BracketedFromParts(&open, &elems, &close)
                                        })
                                }
                            } else {
                                crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::Elements(json, &open, &elems)
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(132,5)
                    pub fn SpecViewOpen() -> Arc<dyn ::std::ops::Fn(&crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jopen) -> Sequence<u8> + Sync + Send> {
                        Arc::new(move |x0: &View| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::SpecView()(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(131,5)
                    pub fn SpecViewClose() -> Arc<dyn ::std::ops::Fn(&crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::jclose) -> Sequence<u8> + Sync + Send> {
                        Arc::new(move |x0: &View| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::SpecView()(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(124,5)
                    pub fn SEPARATOR() -> u8 {
                        DafnyCharUTF16(44 as u16).0 as u8
                    }
                }

                /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(126,5)
                pub type jopen = Arc<View_>;

                /// An element of jopen
                pub fn __init_jopen() -> Arc<View_> {
                    View_::OfBytes(&seq![crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ArrayParams_Compile::_default::OPEN()])
                }

                /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(127,5)
                pub type jclose = Arc<View_>;

                /// An element of jclose
                pub fn __init_jclose() -> Arc<View_> {
                    View_::OfBytes(&seq![crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ArrayParams_Compile::_default::CLOSE()])
                }
            }

            /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(639,3)
            pub mod _Constants_Compile {
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
                pub use ::dafny_runtime::Sequence;
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_;
                pub use ::dafny_runtime::truncate;
                pub use ::dafny_runtime::int;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(647,5)
                    pub fn Constant(cs: &FreshCursor, expected: &Sequence<u8>) -> Arc<Result<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>> = Cursor_::AssertBytes::<Arc<DeserializationError>>(cs, expected, truncate!(int!(0), u32));
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<View>>>()
                        } else {
                            let mut cs: Cursor = valueOrError0.Extract();
                            Arc::new(Result::<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Cursor_::Split(&cs)
                                })
                        }
                    }
                }
            }

            /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(11,3)
            pub mod _Core_Compile {
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jchar;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jblanks;
                pub use ::dafny_runtime::MaybePlacebo;
                pub use ::dafny_runtime::int;
                pub use ::dafny_runtime::truncate;
                pub use ::dafny_runtime::DafnyType;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::Parser;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
                pub use ::dafny_runtime::Sequence;
                pub use ::std::marker::Sync;
                pub use ::std::marker::Send;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_;
                pub use ::dafny_runtime::seq;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::SubParser_;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(33,5)
                    pub fn Get(cs: &FreshCursor, err: &Arc<DeserializationError>) -> Arc<Result<Arc<Split<jchar>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>> = Cursor_::Get::<Arc<DeserializationError>>(cs, err);
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<View>>>()
                        } else {
                            let mut cs: Cursor = valueOrError0.Extract();
                            Arc::new(Result::<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Cursor_::Split(&cs)
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(40,5)
                    pub fn WS(cs: &FreshCursor) -> Arc<Split<jblanks>> {
                        let mut sp = MaybePlacebo::<Arc<Split<jblanks>>>::new();
                        let mut _point_k: u32 = cs.point().clone();
                        let mut end: u32 = cs.end().clone();
                        while _point_k < end && crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::_Blank_q(cs.s().get(&int!((&_point_k).clone()))) {
                            _point_k = _point_k + truncate!(int!(1), u32);
                        };
                        sp = MaybePlacebo::from(Arc::new(Cursor_::Cursor {
                                        s: cs.s().clone(),
                                        beg: cs.beg().clone(),
                                        point: _point_k,
                                        end: cs.end().clone()
                                    }).Split());
                        return sp.read();
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(60,5)
                    pub fn Structural<_T: DafnyType>(cs: &FreshCursor, parser: &Parser<_T, Arc<DeserializationError>>) -> Arc<Result<Arc<Split<Arc<Structural<_T>>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut __let_tmp_rhs0: Arc<Split<jblanks>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::WS(cs);
                        let mut before: jblanks = __let_tmp_rhs0.t().clone();
                        let mut cs: FreshCursor = __let_tmp_rhs0.cs().clone();
                        let mut valueOrError0: Arc<Result<Arc<Split<_T>>, Arc<CursorError<Arc<DeserializationError>>>>> = parser.r#fn()(&cs);
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<Arc<Structural<_T>>>>>()
                        } else {
                            let mut __let_tmp_rhs1: Arc<Split<_T>> = valueOrError0.Extract();
                            let mut val: _T = __let_tmp_rhs1.t().clone();
                            let mut cs: FreshCursor = __let_tmp_rhs1.cs().clone();
                            let mut __let_tmp_rhs2: Arc<Split<jblanks>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::WS(&cs);
                            let mut after: jblanks = __let_tmp_rhs2.t().clone();
                            let mut cs: FreshCursor = __let_tmp_rhs2.cs().clone();
                            Arc::new(Result::<Arc<Split<Arc<Structural<_T>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Arc::new(Split::<Arc<Structural<_T>>>::SP {
                                                t: Arc::new(Structural::<_T>::Structural {
                                                            before: before.clone(),
                                                            t: val.clone(),
                                                            after: after.clone()
                                                        }),
                                                cs: cs.clone()
                                            })
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(73,5)
                    pub fn TryStructural(cs: &FreshCursor) -> Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::jopt>>>> {
                        let mut __let_tmp_rhs0: Arc<Split<jblanks>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::WS(cs);
                        let mut before: jblanks = __let_tmp_rhs0.t().clone();
                        let mut cs: FreshCursor = __let_tmp_rhs0.cs().clone();
                        let mut __let_tmp_rhs1: Arc<Split<View>> = Cursor_::Split(&Cursor_::SkipByte(&cs));
                        let mut val: View = __let_tmp_rhs1.t().clone();
                        let mut cs: FreshCursor = __let_tmp_rhs1.cs().clone();
                        let mut __let_tmp_rhs2: Arc<Split<jblanks>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::WS(&cs);
                        let mut after: jblanks = __let_tmp_rhs2.t().clone();
                        let mut cs: FreshCursor = __let_tmp_rhs2.cs().clone();
                        Arc::new(Split::<Arc<Structural<View>>>::SP {
                                t: Arc::new(Structural::<View>::Structural {
                                            before: before.clone(),
                                            t: val.clone(),
                                            after: after.clone()
                                        }),
                                cs: cs.clone()
                            })
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(31,5)
                    pub fn SpecView() -> Arc<dyn ::std::ops::Fn(&View) -> Sequence<u8> + Sync + Send> {
                        {
                            Arc::new(move |v: &View| -> Sequence<u8>{
                                    crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::View(v)
                                })
                        }
                    }
                }

                /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(71,5)
                pub type jopt = Arc<View_>;

                /// An element of jopt
                pub fn __init_jopt() -> Arc<View_> {
                    View_::OfBytes(&(seq![] as Sequence<u8>))
                }

                /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(87,5)
                pub type ValueParser = Arc<SubParser_<Arc<Value>, Arc<DeserializationError>>>;
            }

            /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(709,3)
            pub mod _Numbers_Compile {
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jdigits;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_;
                pub use ::std::marker::Sync;
                pub use ::std::marker::Send;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnum;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jint;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jminus;
                pub use ::dafny_runtime::DafnyCharUTF16;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jsign;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jexp;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jfrac;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnumber;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(717,5)
                    pub fn Digits(cs: &FreshCursor) -> Arc<Split<jdigits>> {
                        Cursor_::Split(&Cursor_::SkipWhile(cs, &(Arc::new(move |x0: &u8| crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::_Digit_q(x0.clone())) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>)))
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(723,5)
                    pub fn NonEmptyDigits(cs: &FreshCursor) -> Arc<Result<Arc<Split<jnum>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut sp: Arc<Split<jdigits>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::Digits(cs);
                        let mut valueOrError0: Arc<Outcome<Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<CursorError<Arc<DeserializationError>>>>(!sp.t()._Empty_q(), &Arc::new(CursorError::<Arc<DeserializationError>>::OtherError {
                                        err: Arc::new(DeserializationError::EmptyNumber {})
                                    }));
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<jdigits>>>()
                        } else {
                            Arc::new(Result::<Arc<Split<jdigits>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: sp.clone()
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(731,5)
                    pub fn NonZeroInt(cs: &FreshCursor) -> Arc<Result<Arc<Split<jint>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::NonEmptyDigits(cs)
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(738,5)
                    pub fn OptionalMinus(cs: &FreshCursor) -> Arc<Split<jminus>> {
                        Cursor_::Split(&Cursor_::SkipIf(cs, &({
                                    Arc::new(move |c: &u8| -> bool{
                                            c.clone() == DafnyCharUTF16(45 as u16).0 as u8
                                        })
                                })))
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(744,5)
                    pub fn OptionalSign(cs: &FreshCursor) -> Arc<Split<jsign>> {
                        Cursor_::Split(&Cursor_::SkipIf(cs, &({
                                    Arc::new(move |c: &u8| -> bool{
                                            c.clone() == DafnyCharUTF16(45 as u16).0 as u8 || c.clone() == DafnyCharUTF16(43 as u16).0 as u8
                                        })
                                })))
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(750,5)
                    pub fn TrimmedInt(cs: &FreshCursor) -> Arc<Result<Arc<Split<jint>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut sp: Arc<Split<View>> = Cursor_::Split(&Cursor_::SkipIf(cs, &({
                                        Arc::new(move |c: &u8| -> bool{
                                                c.clone() == DafnyCharUTF16(48 as u16).0 as u8
                                            })
                                    })));
                        if sp.t()._Empty_q() {
                            crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::NonZeroInt(sp.cs())
                        } else {
                            Arc::new(Result::<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: sp.clone()
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(758,5)
                    pub fn Exp(cs: &FreshCursor) -> Arc<Result<Arc<Split<Arc<Maybe<Arc<jexp>>>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut __let_tmp_rhs0: Arc<Split<View>> = Cursor_::Split(&Cursor_::SkipIf(cs, &({
                                        Arc::new(move |c: &u8| -> bool{
                                                c.clone() == DafnyCharUTF16(101 as u16).0 as u8 || c.clone() == DafnyCharUTF16(69 as u16).0 as u8
                                            })
                                    })));
                        let mut e: View = __let_tmp_rhs0.t().clone();
                        let mut cs: FreshCursor = __let_tmp_rhs0.cs().clone();
                        if e._Empty_q() {
                            Arc::new(Result::<Arc<Split<Arc<Maybe<Arc<jexp>>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Arc::new(Split::<Arc<Maybe<Arc<jexp>>>>::SP {
                                                t: Arc::new(Maybe::<Arc<jexp>>::Empty {}),
                                                cs: cs.clone()
                                            })
                                })
                        } else {
                            let mut __let_tmp_rhs1: Arc<Split<jsign>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::OptionalSign(&cs);
                            let mut sign: jsign = __let_tmp_rhs1.t().clone();
                            let mut cs: FreshCursor = __let_tmp_rhs1.cs().clone();
                            let mut valueOrError0: Arc<Result<Arc<Split<jnum>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::NonEmptyDigits(&cs);
                            if valueOrError0.IsFailure() {
                                valueOrError0.PropagateFailure::<Arc<Split<Arc<Maybe<Arc<jexp>>>>>>()
                            } else {
                                let mut __let_tmp_rhs2: Arc<Split<jnum>> = valueOrError0.Extract();
                                let mut num: jnum = __let_tmp_rhs2.t().clone();
                                let mut cs: FreshCursor = __let_tmp_rhs2.cs().clone();
                                Arc::new(Result::<Arc<Split<Arc<Maybe<Arc<jexp>>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                        value: Arc::new(Split::<Arc<Maybe<Arc<jexp>>>>::SP {
                                                    t: Arc::new(Maybe::<Arc<jexp>>::NonEmpty {
                                                                t: Arc::new(jexp::JExp {
                                                                            e: e.clone(),
                                                                            sign: sign.clone(),
                                                                            num: num.clone()
                                                                        })
                                                            }),
                                                    cs: cs.clone()
                                                })
                                    })
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(772,5)
                    pub fn Frac(cs: &FreshCursor) -> Arc<Result<Arc<Split<Arc<Maybe<Arc<jfrac>>>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut __let_tmp_rhs0: Arc<Split<View>> = Cursor_::Split(&Cursor_::SkipIf(cs, &({
                                        Arc::new(move |c: &u8| -> bool{
                                                c.clone() == DafnyCharUTF16(46 as u16).0 as u8
                                            })
                                    })));
                        let mut period: View = __let_tmp_rhs0.t().clone();
                        let mut cs: FreshCursor = __let_tmp_rhs0.cs().clone();
                        if period._Empty_q() {
                            Arc::new(Result::<Arc<Split<Arc<Maybe<Arc<jfrac>>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Arc::new(Split::<Arc<Maybe<Arc<jfrac>>>>::SP {
                                                t: Arc::new(Maybe::<Arc<jfrac>>::Empty {}),
                                                cs: cs.clone()
                                            })
                                })
                        } else {
                            let mut valueOrError0: Arc<Result<Arc<Split<jnum>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::NonEmptyDigits(&cs);
                            if valueOrError0.IsFailure() {
                                valueOrError0.PropagateFailure::<Arc<Split<Arc<Maybe<Arc<jfrac>>>>>>()
                            } else {
                                let mut __let_tmp_rhs1: Arc<Split<jnum>> = valueOrError0.Extract();
                                let mut num: jnum = __let_tmp_rhs1.t().clone();
                                let mut cs: FreshCursor = __let_tmp_rhs1.cs().clone();
                                Arc::new(Result::<Arc<Split<Arc<Maybe<Arc<jfrac>>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                        value: Arc::new(Split::<Arc<Maybe<Arc<jfrac>>>>::SP {
                                                    t: Arc::new(Maybe::<Arc<jfrac>>::NonEmpty {
                                                                t: Arc::new(jfrac::JFrac {
                                                                            period: period.clone(),
                                                                            num: num.clone()
                                                                        })
                                                            }),
                                                    cs: cs.clone()
                                                })
                                    })
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(784,5)
                    pub fn NumberFromParts(minus: &Arc<Split<jminus>>, num: &Arc<Split<jint>>, frac: &Arc<Split<Arc<Maybe<Arc<jfrac>>>>>, exp: &Arc<Split<Arc<Maybe<Arc<jexp>>>>>) -> Arc<Split<Arc<jnumber>>> {
                        let mut sp: Arc<Split<Arc<jnumber>>> = Arc::new(Split::<Arc<jnumber>>::SP {
                                    t: Arc::new(jnumber::JNumber {
                                                minus: minus.t().clone(),
                                                num: num.t().clone(),
                                                frac: frac.t().clone(),
                                                exp: exp.t().clone()
                                            }),
                                    cs: exp.cs().clone()
                                });
                        sp.clone()
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(815,5)
                    pub fn Number(cs: &FreshCursor) -> Arc<Result<Arc<Split<Arc<jnumber>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut minus: Arc<Split<jminus>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::OptionalMinus(cs);
                        let mut valueOrError0: Arc<Result<Arc<Split<jint>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::TrimmedInt(minus.cs());
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<Arc<jnumber>>>>()
                        } else {
                            let mut num: Arc<Split<jint>> = valueOrError0.Extract();
                            let mut valueOrError1: Arc<Result<Arc<Split<Arc<Maybe<Arc<jfrac>>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::Frac(num.cs());
                            if valueOrError1.IsFailure() {
                                valueOrError1.PropagateFailure::<Arc<Split<Arc<jnumber>>>>()
                            } else {
                                let mut frac: Arc<Split<Arc<Maybe<Arc<jfrac>>>>> = valueOrError1.Extract();
                                let mut valueOrError2: Arc<Result<Arc<Split<Arc<Maybe<Arc<jexp>>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::Exp(frac.cs());
                                if valueOrError2.IsFailure() {
                                    valueOrError2.PropagateFailure::<Arc<Split<Arc<jnumber>>>>()
                                } else {
                                    let mut exp: Arc<Split<Arc<Maybe<Arc<jexp>>>>> = valueOrError2.Extract();
                                    Arc::new(Result::<Arc<Split<Arc<jnumber>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                            value: crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::NumberFromParts(&minus, &num, &frac, &exp)
                                        })
                                }
                            }
                        }
                    }
                }
            }

            /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(875,3)
            pub mod _ObjectParams_Compile {
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcolon;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_;
                pub use ::dafny_runtime::DafnyCharUTF16;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jKeyValue;
                pub use ::dafny_runtime::Sequence;
                pub use crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::ValueParser;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::Parser_;
                pub use ::std::marker::Sync;
                pub use ::std::marker::Send;

                pub struct _default {}

                impl _default {
                    /// DISCUSS: Why can't I make this opaque?
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(884,5)
                    pub fn Colon(cs: &FreshCursor) -> Arc<Result<Arc<Split<jcolon>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>> = Cursor_::AssertChar::<Arc<DeserializationError>>(cs, &DafnyCharUTF16(58 as u16));
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<View>>>()
                        } else {
                            let mut cs: Cursor = valueOrError0.Extract();
                            Arc::new(Result::<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Cursor_::Split(&cs)
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(891,5)
                    pub fn KeyValueFromParts(k: &Arc<Split<Arc<jstring>>>, colon: &Arc<Split<Arc<Structural<jcolon>>>>, v: &Arc<Split<Arc<Value>>>) -> Arc<Split<Arc<jKeyValue>>> {
                        let mut sp: Arc<Split<Arc<jKeyValue>>> = Arc::new(Split::<Arc<jKeyValue>>::SP {
                                    t: Arc::new(jKeyValue::KeyValue {
                                                k: k.t().clone(),
                                                colon: colon.t().clone(),
                                                v: v.t().clone()
                                            }),
                                    cs: v.cs().clone()
                                });
                        sp.clone()
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(913,5)
                    pub fn ElementSpec(t: &Arc<jKeyValue>) -> Sequence<u8> {
                        crate::implementation_from_dafny::_JSON_Compile::_ConcreteSyntax_Compile::_Spec_Compile::_default::KeyValue(t)
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(917,5)
                    pub fn Element(cs: &FreshCursor, json: &ValueParser) -> Arc<Result<Arc<Split<Arc<jKeyValue>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Arc<Split<Arc<jstring>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Strings_Compile::_default::String(cs);
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<Arc<jKeyValue>>>>()
                        } else {
                            let mut k: Arc<Split<Arc<jstring>>> = valueOrError0.Extract();
                            let mut p: Arc<Parser_<jcolon, Arc<DeserializationError>>> = Arc::new(Parser_::<jcolon, Arc<DeserializationError>>::Parser {
                                        r#fn: Arc::new(move |x0: &FreshCursor| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ObjectParams_Compile::_default::Colon(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>
                                    });
                            let mut valueOrError1: Arc<Result<Arc<Split<Arc<Structural<jcolon>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::Structural::<jcolon>(k.cs(), &p);
                            if valueOrError1.IsFailure() {
                                valueOrError1.PropagateFailure::<Arc<Split<Arc<jKeyValue>>>>()
                            } else {
                                let mut colon: Arc<Split<Arc<Structural<jcolon>>>> = valueOrError1.Extract();
                                let mut valueOrError2: Arc<Result<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>> = json.r#fn()(colon.cs());
                                if valueOrError2.IsFailure() {
                                    valueOrError2.PropagateFailure::<Arc<Split<Arc<jKeyValue>>>>()
                                } else {
                                    let mut v: Arc<Split<Arc<Value>>> = valueOrError2.Extract();
                                    let mut kv: Arc<Split<Arc<jKeyValue>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ObjectParams_Compile::_default::KeyValueFromParts(&k, &colon, &v);
                                    Arc::new(Result::<Arc<Split<Arc<jKeyValue>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                            value: kv.clone()
                                        })
                                }
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(881,5)
                    pub fn OPEN() -> u8 {
                        DafnyCharUTF16(123 as u16).0 as u8
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(882,5)
                    pub fn CLOSE() -> u8 {
                        DafnyCharUTF16(125 as u16).0 as u8
                    }
                }
            }

            /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(960,3)
            pub mod _Objects_Compile {
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
                pub use crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::ValueParser;
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbrace;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jKeyValue;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbrace;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
                pub use ::dafny_runtime::Sequence;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Suffixed;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe;
                pub use ::dafny_runtime::seq;
                pub use crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::jopt;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View_;
                pub use ::dafny_runtime::truncate;
                pub use ::dafny_runtime::int;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::Parser_;
                pub use ::std::marker::Sync;
                pub use ::std::marker::Send;
                pub use ::dafny_runtime::DafnyCharUTF16;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(980,5)
                    pub fn Object(cs: &FreshCursor, json: &ValueParser) -> Arc<Result<Arc<Split<Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::Bracketed(cs, json);
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>>()
                        } else {
                            let mut sp: Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>> = valueOrError0.Extract();
                            Arc::new(Result::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: sp.clone()
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(146,5)
                    pub fn Open(cs: &FreshCursor) -> Arc<Result<Arc<Split<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>> = Cursor_::AssertByte::<Arc<DeserializationError>>(cs, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ObjectParams_Compile::_default::OPEN());
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<View>>>()
                        } else {
                            let mut cs: Cursor = valueOrError0.Extract();
                            Arc::new(Result::<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Cursor_::Split(&cs)
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(154,5)
                    pub fn Close(cs: &FreshCursor) -> Arc<Result<Arc<Split<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>> = Cursor_::AssertByte::<Arc<DeserializationError>>(cs, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ObjectParams_Compile::_default::CLOSE());
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<View>>>()
                        } else {
                            let mut cs: Cursor = valueOrError0.Extract();
                            Arc::new(Result::<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Cursor_::Split(&cs)
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(162,5)
                    pub fn BracketedFromParts(open: &Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen>>>>, elems: &Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>>, close: &Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>) -> Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>> {
                        let mut sp: Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>> = Arc::new(Split::<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>::SP {
                                    t: Arc::new(Bracketed::<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>::Bracketed {
                                                l: open.t().clone(),
                                                data: elems.t().clone(),
                                                r: close.t().clone()
                                            }),
                                    cs: close.cs().clone()
                                });
                        sp.clone()
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(191,5)
                    pub fn AppendWithSuffix(elems: &Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>>, elem: &Arc<Split<Arc<jKeyValue>>>, sep: &Arc<Split<Arc<Structural<jcomma>>>>) -> Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>> {
                        let mut suffixed: Arc<Suffixed<Arc<jKeyValue>, jcomma>> = Arc::new(Suffixed::<Arc<jKeyValue>, jcomma>::Suffixed {
                                    t: elem.t().clone(),
                                    suffix: Arc::new(Maybe::<Arc<Structural<jcomma>>>::NonEmpty {
                                                t: sep.t().clone()
                                            })
                                });
                        let mut _elems_k: Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>> = Arc::new(Split::<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>::SP {
                                    t: elems.t().concat(&seq![suffixed.clone()]),
                                    cs: sep.cs().clone()
                                });
                        _elems_k.clone()
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(245,5)
                    pub fn AppendLast(elems: &Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>>, elem: &Arc<Split<Arc<jKeyValue>>>, sep: &Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>) -> Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>> {
                        let mut suffixed: Arc<Suffixed<Arc<jKeyValue>, jcomma>> = Arc::new(Suffixed::<Arc<jKeyValue>, jcomma>::Suffixed {
                                    t: elem.t().clone(),
                                    suffix: Arc::new(Maybe::<Arc<Structural<jcomma>>>::Empty {})
                                });
                        let mut _elems_k: Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>> = Arc::new(Split::<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>::SP {
                                    t: elems.t().concat(&seq![suffixed.clone()]),
                                    cs: elem.cs().clone()
                                });
                        _elems_k.clone()
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(298,5)
                    pub fn Elements(json: &ValueParser, open: &Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen>>>>, elems: &Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>>) -> Arc<Result<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut _r0 = json.clone();
                        let mut _r1 = open.clone();
                        let mut _r2 = elems.clone();
                        'TAIL_CALL_START: loop {
                            let json = _r0;
                            let open = _r1;
                            let elems = _r2;
                            let mut valueOrError0: Arc<Result<Arc<Split<Arc<jKeyValue>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ObjectParams_Compile::_default::Element(elems.cs(), &json);
                            if valueOrError0.IsFailure() {
                                return valueOrError0.PropagateFailure::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>>();
                            } else {
                                let mut elem: Arc<Split<Arc<jKeyValue>>> = valueOrError0.Extract();
                                if elem.cs()._EOF_q() {
                                    return Arc::new(Result::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Failure {
                                                error: Arc::new(CursorError::<Arc<DeserializationError>>::EOF {})
                                            });
                                } else {
                                    let mut sep: Arc<Split<Arc<Structural<jopt>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::TryStructural(elem.cs());
                                    let mut s0: i16 = View_::Peek(sep.t().t());
                                    if s0 == crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::SEPARATOR() as i16 && View_::Length(sep.t().t()) == truncate!(int!(1), u32) {
                                        let mut sep: Arc<Split<Arc<Structural<jcomma>>>> = sep.clone();
                                        let mut elems: Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::AppendWithSuffix(&elems, &elem, &sep);
                                        let mut _in0: ValueParser = json.clone();
                                        let mut _in1: Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen>>>> = open.clone();
                                        let mut _in2: Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>> = elems.clone();
                                        _r0 = _in0.clone();
                                        _r1 = _in1.clone();
                                        _r2 = _in2.clone();
                                        continue 'TAIL_CALL_START;
                                    } else {
                                        if s0 == crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ObjectParams_Compile::_default::CLOSE() as i16 && View_::Length(sep.t().t()) == truncate!(int!(1), u32) {
                                            let mut sep: Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>> = sep.clone();
                                            let mut _elems_k: Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::AppendLast(&elems, &elem, &sep);
                                            let mut bracketed: Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::BracketedFromParts(&open, &_elems_k, &sep);
                                            return Arc::new(Result::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                                        value: bracketed.clone()
                                                    });
                                        } else {
                                            let mut separator: u8 = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::SEPARATOR();
                                            let mut pr: Arc<Result<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = Arc::new(Result::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Failure {
                                                        error: Arc::new(CursorError::<Arc<DeserializationError>>::ExpectingAnyByte {
                                                                    expected_sq: seq![crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ObjectParams_Compile::_default::CLOSE(), separator],
                                                                    b: s0
                                                                })
                                                    });
                                            return pr.clone();
                                        }
                                    }
                                }
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(419,5)
                    pub fn Bracketed(cs: &FreshCursor, json: &ValueParser) -> Arc<Result<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::Structural::<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen>(cs, &Arc::new(Parser_::<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<DeserializationError>>::Parser {
                                        r#fn: Arc::new(move |x0: &FreshCursor| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::Open(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>
                                    }));
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>>()
                        } else {
                            let mut open: Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen>>>> = valueOrError0.Extract();
                            let mut elems: Arc<Split<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>> = Arc::new(Split::<Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>>::SP {
                                        t: seq![] as Sequence<Arc<Suffixed<Arc<jKeyValue>, jcomma>>>,
                                        cs: open.cs().clone()
                                    });
                            if Cursor_::Peek(open.cs()) == crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ObjectParams_Compile::_default::CLOSE() as i16 {
                                let mut p: Arc<Parser_<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose, Arc<DeserializationError>>> = Arc::new(Parser_::<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose, Arc<DeserializationError>>::Parser {
                                            r#fn: Arc::new(move |x0: &FreshCursor| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::Close(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>
                                        });
                                let mut valueOrError1: Arc<Result<Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::Structural::<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>(open.cs(), &p);
                                if valueOrError1.IsFailure() {
                                    valueOrError1.PropagateFailure::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>>()
                                } else {
                                    let mut close: Arc<Split<Arc<Structural<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>> = valueOrError1.Extract();
                                    Arc::new(Result::<Arc<Split<Arc<Bracketed<crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen, Arc<jKeyValue>, jcomma, crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose>>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                            value: crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::BracketedFromParts(&open, &elems, &close)
                                        })
                                }
                            } else {
                                crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::Elements(json, &open, &elems)
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(132,5)
                    pub fn SpecViewOpen() -> Arc<dyn ::std::ops::Fn(&crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jopen) -> Sequence<u8> + Sync + Send> {
                        Arc::new(move |x0: &View| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::SpecView()(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(131,5)
                    pub fn SpecViewClose() -> Arc<dyn ::std::ops::Fn(&crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::jclose) -> Sequence<u8> + Sync + Send> {
                        Arc::new(move |x0: &View| crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::_default::SpecView()(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(124,5)
                    pub fn SEPARATOR() -> u8 {
                        DafnyCharUTF16(44 as u16).0 as u8
                    }
                }

                /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(126,5)
                pub type jopen = Arc<View_>;

                /// An element of jopen
                pub fn __init_jopen() -> Arc<View_> {
                    View_::OfBytes(&seq![crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ObjectParams_Compile::_default::OPEN()])
                }

                /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(127,5)
                pub type jclose = Arc<View_>;

                /// An element of jclose
                pub fn __init_jclose() -> Arc<View_> {
                    View_::OfBytes(&seq![crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_ObjectParams_Compile::_default::CLOSE()])
                }
            }

            /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(657,3)
            pub mod _Strings_Compile {
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor;
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
                pub use ::dafny_runtime::MaybePlacebo;
                pub use ::dafny_runtime::integer_range;
                pub use ::std::convert::Into;
                pub use ::dafny_runtime::int;
                pub use ::dafny_runtime::DafnyCharUTF16;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jquote;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(668,5)
                    pub fn StringBody(cs: &Cursor) -> Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut pr = MaybePlacebo::<Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>>>::new();
                        let mut escaped: bool = false;
                        let mut _hi0: u32 = cs.end().clone();
                        for _point_k in integer_range(cs.point().clone(), _hi0).map(Into::<u32>::into) {
                            let mut byte: u8 = cs.s().get(&int!((&_point_k).clone()));
                            if byte == DafnyCharUTF16(34 as u16).0 as u8 && !escaped {
                                pr = MaybePlacebo::from(Arc::new(Result::<Arc<Cursor_>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                                value: Arc::new(Cursor_::Cursor {
                                                            s: cs.s().clone(),
                                                            beg: cs.beg().clone(),
                                                            point: _point_k,
                                                            end: cs.end().clone()
                                                        })
                                            }));
                                return pr.read();
                            } else {
                                if byte == DafnyCharUTF16(92 as u16).0 as u8 {
                                    escaped = !escaped;
                                } else {
                                    escaped = false;
                                }
                            }
                        }
                        pr = MaybePlacebo::from(Arc::new(Result::<Cursor, Arc<CursorError<Arc<DeserializationError>>>>::Failure {
                                        error: Arc::new(CursorError::<Arc<DeserializationError>>::EOF {})
                                    }));
                        return pr.read();
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(691,5)
                    pub fn Quote(cs: &FreshCursor) -> Arc<Result<Arc<Split<jquote>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>> = Cursor_::AssertChar::<Arc<DeserializationError>>(cs, &DafnyCharUTF16(34 as u16));
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<View>>>()
                        } else {
                            let mut cs: Cursor = valueOrError0.Extract();
                            Arc::new(Result::<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                    value: Cursor_::Split(&cs)
                                })
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(698,5)
                    pub fn String(cs: &FreshCursor) -> Arc<Result<Arc<Split<Arc<jstring>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut valueOrError0: Arc<Result<Arc<Split<jquote>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Strings_Compile::_default::Quote(cs);
                        if valueOrError0.IsFailure() {
                            valueOrError0.PropagateFailure::<Arc<Split<Arc<jstring>>>>()
                        } else {
                            let mut __let_tmp_rhs0: Arc<Split<jquote>> = valueOrError0.Extract();
                            let mut lq: jquote = __let_tmp_rhs0.t().clone();
                            let mut cs: FreshCursor = __let_tmp_rhs0.cs().clone();
                            let mut valueOrError1: Arc<Result<Cursor, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Strings_Compile::_default::StringBody(&cs);
                            if valueOrError1.IsFailure() {
                                valueOrError1.PropagateFailure::<Arc<Split<Arc<jstring>>>>()
                            } else {
                                let mut contents: Cursor = valueOrError1.Extract();
                                let mut __let_tmp_rhs1: Arc<Split<View>> = Cursor_::Split(&contents);
                                let mut contents: View = __let_tmp_rhs1.t().clone();
                                let mut cs: FreshCursor = __let_tmp_rhs1.cs().clone();
                                let mut valueOrError2: Arc<Result<Arc<Split<jquote>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Strings_Compile::_default::Quote(&cs);
                                if valueOrError2.IsFailure() {
                                    valueOrError2.PropagateFailure::<Arc<Split<Arc<jstring>>>>()
                                } else {
                                    let mut __let_tmp_rhs2: Arc<Split<jquote>> = valueOrError2.Extract();
                                    let mut rq: jquote = __let_tmp_rhs2.t().clone();
                                    let mut cs: FreshCursor = __let_tmp_rhs2.cs().clone();
                                    Arc::new(Result::<Arc<Split<Arc<jstring>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                            value: Arc::new(Split::<Arc<jstring>>::SP {
                                                        t: Arc::new(jstring::JString {
                                                                    lq: lq.clone(),
                                                                    contents: contents.clone(),
                                                                    rq: rq.clone()
                                                                }),
                                                        cs: cs.clone()
                                                    })
                                        })
                                }
                            }
                        }
                    }
                }
            }

            /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(501,3)
            pub mod _Values_Compile {
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::FreshCursor;
                pub use ::std::sync::Arc;
                pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Split;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::CursorError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::DeserializationError;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Cursors_Compile::Cursor_;
                pub use ::dafny_runtime::DafnyCharUTF16;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbrace;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jKeyValue;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbrace;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbracket;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbracket;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnumber;
                pub use crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Core_Compile::ValueParser;
                pub use ::std::marker::Sync;
                pub use ::std::marker::Send;
                pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Parsers_Compile::SubParser_;

                pub struct _default {}

                impl _default {
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(517,5)
                    pub fn Value(cs: &FreshCursor) -> Arc<Result<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>> {
                        let mut c: i16 = Cursor_::Peek(cs);
                        if c == DafnyCharUTF16(123 as u16).0 as i16 {
                            let mut valueOrError0: Arc<Result<Arc<Split<Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Objects_Compile::_default::Object(cs, &crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Values_Compile::_default::ValueParser(cs));
                            if valueOrError0.IsFailure() {
                                valueOrError0.PropagateFailure::<Arc<Split<Arc<Value>>>>()
                            } else {
                                let mut __let_tmp_rhs0: Arc<Split<Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>>>> = valueOrError0.Extract();
                                let mut obj: Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>> = __let_tmp_rhs0.t().clone();
                                let mut _cs_k: FreshCursor = __let_tmp_rhs0.cs().clone();
                                let mut v: Arc<Value> = Arc::new(Value::Object {
                                            obj: obj.clone()
                                        });
                                let mut sp: Arc<Split<Arc<Value>>> = Arc::new(Split::<Arc<Value>>::SP {
                                            t: v.clone(),
                                            cs: _cs_k.clone()
                                        });
                                Arc::new(Result::<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                        value: sp.clone()
                                    })
                            }
                        } else {
                            if c == DafnyCharUTF16(91 as u16).0 as i16 {
                                let mut valueOrError1: Arc<Result<Arc<Split<Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Arrays_Compile::_default::Array(cs, &crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Values_Compile::_default::ValueParser(cs));
                                if valueOrError1.IsFailure() {
                                    valueOrError1.PropagateFailure::<Arc<Split<Arc<Value>>>>()
                                } else {
                                    let mut __let_tmp_rhs1: Arc<Split<Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>>>> = valueOrError1.Extract();
                                    let mut arr: Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>> = __let_tmp_rhs1.t().clone();
                                    let mut _cs_k: FreshCursor = __let_tmp_rhs1.cs().clone();
                                    let mut v: Arc<Value> = Arc::new(Value::Array {
                                                arr: arr.clone()
                                            });
                                    let mut sp: Arc<Split<Arc<Value>>> = Arc::new(Split::<Arc<Value>>::SP {
                                                t: v.clone(),
                                                cs: _cs_k.clone()
                                            });
                                    Arc::new(Result::<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                            value: sp.clone()
                                        })
                                }
                            } else {
                                if c == DafnyCharUTF16(34 as u16).0 as i16 {
                                    let mut valueOrError2: Arc<Result<Arc<Split<Arc<jstring>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Strings_Compile::_default::String(cs);
                                    if valueOrError2.IsFailure() {
                                        valueOrError2.PropagateFailure::<Arc<Split<Arc<Value>>>>()
                                    } else {
                                        let mut __let_tmp_rhs2: Arc<Split<Arc<jstring>>> = valueOrError2.Extract();
                                        let mut str: Arc<jstring> = __let_tmp_rhs2.t().clone();
                                        let mut _cs_k: FreshCursor = __let_tmp_rhs2.cs().clone();
                                        Arc::new(Result::<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                                value: Arc::new(Split::<Arc<Value>>::SP {
                                                            t: Arc::new(Value::String {
                                                                        str: str.clone()
                                                                    }),
                                                            cs: _cs_k.clone()
                                                        })
                                            })
                                    }
                                } else {
                                    if c == DafnyCharUTF16(116 as u16).0 as i16 {
                                        let mut valueOrError3: Arc<Result<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Constants_Compile::_default::Constant(cs, &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::TRUE());
                                        if valueOrError3.IsFailure() {
                                            valueOrError3.PropagateFailure::<Arc<Split<Arc<Value>>>>()
                                        } else {
                                            let mut __let_tmp_rhs3: Arc<Split<View>> = valueOrError3.Extract();
                                            let mut cst: View = __let_tmp_rhs3.t().clone();
                                            let mut _cs_k: FreshCursor = __let_tmp_rhs3.cs().clone();
                                            Arc::new(Result::<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                                    value: Arc::new(Split::<Arc<Value>>::SP {
                                                                t: Arc::new(Value::Bool {
                                                                            b: cst.clone()
                                                                        }),
                                                                cs: _cs_k.clone()
                                                            })
                                                })
                                        }
                                    } else {
                                        if c == DafnyCharUTF16(102 as u16).0 as i16 {
                                            let mut valueOrError4: Arc<Result<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Constants_Compile::_default::Constant(cs, &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::FALSE());
                                            if valueOrError4.IsFailure() {
                                                valueOrError4.PropagateFailure::<Arc<Split<Arc<Value>>>>()
                                            } else {
                                                let mut __let_tmp_rhs4: Arc<Split<View>> = valueOrError4.Extract();
                                                let mut cst: View = __let_tmp_rhs4.t().clone();
                                                let mut _cs_k: FreshCursor = __let_tmp_rhs4.cs().clone();
                                                Arc::new(Result::<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                                        value: Arc::new(Split::<Arc<Value>>::SP {
                                                                    t: Arc::new(Value::Bool {
                                                                                b: cst.clone()
                                                                            }),
                                                                    cs: _cs_k.clone()
                                                                })
                                                    })
                                            }
                                        } else {
                                            if c == DafnyCharUTF16(110 as u16).0 as i16 {
                                                let mut valueOrError5: Arc<Result<Arc<Split<View>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Constants_Compile::_default::Constant(cs, &crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::_default::NULL());
                                                if valueOrError5.IsFailure() {
                                                    valueOrError5.PropagateFailure::<Arc<Split<Arc<Value>>>>()
                                                } else {
                                                    let mut __let_tmp_rhs5: Arc<Split<View>> = valueOrError5.Extract();
                                                    let mut cst: View = __let_tmp_rhs5.t().clone();
                                                    let mut _cs_k: FreshCursor = __let_tmp_rhs5.cs().clone();
                                                    Arc::new(Result::<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                                            value: Arc::new(Split::<Arc<Value>>::SP {
                                                                        t: Arc::new(Value::Null {
                                                                                    n: cst.clone()
                                                                                }),
                                                                        cs: _cs_k.clone()
                                                                    })
                                                        })
                                                }
                                            } else {
                                                let mut valueOrError6: Arc<Result<Arc<Split<Arc<jnumber>>>, Arc<CursorError<Arc<DeserializationError>>>>> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Numbers_Compile::_default::Number(cs);
                                                if valueOrError6.IsFailure() {
                                                    valueOrError6.PropagateFailure::<Arc<Split<Arc<Value>>>>()
                                                } else {
                                                    let mut __let_tmp_rhs6: Arc<Split<Arc<jnumber>>> = valueOrError6.Extract();
                                                    let mut num: Arc<jnumber> = __let_tmp_rhs6.t().clone();
                                                    let mut _cs_k: FreshCursor = __let_tmp_rhs6.cs().clone();
                                                    let mut v: Arc<Value> = Arc::new(Value::Number {
                                                                num: num.clone()
                                                            });
                                                    let mut sp: Arc<Split<Arc<Value>>> = Arc::new(Split::<Arc<Value>>::SP {
                                                                t: v.clone(),
                                                                cs: _cs_k.clone()
                                                            });
                                                    Arc::new(Result::<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>::Success {
                                                            value: sp.clone()
                                                        })
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    /// ../mpl/libraries/src/JSON/ZeroCopy/Deserializer.dfy(629,5)
                    pub fn ValueParser(cs: &FreshCursor) -> ValueParser {
                        let mut pre: Arc<dyn ::std::ops::Fn(&FreshCursor) -> bool + Sync + Send> = {
                                let cs: FreshCursor = cs.clone();
                                {
                                    let mut cs = cs.clone();
                                    Arc::new(move |_ps_k: &FreshCursor| -> bool{
                                            Cursor_::Length(_ps_k) < Cursor_::Length(&cs)
                                        })
                                }
                            };
                        let mut r#fn: Arc<dyn ::std::ops::Fn(&FreshCursor) -> Arc<Result<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>> + Sync + Send> = {
                                let pre: Arc<dyn ::std::ops::Fn(&FreshCursor) -> bool + Sync + Send> = pre.clone();
                                {
                                    Arc::new(move |_ps_k: &FreshCursor| -> Arc<Result<Arc<Split<Arc<Value>>>, Arc<CursorError<Arc<DeserializationError>>>>>{
                                            crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Deserializer_Compile::_Values_Compile::_default::Value(_ps_k)
                                        })
                                }
                            };
                        Arc::new(SubParser_::<Arc<Value>, Arc<DeserializationError>>::SubParser {
                                r#fn: r#fn.clone()
                            })
                    }
                }
            }
        }

        /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(9,1)
        pub mod _Serializer_Compile {
            pub use ::std::sync::Arc;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Structural;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value;
            pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
            pub use ::dafny_runtime::Object;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Errors_Compile::SerializationError;
            pub use ::dafny_runtime::MaybePlacebo;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer_;
            pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
            pub use ::dafny_runtime::int;
            pub use ::dafny_runtime::rd;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Writer;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Null;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnull;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Bool;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jbool;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::String;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jstring;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Number;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jnumber;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Bracketed;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbrace;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jKeyValue;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jcomma;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbrace;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jlbracket;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::jrbracket;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe::NonEmpty;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Core_Compile::View;
            pub use ::dafny_runtime::truncate;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Utils_Compile::_Views_Compile::_Writers_Compile::Chain;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::SuffixedSequence;
            pub use ::dafny_runtime::DafnyInt;
            pub use ::dafny_runtime::integer_range;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Suffixed;
            pub use crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Maybe::Empty;

            pub struct _default {}

            impl _default {
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(21,3)
                pub fn Serialize(js: &Arc<Structural<Arc<Value>>>) -> Arc<Result<Object<[u8]>, Arc<SerializationError>>> {
                    let mut rbs = MaybePlacebo::<Arc<Result<Object<[u8]>, Arc<SerializationError>>>>::new();
                    let mut writer: Arc<Writer_> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Text(js);
                    let mut valueOrError0: Arc<Outcome<Arc<SerializationError>>>;
                    valueOrError0 = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<SerializationError>>(writer._Unsaturated_q(), &Arc::new(SerializationError::OutOfMemory {}));
                    if valueOrError0.IsFailure() {
                        rbs = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<[u8]>>());
                        return rbs.read();
                    };
                    let mut bs: Object<[u8]>;
                    let mut _out0: Object<[u8]>;
                    _out0 = writer.ToArray();
                    bs = _out0.clone();
                    rbs = MaybePlacebo::from(Arc::new(Result::<Object<[u8]>, Arc<SerializationError>>::Success {
                                    value: bs.clone()
                                }));
                    return rbs.read();
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(31,3)
                pub fn SerializeTo(js: &Arc<Structural<Arc<Value>>>, dest: &Object<[u8]>) -> Arc<Result<u32, Arc<SerializationError>>> {
                    let mut len = MaybePlacebo::<Arc<Result<u32, Arc<SerializationError>>>>::new();
                    let mut writer: Arc<Writer_> = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Text(js);
                    let mut valueOrError0: Arc<Outcome<Arc<SerializationError>>>;
                    valueOrError0 = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<SerializationError>>(writer._Unsaturated_q(), &Arc::new(SerializationError::OutOfMemory {}));
                    if valueOrError0.IsFailure() {
                        len = MaybePlacebo::from(valueOrError0.PropagateFailure::<u32>());
                        return len.read();
                    };
                    let mut valueOrError1: Arc<Outcome<Arc<SerializationError>>>;
                    valueOrError1 = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<SerializationError>>(!(int!(rd!(dest.clone()).len()) < int!(writer.length().clone())), &Arc::new(SerializationError::OutOfMemory {}));
                    if valueOrError1.IsFailure() {
                        len = MaybePlacebo::from(valueOrError1.PropagateFailure::<u32>());
                        return len.read();
                    };
                    writer.CopyTo(dest);
                    len = MaybePlacebo::from(Arc::new(Result::<u32, Arc<SerializationError>>::Success {
                                    value: writer.length().clone()
                                }));
                    return len.read();
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(45,3)
                pub fn Text(js: &Arc<Structural<Arc<Value>>>) -> Writer {
                    crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::JSON(js, &Writer_::Empty())
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(51,3)
                pub fn JSON(js: &Arc<Structural<Arc<Value>>>, writer: &Writer) -> Writer {
                    Writer_::Append(&Writer_::Then(&Writer_::Append(writer, js.before()), {
                                let js: Arc<Structural<Arc<Value>>> = js.clone();
                                &({
                                    let mut js = js.clone();
                                    Arc::new(move |wr: &Writer| -> Writer{
                                            crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Value(js.t(), wr)
                                        })
                                })
                            }), js.after())
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(61,3)
                pub fn Value(v: &Arc<Value>, writer: &Writer) -> Writer {
                    let mut _source0: Arc<Value> = v.clone();
                    if matches!((&_source0).as_ref(), Null{ .. }) {
                        let mut ___mcc_h0: jnull = _source0.n().clone();
                        let mut n: jnull = ___mcc_h0.clone();
                        Writer_::Append(writer, &n)
                    } else {
                        if matches!((&_source0).as_ref(), Bool{ .. }) {
                            let mut ___mcc_h1: jbool = _source0.b().clone();
                            let mut b: jbool = ___mcc_h1.clone();
                            let mut wr: Writer = Writer_::Append(writer, &b);
                            wr.clone()
                        } else {
                            if matches!((&_source0).as_ref(), String{ .. }) {
                                let mut ___mcc_h2: Arc<jstring> = _source0.str().clone();
                                let mut str: Arc<jstring> = ___mcc_h2.clone();
                                let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::String(&str, writer);
                                wr.clone()
                            } else {
                                if matches!((&_source0).as_ref(), Number{ .. }) {
                                    let mut ___mcc_h3: Arc<jnumber> = _source0.num().clone();
                                    let mut num: Arc<jnumber> = ___mcc_h3.clone();
                                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Number(&num, writer);
                                    wr.clone()
                                } else {
                                    if matches!((&_source0).as_ref(), crate::implementation_from_dafny::_JSON_Compile::_Grammar_Compile::Value::Object{ .. }) {
                                        let mut ___mcc_h4: Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>> = _source0.obj().clone();
                                        let mut obj: Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>> = ___mcc_h4.clone();
                                        let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Object(&obj, writer);
                                        wr.clone()
                                    } else {
                                        let mut ___mcc_h5: Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>> = _source0.arr().clone();
                                        let mut arr: Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>> = ___mcc_h5.clone();
                                        let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Array(&arr, writer);
                                        wr.clone()
                                    }
                                }
                            }
                        }
                    }
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(74,3)
                pub fn String(str: &Arc<jstring>, writer: &Writer) -> Writer {
                    Writer_::Append(&Writer_::Append(&Writer_::Append(writer, str.lq()), str.contents()), str.rq())
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(84,3)
                pub fn Number(num: &Arc<jnumber>, writer: &Writer) -> Writer {
                    let mut wr: Writer = Writer_::Append(&Writer_::Append(writer, num.minus()), num.num());
                    let mut wr: Arc<Writer_> = if matches!(num.frac().as_ref(), NonEmpty{ .. }) {
                            Writer_::Append(&Writer_::Append(&wr, num.frac().t().period()), num.frac().t().num())
                        } else {
                            wr.clone()
                        };
                    let mut wr: Arc<Writer_> = if matches!(num.exp().as_ref(), NonEmpty{ .. }) {
                            Writer_::Append(&Writer_::Append(&wr.Append(num.exp().t().e()), num.exp().t().sign()), num.exp().t().num())
                        } else {
                            wr.clone()
                        };
                    wr.clone()
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(109,3)
                pub fn StructuralView(st: &Arc<Structural<View>>, writer: &Writer) -> Writer {
                    Writer_::Append(&Writer_::Append(&Writer_::Append(writer, st.before()), st.t()), st.after())
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(141,3)
                pub fn Object(obj: &Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>>, writer: &Writer) -> Writer {
                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::StructuralView(obj.l(), writer);
                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Members(obj, &wr);
                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::StructuralView(obj.r(), &wr);
                    wr.clone()
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(170,3)
                pub fn Array(arr: &Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>>, writer: &Writer) -> Writer {
                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::StructuralView(arr.l(), writer);
                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Items(arr, &wr);
                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::StructuralView(arr.r(), &wr);
                    wr.clone()
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(184,3)
                pub fn Members(obj: &Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>>, writer: &Writer) -> Writer {
                    let mut wr: Writer = Arc::new(Writer_::Writer {
                                length: truncate!(int!(0), u32),
                                chain: Arc::new(Chain::Empty {})
                            });
                    let mut _out0: Writer;
                    _out0 = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::MembersImpl(obj, writer);
                    wr = _out0.clone();
                    return wr.clone();
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(194,3)
                pub fn Items(arr: &Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>>, writer: &Writer) -> Writer {
                    let mut wr: Writer = Arc::new(Writer_::Writer {
                                length: truncate!(int!(0), u32),
                                chain: Arc::new(Chain::Empty {})
                            });
                    let mut _out0: Writer;
                    _out0 = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::ItemsImpl(arr, writer);
                    wr = _out0.clone();
                    return wr.clone();
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(270,3)
                pub fn MembersImpl(obj: &Arc<Bracketed<jlbrace, Arc<jKeyValue>, jcomma, jrbrace>>, writer: &Writer) -> Writer {
                    let mut wr: Writer = Arc::new(Writer_::Writer {
                                length: truncate!(int!(0), u32),
                                chain: Arc::new(Chain::Empty {})
                            });
                    wr = writer.clone();
                    let mut members: SuffixedSequence<Arc<jKeyValue>, jcomma> = obj.data().clone();
                    let mut _hi0: DafnyInt = members.cardinality();
                    for i in integer_range(int!(0), _hi0.clone()) {
                        wr = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Member(&members.get(&i), &wr);
                    }
                    return wr.clone();
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(287,3)
                pub fn ItemsImpl(arr: &Arc<Bracketed<jlbracket, Arc<Value>, jcomma, jrbracket>>, writer: &Writer) -> Writer {
                    let mut wr: Writer = Arc::new(Writer_::Writer {
                                length: truncate!(int!(0), u32),
                                chain: Arc::new(Chain::Empty {})
                            });
                    wr = writer.clone();
                    let mut items: SuffixedSequence<Arc<Value>, jcomma> = arr.data().clone();
                    let mut _hi0: DafnyInt = items.cardinality();
                    for i in integer_range(int!(0), _hi0.clone()) {
                        wr = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Item(&items.get(&i), &wr);
                    }
                    return wr.clone();
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(310,3)
                pub fn Member(m: &Arc<Suffixed<Arc<jKeyValue>, jcomma>>, writer: &Writer) -> Writer {
                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::String(m.t().k(), writer);
                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::StructuralView(m.t().colon(), &wr);
                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Value(m.t().v(), &wr);
                    let mut wr: Arc<Writer_> = if matches!(m.suffix().as_ref(), Empty{ .. }) {
                            wr.clone()
                        } else {
                            crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::StructuralView(m.suffix().t(), &wr)
                        };
                    wr.clone()
                }
                /// ../mpl/libraries/src/JSON/ZeroCopy/Serializer.dfy(337,3)
                pub fn Item(m: &Arc<Suffixed<Arc<Value>, jcomma>>, writer: &Writer) -> Writer {
                    let mut wr: Writer = crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::Value(m.t(), writer);
                    let mut wr: Arc<Writer_> = if matches!(m.suffix().as_ref(), Empty{ .. }) {
                            wr.clone()
                        } else {
                            crate::implementation_from_dafny::_JSON_Compile::_ZeroCopy_Compile::_Serializer_Compile::_default::StructuralView(m.suffix().t(), &wr)
                        };
                    wr.clone()
                }
            }
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(10,1)
pub mod _KMSKeystoreOperations_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsArn;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration::kmsKeyArn;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration::kmsMRKeyArn;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration::discovery;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Discovery;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::MRDiscovery;
    pub use crate::implementation_from_dafny::_Structure_Compile::BranchKeyContext;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyWithoutPlaintextResponse;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GenerateDataKeyWithoutPlaintextRequest;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DataKeySpec;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::NumberOfBytesType;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ReEncryptResponse;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::ReEncryptRequest;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::EncryptionAlgorithmSpec;
    pub use crate::implementation_from_dafny::_Structure_Compile::BranchKeyItem;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptResponse;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::DecryptRequest;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::RecipientInfo;
    pub use ::dafny_runtime::truncate;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(24,3)
        pub fn replaceRegion(arn: &Sequence<DafnyCharUTF16>, region: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            let mut parsed: Arc<Result<AwsKmsArn, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(arn);
            if matches!((&parsed).as_ref(), Failure{ .. }) {
                arn.clone()
            } else {
                if !crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsMultiRegionAwsKmsArn(parsed.value()) {
                    arn.clone()
                } else {
                    let mut newArn: Sequence<DafnyCharUTF16> = AwsArn::ToArnString(parsed.value(), &Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                    value: region.clone()
                                }));
                    if crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(&newArn) {
                        newArn.clone()
                    } else {
                        arn.clone()
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(39,3)
        pub fn GetArn(kmsConfiguration: &Arc<KMSConfiguration>, discoverdArn: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
            let mut _source0: Arc<KMSConfiguration> = kmsConfiguration.clone();
            if matches!((&_source0).as_ref(), kmsKeyArn{ .. }) {
                let mut ___mcc_h0: Sequence<DafnyCharUTF16> = _source0.kmsKeyArn().clone();
                let mut arn: Sequence<DafnyCharUTF16> = ___mcc_h0.clone();
                arn.clone()
            } else {
                if matches!((&_source0).as_ref(), kmsMRKeyArn{ .. }) {
                    let mut ___mcc_h1: Sequence<DafnyCharUTF16> = _source0.kmsMRKeyArn().clone();
                    let mut arn: Sequence<DafnyCharUTF16> = ___mcc_h1.clone();
                    arn.clone()
                } else {
                    if matches!((&_source0).as_ref(), discovery{ .. }) {
                        let mut ___mcc_h2: Arc<Discovery> = _source0.discovery().clone();
                        let mut obj: Arc<Discovery> = ___mcc_h2.clone();
                        discoverdArn.clone()
                    } else {
                        let mut ___mcc_h3: Arc<MRDiscovery> = _source0.mrDiscovery().clone();
                        let mut region: Arc<MRDiscovery> = ___mcc_h3.clone();
                        _default::replaceRegion(discoverdArn, region.region())
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(49,3)
        pub fn _AttemptKmsOperation_q(kmsConfiguration: &Arc<KMSConfiguration>, encryptionContext: &BranchKeyContext) -> bool {
            let mut _source0: Arc<KMSConfiguration> = kmsConfiguration.clone();
            if matches!((&_source0).as_ref(), kmsKeyArn{ .. }) {
                let mut ___mcc_h0: Sequence<DafnyCharUTF16> = _source0.kmsKeyArn().clone();
                let mut arn: Sequence<DafnyCharUTF16> = ___mcc_h0.clone();
                arn.clone() == encryptionContext.get(&crate::implementation_from_dafny::_Structure_Compile::_default::KMS_FIELD()) && crate::implementation_from_dafny::_KmsArn_Compile::_default::_ValidKmsArn_q(&arn)
            } else {
                if matches!((&_source0).as_ref(), kmsMRKeyArn{ .. }) {
                    let mut ___mcc_h1: Sequence<DafnyCharUTF16> = _source0.kmsMRKeyArn().clone();
                    let mut arn: Sequence<DafnyCharUTF16> = ___mcc_h1.clone();
                    _default::MrkMatch(&arn, &encryptionContext.get(&crate::implementation_from_dafny::_Structure_Compile::_default::KMS_FIELD())) && crate::implementation_from_dafny::_KmsArn_Compile::_default::_ValidKmsArn_q(&arn)
                } else {
                    if matches!((&_source0).as_ref(), discovery{ .. }) {
                        let mut ___mcc_h2: Arc<Discovery> = _source0.discovery().clone();
                        let mut obj: Arc<Discovery> = ___mcc_h2.clone();
                        crate::implementation_from_dafny::_KmsArn_Compile::_default::_ValidKmsArn_q(&encryptionContext.get(&crate::implementation_from_dafny::_Structure_Compile::_default::KMS_FIELD()))
                    } else {
                        let mut ___mcc_h3: Arc<MRDiscovery> = _source0.mrDiscovery().clone();
                        let mut obj: Arc<MRDiscovery> = ___mcc_h3.clone();
                        crate::implementation_from_dafny::_KmsArn_Compile::_default::_ValidKmsArn_q(&encryptionContext.get(&crate::implementation_from_dafny::_Structure_Compile::_default::KMS_FIELD()))
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(60,3)
        pub fn _Compatible_q(kmsConfiguration: &Arc<KMSConfiguration>, keyId: &Sequence<DafnyCharUTF16>) -> bool {
            let mut _source0: Arc<KMSConfiguration> = kmsConfiguration.clone();
            if matches!((&_source0).as_ref(), kmsKeyArn{ .. }) {
                let mut ___mcc_h0: Sequence<DafnyCharUTF16> = _source0.kmsKeyArn().clone();
                let mut arn: Sequence<DafnyCharUTF16> = ___mcc_h0.clone();
                arn.clone() == keyId.clone()
            } else {
                let mut ___mcc_h1: Sequence<DafnyCharUTF16> = _source0.kmsMRKeyArn().clone();
                let mut arn: Sequence<DafnyCharUTF16> = ___mcc_h1.clone();
                _default::MrkMatch(&arn, keyId)
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(68,3)
        pub fn _OptCompatible_q(kmsConfiguration: &Arc<KMSConfiguration>, keyId: &Arc<Option<Sequence<DafnyCharUTF16>>>) -> bool {
            matches!(keyId.as_ref(), Some{ .. }) && _default::_Compatible_q(kmsConfiguration, keyId.value())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(74,3)
        pub fn MrkMatch(x: &Sequence<DafnyCharUTF16>, y: &Sequence<DafnyCharUTF16>) -> bool {
            let mut xArn: Arc<Result<AwsKmsArn, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(x);
            let mut yArn: Arc<Result<AwsKmsArn, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(y);
            if matches!((&xArn).as_ref(), Failure{ .. }) || matches!((&yArn).as_ref(), Failure{ .. }) {
                false
            } else {
                crate::implementation_from_dafny::_AwsKmsMrkMatchForDecrypt_Compile::_default::AwsKmsMrkMatchForDecrypt(&Arc::new(AwsKmsIdentifier::AwsKmsArnIdentifier {
                            a: xArn.value().clone()
                        }), &Arc::new(AwsKmsIdentifier::AwsKmsArnIdentifier {
                            a: yArn.value().clone()
                        }))
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(84,3)
        pub fn HasKeyId(kmsConfiguration: &Arc<KMSConfiguration>) -> bool {
            matches!(kmsConfiguration.as_ref(), kmsKeyArn{ .. }) || matches!(kmsConfiguration.as_ref(), kmsMRKeyArn{ .. })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(89,3)
        pub fn GetKeyId(kmsConfiguration: &Arc<KMSConfiguration>) -> Sequence<DafnyCharUTF16> {
            let mut _source0: Arc<KMSConfiguration> = kmsConfiguration.clone();
            if matches!((&_source0).as_ref(), kmsKeyArn{ .. }) {
                let mut ___mcc_h0: Sequence<DafnyCharUTF16> = _source0.kmsKeyArn().clone();
                let mut arn: Sequence<DafnyCharUTF16> = ___mcc_h0.clone();
                arn.clone()
            } else {
                let mut ___mcc_h1: Sequence<DafnyCharUTF16> = _source0.kmsMRKeyArn().clone();
                let mut arn: Sequence<DafnyCharUTF16> = ___mcc_h1.clone();
                arn.clone()
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(97,3)
        pub fn GenerateKey(encryptionContext: &BranchKeyContext, kmsConfiguration: &Arc<KMSConfiguration>, grantTokens: &GrantTokenList, kmsClient: &Object<dyn IKMSClient>) -> Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>>::new();
            let mut kmsKeyArn: Sequence<DafnyCharUTF16> = _default::GetKeyId(kmsConfiguration);
            let mut generatorRequest: Arc<GenerateDataKeyWithoutPlaintextRequest> = Arc::new(GenerateDataKeyWithoutPlaintextRequest::GenerateDataKeyWithoutPlaintextRequest {
                        KeyId: kmsKeyArn.clone(),
                        EncryptionContext: Arc::new(Option::<BranchKeyContext>::Some {
                                    value: encryptionContext.clone()
                                }),
                        KeySpec: Arc::new(Option::<Arc<DataKeySpec>>::None {}),
                        NumberOfBytes: Arc::new(Option::<NumberOfBytesType>::Some {
                                    value: 32
                                }),
                        GrantTokens: Arc::new(Option::<GrantTokenList>::Some {
                                    value: grantTokens.clone()
                                }),
                        DryRun: Arc::new(Option::<bool>::None {})
                    });
            let mut maybeGenerateResponse: Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = IKMSClient::GenerateDataKeyWithoutPlaintext(rd!(kmsClient.clone()), &generatorRequest);
            maybeGenerateResponse = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeGenerateResponse.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsKms {
                                        ComAmazonawsKms: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GenerateDataKeyWithoutPlaintextResponse>>());
                return res.read();
            };
            let mut generateResponse: Arc<GenerateDataKeyWithoutPlaintextResponse> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(true && matches!(generateResponse.KeyId().as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: string_utf16_of("Invalid response from KMS GenerateDataKey:: Invalid Key Id")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GenerateDataKeyWithoutPlaintextResponse>>());
                return res.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(matches!(generateResponse.CiphertextBlob().as_ref(), Some{ .. }) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_CiphertextType(generateResponse.CiphertextBlob().value()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: string_utf16_of("Invalid response from AWS KMS GenerateDataKey: Invalid ciphertext")
                        }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<GenerateDataKeyWithoutPlaintextResponse>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<Arc<GenerateDataKeyWithoutPlaintextResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                            value: generateResponse.clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(160,3)
        pub fn ReEncryptKey(ciphertext: &Sequence<u8>, sourceEncryptionContext: &BranchKeyContext, destinationEncryptionContext: &BranchKeyContext, kmsConfiguration: &Arc<KMSConfiguration>, grantTokens: &GrantTokenList, kmsClient: &Object<dyn IKMSClient>) -> Arc<Result<Arc<ReEncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<ReEncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>>::new();
            let mut kmsKeyArn: Sequence<DafnyCharUTF16> = _default::GetKeyId(kmsConfiguration);
            let mut reEncryptRequest: Arc<ReEncryptRequest> = Arc::new(ReEncryptRequest::ReEncryptRequest {
                        CiphertextBlob: ciphertext.clone(),
                        SourceEncryptionContext: Arc::new(Option::<BranchKeyContext>::Some {
                                    value: sourceEncryptionContext.clone()
                                }),
                        SourceKeyId: Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                    value: kmsKeyArn.clone()
                                }),
                        DestinationKeyId: kmsKeyArn.clone(),
                        DestinationEncryptionContext: Arc::new(Option::<BranchKeyContext>::Some {
                                    value: destinationEncryptionContext.clone()
                                }),
                        SourceEncryptionAlgorithm: Arc::new(Option::<Arc<EncryptionAlgorithmSpec>>::None {}),
                        DestinationEncryptionAlgorithm: Arc::new(Option::<Arc<EncryptionAlgorithmSpec>>::None {}),
                        GrantTokens: Arc::new(Option::<GrantTokenList>::Some {
                                    value: grantTokens.clone()
                                }),
                        DryRun: Arc::new(Option::<bool>::None {})
                    });
            let mut maybeReEncryptResponse: Arc<Result<Arc<ReEncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<ReEncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = IKMSClient::ReEncrypt(rd!(kmsClient.clone()), &reEncryptRequest);
            maybeReEncryptResponse = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<ReEncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeReEncryptResponse.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsKms {
                                        ComAmazonawsKms: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<ReEncryptResponse>>());
                return res.read();
            };
            let mut reEncryptResponse: Arc<ReEncryptResponse> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(matches!(reEncryptResponse.SourceKeyId().as_ref(), Some{ .. }) && matches!(reEncryptResponse.KeyId().as_ref(), Some{ .. }) && reEncryptResponse.SourceKeyId().value().clone() == kmsKeyArn.clone() && reEncryptResponse.KeyId().value().clone() == kmsKeyArn.clone(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: string_utf16_of("Invalid response from KMS ReEncrypt:: Invalid Key Id")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<ReEncryptResponse>>());
                return res.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(matches!(reEncryptResponse.CiphertextBlob().as_ref(), Some{ .. }) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_CiphertextType(reEncryptResponse.CiphertextBlob().value()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: string_utf16_of("Invalid response from AWS KMS ReEncrypt: Invalid ciphertext.")
                        }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<ReEncryptResponse>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<Arc<ReEncryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                            value: reEncryptResponse.clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KMSKeystoreOperations.dfy(248,3)
        pub fn DecryptKey(encryptionContext: &BranchKeyContext, item: &BranchKeyItem, kmsConfiguration: &Arc<KMSConfiguration>, grantTokens: &GrantTokenList, kmsClient: &Object<dyn IKMSClient>) -> Arc<Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>>::new();
            let mut kmsKeyArn: Sequence<DafnyCharUTF16> = _default::GetArn(kmsConfiguration, &encryptionContext.get(&crate::implementation_from_dafny::_Structure_Compile::_default::KMS_FIELD()));
            let mut maybeDecryptResponse: Arc<Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = IKMSClient::Decrypt(rd!(kmsClient.clone()), &Arc::new(DecryptRequest::DecryptRequest {
                            CiphertextBlob: item.get(&crate::implementation_from_dafny::_Structure_Compile::_default::BRANCH_KEY_FIELD()).B().clone(),
                            EncryptionContext: Arc::new(Option::<BranchKeyContext>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            GrantTokens: Arc::new(Option::<GrantTokenList>::Some {
                                        value: grantTokens.clone()
                                    }),
                            KeyId: Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                        value: kmsKeyArn.clone()
                                    }),
                            EncryptionAlgorithm: Arc::new(Option::<Arc<EncryptionAlgorithmSpec>>::None {}),
                            Recipient: Arc::new(Option::<Arc<RecipientInfo>>::None {}),
                            DryRun: Arc::new(Option::<bool>::None {})
                        }));
            maybeDecryptResponse = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = maybeDecryptResponse.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::ComAmazonawsKms {
                                        ComAmazonawsKms: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<DecryptResponse>>());
                return output.read();
            };
            let mut decryptResponse: Arc<DecryptResponse> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>(matches!(decryptResponse.Plaintext().as_ref(), Some{ .. }) && 32 == truncate!(decryptResponse.Plaintext().value().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error::KeyStoreException {
                            message: string_utf16_of("Invalid response from AWS KMS Decrypt: Key is not 32 bytes.")
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<DecryptResponse>>());
                return output.read();
            };
            output = MaybePlacebo::from(Arc::new(Result::<Arc<DecryptResponse>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>::Success {
                            value: decryptResponse.clone()
                        }));
            return output.read();
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(12,1)
pub mod _KdfCtr_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::KdfCtrInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::HMAC::HMac;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::euclidian_division;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(28,3)
        pub fn KdfCounterMode(input: &Arc<KdfCtrInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>((input.digestAlgorithm().clone() == Arc::new(DigestAlgorithm::SHA_256 {}) || input.digestAlgorithm().clone() == Arc::new(DigestAlgorithm::SHA_384 {})) && (truncate!(input.ikm().cardinality(), u64) == 32 || truncate!(input.ikm().cardinality(), u64) == 48 || truncate!(input.ikm().cardinality(), u64) == 66) && matches!(input.nonce().as_ref(), Some{ .. }) && (truncate!(input.nonce().value().cardinality(), u64) == 16 || truncate!(input.nonce().value().cardinality(), u64) == 32) && (input.expectedLength().clone() == 32 || input.expectedLength().clone() == 64) && (0 < (input.expectedLength().clone() * 8) as u64 && ((input.expectedLength().clone() * 8) as u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64)), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("Kdf in Counter Mode input is invalid.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut ikm: Sequence<u8> = input.ikm().clone();
            let mut label_: Sequence<u8> = input.purpose().UnwrapOr(&(seq![] as Sequence<u8>));
            let mut info: Sequence<u8> = input.nonce().UnwrapOr(&(seq![] as Sequence<u8>));
            let mut okm: Sequence<u8> = seq![] as Sequence<u8>;
            let mut internalLength: u32 = (4 + truncate!(_default::SEPARATION_INDICATOR().cardinality(), u64) + 4) as u32;
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(true && crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add3(internalLength as u64, truncate!(label_.cardinality(), u64), truncate!(info.cardinality(), u64)) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("Input Length exceeds INT32_MAX_LIMIT")
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut lengthBits: Sequence<u8> = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq((input.expectedLength().clone() * 8) as u32);
            let mut explicitInfo: Sequence<u8> = label_.concat(&_default::SEPARATION_INDICATOR()).concat(&info).concat(&lengthBits);
            let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(4 + truncate!(explicitInfo.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("PRF input length exceeds INT32_MAX_LIMIT.")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut valueOrError3: Arc<Result<Sequence<u8>, Arc<Error>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>> = _default::RawDerive(&ikm, &explicitInfo, input.expectedLength().clone(), 0, input.digestAlgorithm());
            valueOrError3 = _out0.clone();
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            okm = valueOrError3.Extract();
            output = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: okm.clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(74,3)
        pub fn RawDerive(ikm: &Sequence<u8>, explicitInfo: &Sequence<u8>, length: i32, offset: i32, digestAlgorithm: &Arc<DigestAlgorithm>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Result<Object<HMac>, Arc<Error>>>;
            let mut _out0: Arc<Result<Object<HMac>, Arc<Error>>> = HMac::Build(digestAlgorithm);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut hmac: Object<HMac> = valueOrError0.Extract();
            rd!(hmac).Init(ikm);
            let mut macLengthBytes: i32 = crate::implementation_from_dafny::_Digest_Compile::_default::Length(digestAlgorithm) as i32;
            let mut iterations: i32 = truncate!(euclidian_division(int!(length + macLengthBytes - 1), int!(macLengthBytes)), i32);
            let mut buffer: Sequence<u8> = seq![] as Sequence<u8>;
            let mut i: Sequence<u8> = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(_default::COUNTER_START_VALUE());
            let mut _hi0: u64 = crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(iterations as u64, 1);
            for iteration in integer_range(1, _hi0).map(Into::<u64>::into) {
                rd!(hmac).BlockUpdate(&i);
                rd!(hmac).BlockUpdate(explicitInfo);
                let mut tmp: Sequence<u8>;
                let mut _out1: Sequence<u8> = rd!(hmac).GetResult();
                tmp = _out1.clone();
                buffer = buffer.concat(&tmp);
                let mut valueOrError1: Arc<Result<Sequence<u8>, Arc<Error>>> = _default::Increment(&i);
                if valueOrError1.IsFailure() {
                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                    return output.read();
                };
                i = valueOrError1.Extract();
            }
            let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(buffer.cardinality(), u64) >= length as u64, &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("Failed to derive key of requested length")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            output = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: buffer.take(&int!((&length).clone()))
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(121,3)
        pub fn Increment(x: &Sequence<u8>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            if x.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) < 255 {
                Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                        value: seq![x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) + 1]
                    })
            } else {
                if x.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) < 255 {
                    Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: seq![x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) + 1, 0]
                        })
                } else {
                    if x.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) < 255 {
                        Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                                value: seq![x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())), x.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) + 1, 0, 0]
                            })
                    } else {
                        if x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) < 255 {
                            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                                    value: seq![x.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) + 1, 0, 0, 0]
                                })
                        } else {
                            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Failure {
                                    error: Arc::new(Error::AwsCryptographicPrimitivesError {
                                                message: string_utf16_of("Unable to derive key material; may have exceeded limit.")
                                            })
                                })
                        }
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(22,3)
        pub fn SEPARATION_INDICATOR() -> Sequence<u8> {
            seq![0]
        }
        /// ../mpl/AwsCryptographyPrimitives/src/KDF/KdfCtr.dfy(23,3)
        pub fn COUNTER_START_VALUE() -> u32 {
            1
        }
    }
}
/// dafny/AwsEncryptionSdk/src/KeyDerivation.dfy(8,1)
pub mod _KeyDerivation_Compile {
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageId;
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExtractInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExpandInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::NetV4_0_0_RetryPolicy;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::dafny_runtime::seq;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// This should only be used for v1 algorithms
        /// dafny/AwsEncryptionSdk/src/KeyDerivation.dfy(30,3)
        pub fn DeriveKey(messageId: &MessageId, plaintextDataKey: &Sequence<u8>, suite: &Arc<AlgorithmSuiteInfo>, crypto: &Object<AtomicPrimitivesClient>, onNetV4Retry: bool) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut _source0: Arc<DerivationAlgorithm> = suite.kdf().clone();
            if matches!((&_source0).as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) {
                let mut ___mcc_h0: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::HKDF> = _source0.HKDF().clone();
                let mut hkdf: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::HKDF> = ___mcc_h0.clone();
                let mut hkdfInput: Arc<HkdfInput> = Arc::new(HkdfInput::HkdfInput {
                            digestAlgorithm: hkdf.hmac().clone(),
                            salt: Arc::new(Option::<Sequence<u8>>::None {}),
                            ikm: plaintextDataKey.clone(),
                            info: suite.binaryId().concat(messageId),
                            expectedLength: hkdf.outputKeyLength().clone()
                        });
                if onNetV4Retry {
                    hkdfInput = Arc::new(HkdfInput::HkdfInput {
                                digestAlgorithm: hkdf.hmac().clone(),
                                salt: Arc::new(Option::<Sequence<u8>>::None {}),
                                ikm: plaintextDataKey.clone(),
                                info: suite.binaryId().clone(),
                                expectedLength: hkdf.outputKeyLength().clone()
                            });
                };
                let mut maybeDerivedKey: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::Hkdf(rd!(crypto.clone()), &hkdfInput);
                maybeDerivedKey = _out0.clone();
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeDerivedKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                            Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                    Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                            AwsCryptographyPrimitives: e.clone()
                                        })
                                })
                        }));
                if valueOrError0.IsFailure() {
                    res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                    return res.read();
                };
                let mut derivedKey: Sequence<u8> = valueOrError0.Extract();
                res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                                value: Arc::new(ExpandedKeyMaterial::ExpandedKeyMaterial {
                                            dataKey: derivedKey.clone(),
                                            commitmentKey: Arc::new(Option::<Sequence<u8>>::None {})
                                        })
                            }));
                return res.read();
            } else {
                if matches!((&_source0).as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::IDENTITY{ .. }) {
                    let mut ___mcc_h2: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IDENTITY> = _source0.IDENTITY().clone();
                    let mut i: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IDENTITY> = ___mcc_h2.clone();
                    res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                                    value: Arc::new(ExpandedKeyMaterial::ExpandedKeyMaterial {
                                                dataKey: plaintextDataKey.clone(),
                                                commitmentKey: Arc::new(Option::<Sequence<u8>>::None {})
                                            })
                                }));
                    return res.read();
                } else {
                    let mut ___mcc_h4: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None> = _source0._None().clone();
                    let mut _None: Arc<DerivationAlgorithm> = suite.kdf().clone();
                    res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Failure {
                                    error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                                message: string_utf16_of("None is not a valid Key Derivation Function")
                                            })
                                }));
                    return res.read();
                }
            };
            return res.read();
        }
        /// This should only be used for v2 algorithms
        /// dafny/AwsEncryptionSdk/src/KeyDerivation.dfy(128,3)
        pub fn ExpandKeyMaterial(messageId: &MessageId, plaintextKey: &Sequence<u8>, suite: &Arc<AlgorithmSuiteInfo>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut digest: Arc<DigestAlgorithm> = suite.commitment().HKDF().hmac().clone();
            let mut info: Sequence<u8> = suite.binaryId().concat(&_default::KEY_LABEL());
            let mut hkdfExtractInput: Arc<HkdfExtractInput> = Arc::new(HkdfExtractInput::HkdfExtractInput {
                        digestAlgorithm: digest.clone(),
                        salt: Arc::new(Option::<MessageId>::Some {
                                    value: messageId.clone()
                                }),
                        ikm: plaintextKey.clone()
                    });
            let mut maybePseudoRandomKey: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::HkdfExtract(rd!(crypto.clone()), &hkdfExtractInput);
            maybePseudoRandomKey = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybePseudoRandomKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                return res.read();
            };
            let mut pseudoRandomKey: Sequence<u8> = valueOrError0.Extract();
            let mut encryptKeyInput: Arc<HkdfExpandInput> = Arc::new(HkdfExpandInput::HkdfExpandInput {
                        digestAlgorithm: digest.clone(),
                        prk: pseudoRandomKey.clone(),
                        info: info.clone(),
                        expectedLength: suite.kdf().HKDF().outputKeyLength().clone()
                    });
            let mut commitKeyInput: Arc<HkdfExpandInput>;
            let mut _dt__update__tmp_h0: Arc<HkdfExpandInput> = encryptKeyInput.clone();
            let mut _dt__update_hexpectedLength_h0: PositiveInteger = suite.commitment().HKDF().outputKeyLength().clone();
            let mut _dt__update_hinfo_h0: Sequence<u8> = _default::COMMIT_LABEL();
            commitKeyInput = Arc::new(HkdfExpandInput::HkdfExpandInput {
                        digestAlgorithm: _dt__update__tmp_h0.digestAlgorithm().clone(),
                        prk: _dt__update__tmp_h0.prk().clone(),
                        info: _dt__update_hinfo_h0.clone(),
                        expectedLength: _dt__update_hexpectedLength_h0
                    });
            let mut maybeEncryptKey: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::HkdfExpand(rd!(crypto.clone()), &encryptKeyInput);
            maybeEncryptKey = _out1.clone();
            let mut maybeCommitKey: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::HkdfExpand(rd!(crypto.clone()), &commitKeyInput);
            maybeCommitKey = _out2.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeEncryptKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                return res.read();
            };
            let mut encryptKey: Sequence<u8> = valueOrError1.Extract();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeCommitKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                return res.read();
            };
            let mut commitKey: Sequence<u8> = valueOrError2.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: Arc::new(ExpandedKeyMaterial::ExpandedKeyMaterial {
                                        dataKey: encryptKey.clone(),
                                        commitmentKey: Arc::new(Option::<Sequence<u8>>::Some {
                                                    value: commitKey.clone()
                                                })
                                    })
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/KeyDerivation.dfy(221,3)
        pub fn DeriveKeys(messageId: &MessageId, plaintextKey: &Sequence<u8>, suite: &Arc<AlgorithmSuiteInfo>, crypto: &Object<AtomicPrimitivesClient>, netV4_0_0_RetryPolicy: &Arc<NetV4_0_0_RetryPolicy>, onNetV4Retry: bool) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut keys = MaybePlacebo::<Arc<ExpandedKeyMaterial>>::new();
            if suite.messageVersion().clone() == 2 {
                let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(matches!(suite.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) && suite.kdf().clone() == suite.commitment().clone(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                message: string_utf16_of("Suites with message version 2 must have commitment")
                            }));
                if valueOrError0.IsFailure() {
                    res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                    return res.read();
                };
                let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(suite) == suite.kdf().HKDF().outputKeyLength().clone() && truncate!(plaintextKey.cardinality(), i32) == suite.kdf().HKDF().inputKeyLength().clone(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                message: string_utf16_of("Invalid Materials")
                            }));
                if valueOrError1.IsFailure() {
                    res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                    return res.read();
                };
                let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::ExpandKeyMaterial(messageId, plaintextKey, suite, crypto);
                valueOrError2 = _out0.clone();
                if valueOrError2.IsFailure() {
                    res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                    return res.read();
                };
                keys = MaybePlacebo::from(valueOrError2.Extract());
            } else {
                if suite.messageVersion().clone() == 1 {
                    let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(matches!(suite.commitment().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                    message: string_utf16_of("Suites with message version 1 must not have commitment")
                                }));
                    if valueOrError3.IsFailure() {
                        res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                        return res.read();
                    };
                    let mut valueOrError4: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>((&({
                                let mut plaintextKey = plaintextKey.clone();
                                let mut suite = suite.clone();
                                Arc::new(move |_source0: &Arc<DerivationAlgorithm>| -> bool{
                                        if matches!(_source0.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF{ .. }) {
                                            let mut ___mcc_h0: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::HKDF> = _source0.HKDF().clone();
                                            let mut hkdf: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::HKDF> = ___mcc_h0.clone();
                                            truncate!(plaintextKey.cardinality(), i32) == suite.kdf().HKDF().inputKeyLength().clone() && suite.kdf().HKDF().outputKeyLength().clone() == crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(&suite)
                                        } else {
                                            if matches!(_source0.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::IDENTITY{ .. }) {
                                                let mut ___mcc_h2: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IDENTITY> = _source0.IDENTITY().clone();
                                                let mut i: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IDENTITY> = ___mcc_h2.clone();
                                                truncate!(plaintextKey.cardinality(), i32) == crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetEncryptKeyLength(&suite)
                                            } else {
                                                let mut ___mcc_h4: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None> = _source0._None().clone();
                                                let mut _None: Arc<DerivationAlgorithm> = suite.kdf().clone();
                                                false
                                            }
                                        }
                                    })
                            }))(suite.kdf()), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                    message: string_utf16_of("Suites with message version 1 must not have commitment")
                                }));
                    if valueOrError4.IsFailure() {
                        res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                        return res.read();
                    };
                    if netV4_0_0_RetryPolicy.clone() == Arc::new(NetV4_0_0_RetryPolicy::ALLOW_RETRY {}) && onNetV4Retry {
                        let mut valueOrError5: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                        let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::DeriveKey(messageId, plaintextKey, suite, crypto, true);
                        valueOrError5 = _out1.clone();
                        if valueOrError5.IsFailure() {
                            res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                            return res.read();
                        };
                        keys = MaybePlacebo::from(valueOrError5.Extract());
                    } else {
                        let mut valueOrError6: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                        let mut _out2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::DeriveKey(messageId, plaintextKey, suite, crypto, false);
                        valueOrError6 = _out2.clone();
                        if valueOrError6.IsFailure() {
                            res = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<ExpandedKeyMaterial>>());
                            return res.read();
                        };
                        keys = MaybePlacebo::from(valueOrError6.Extract());
                    }
                } else {
                    res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Failure {
                                    error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                                message: string_utf16_of("Unknown message version")
                                            })
                                }));
                    return res.read();
                }
            };
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<ExpandedKeyMaterial>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: keys.read()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/KeyDerivation.dfy(114,3)
        pub fn KEY_LABEL() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![68, 69, 82, 73, 86, 69, 75, 69, 89];
            s.clone()
        }
        /// dafny/AwsEncryptionSdk/src/KeyDerivation.dfy(109,3)
        pub fn COMMIT_LABEL() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![67, 79, 77, 77, 73, 84, 75, 69, 89];
            s.clone()
        }
    }

    /// dafny/AwsEncryptionSdk/src/KeyDerivation.dfy(21,3)
    #[derive(PartialEq, Clone)]
    pub enum ExpandedKeyMaterial {
        ExpandedKeyMaterial {
            dataKey: Sequence<u8>,
            commitmentKey: Arc<Option<Sequence<u8>>>
        }
    }

    impl ExpandedKeyMaterial {
        /// Returns a borrow of the field dataKey
        pub fn dataKey(&self) -> &Sequence<u8> {
            match self {
                ExpandedKeyMaterial::ExpandedKeyMaterial{dataKey, commitmentKey, } => dataKey,
            }
        }
        /// Returns a borrow of the field commitmentKey
        pub fn commitmentKey(&self) -> &Arc<Option<Sequence<u8>>> {
            match self {
                ExpandedKeyMaterial::ExpandedKeyMaterial{dataKey, commitmentKey, } => commitmentKey,
            }
        }
    }

    impl Debug
        for ExpandedKeyMaterial {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for ExpandedKeyMaterial {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                ExpandedKeyMaterial::ExpandedKeyMaterial{dataKey, commitmentKey, } => {
                    write!(_formatter, "KeyDerivation_Compile.ExpandedKeyMaterial.ExpandedKeyMaterial(")?;
                    DafnyPrint::fmt_print(dataKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(commitmentKey, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for ExpandedKeyMaterial {}

    impl Hash
        for ExpandedKeyMaterial {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                ExpandedKeyMaterial::ExpandedKeyMaterial{dataKey, commitmentKey, } => {
                    Hash::hash(dataKey, _state);
                    Hash::hash(commitmentKey, _state)
                },
            }
        }
    }

    impl Default
        for ExpandedKeyMaterial {
        fn default() -> ExpandedKeyMaterial {
            ExpandedKeyMaterial::ExpandedKeyMaterial {
                dataKey: Default::default(),
                commitmentKey: Default::default()
            }
        }
    }

    impl AsRef<ExpandedKeyMaterial>
        for ExpandedKeyMaterial {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(4,1)
pub mod _KeyStoreErrorMessages_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::string_utf16_of;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(11,3)
        pub fn GET_KEY_ARN_DISAGREEMENT() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("Branch key's KMS Key ARN read from Dynamodb does not match Key Store's configured KMS Key ARN.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(24,3)
        pub fn VERSION_KEY_KMS_KEY_ARN_DISAGREEMENT() -> Sequence<DafnyCharUTF16> {
            _default::GET_KEY_ARN_DISAGREEMENT()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(5,3)
        pub fn KMS_CONFIG_KMS_ARN_INVALID() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("KMSConfiguration's KMS Key ARN is invalid.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(8,3)
        pub fn CUSTOM_BRANCH_KEY_ID_NEED_EC() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("Custom branch key identifier requires custom encryption context.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(14,3)
        pub fn DISCOVERY_CREATE_KEY_NOT_SUPPORTED() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("Key Store's kmsConfiguration MUST BE kmsKeyArn or kmsMRKeyArn to Create Branch Keys.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(17,3)
        pub fn DISCOVERY_VERSION_KEY_NOT_SUPPORTED() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("Key Store's kmsConfiguration MUST BE kmsKeyArn or kmsMRKeyArn to Version Branch Keys.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(20,3)
        pub fn UTF8_ENCODING_ENCRYPTION_CONTEXT_ERROR() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("Unable to UTF8 Encode element of Encryption Context.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(27,3)
        pub fn ALIAS_NOT_ALLOWED() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("Key Store encountered a KMS Alias ARN instead of a KMS Key ARN, which is not allowed.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(30,3)
        pub fn NO_CORRESPONDING_BRANCH_KEY() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("No item found for corresponding branch key identifier.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(33,3)
        pub fn BRANCH_KEY_ID_NEEDED() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("Empty string not supported for branch key identifier.")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/ErrorMessages.dfy(37,3)
        pub fn RETRIEVED_KEYSTORE_ITEM_INVALID_KMS_ARN() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("The `kms-arn` field for the requested branch key identifier is corrupted.")
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyring.dfy(7,1)
pub mod _Keyring_Compile {
    pub use ::dafny_runtime::Any;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::UpcastObject;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyring.dfy(12,3)
    pub trait VerifiableInterface: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> + IKeyring + UpcastObject<dyn IKeyring> {}
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KmsArn.dfy(8,1)
pub mod _KmsArn_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsArn;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KmsArn.dfy(16,3)
        pub fn _ValidKmsArn_q(input: &Sequence<DafnyCharUTF16>) -> bool {
            crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(input) && ({
                    let __pat_let17_0: Arc<Result<AwsKmsArn, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(input);
                    {
                        let maybeParsed: Arc<Result<AwsKmsArn, Sequence<DafnyCharUTF16>>> = __pat_let17_0.clone();
                        matches!((&maybeParsed).as_ref(), Success{ .. }) && maybeParsed.value().resource().resourceType().clone() == string_utf16_of("key")
                    }
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/KmsArn.dfy(24,3)
        pub fn IsValidKeyArn(input: &Sequence<DafnyCharUTF16>) -> Arc<Result<AwsKmsArn, Arc<Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(input), &Arc::new(Error::KeyStoreException {
                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::KMS_CONFIG_KMS_ARN_INVALID()
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<AwsKmsArn>()
            } else {
                let mut valueOrError1: Arc<Result<AwsKmsArn, Arc<Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::ParseAwsKmsArn(input).MapFailure::<Arc<Error>>(&({
                            Arc::new(move |error: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                    Arc::new(Error::KeyStoreException {
                                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::KMS_CONFIG_KMS_ARN_INVALID().concat(&string_utf16_of(". ")).concat(error)
                                        })
                                })
                        }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<AwsKmsArn>()
                } else {
                    let mut arn: AwsKmsArn = valueOrError1.Extract();
                    if arn.resource().resourceType().clone() != string_utf16_of("key") {
                        Arc::new(Result::<AwsKmsArn, Arc<Error>>::Failure {
                                error: Arc::new(Error::KeyStoreException {
                                            message: crate::implementation_from_dafny::_KeyStoreErrorMessages_Compile::_default::ALIAS_NOT_ALLOWED()
                                        })
                            })
                    } else {
                        Arc::new(Result::<AwsKmsArn, Arc<Error>>::Success {
                                value: arn.clone()
                            })
                    }
                }
            }
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(7,1)
pub mod _LocalCMC_Compile {
    pub use ::dafny_runtime::DafnyTypeEq;
    pub use ::dafny_runtime::Map;
    pub use ::dafny_runtime::set;
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::DafnyType;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Materials;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveInteger;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::update_field_mut_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use ::dafny_runtime::read_field;
    pub use crate::implementation_from_dafny::_LocalCMC_Compile::Ref::Ptr;
    pub use ::dafny_runtime::modify_field;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::_LocalCMC_Compile::Ref::Null;
    pub use crate::implementation_from_dafny::DafnyLibraries::MutableMap;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::DafnyLibraries::MutableMapTrait;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DeleteCacheEntryInput;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PutCacheEntryInput;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::UpdateUsageMetadataInput;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(313,3)
        pub fn RemoveValue<_K: DafnyTypeEq, _V: DafnyTypeEq>(k0: &_K, m: &Map<_K, _V>) -> () {
            let mut _m_k: Map<_K, _V> = m.subtract(&set!{k0.clone()});
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(58,3)
        pub fn NULL() -> Arc<Ref<Object<CacheEntry>>> {
            Arc::new(Ref::<Object<CacheEntry>>::Null {})
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(59,3)
        pub fn INT32_MAX_VALUE() -> i32 {
            2040109465
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(60,3)
        pub fn INT64_MAX_VALUE() -> i64 {
            8762203435012037017
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(53,3)
    #[derive(PartialEq, Clone)]
    pub enum Ref<T: DafnyType> {
        Ptr {
            deref: T
        },
        Null {}
    }

    impl<T: DafnyType> Ref<T> {
        /// Gets the field deref for all enum members which have it
        pub fn deref(&self) -> &T {
            match self {
                Ref::Ptr{deref, } => deref,
                Ref::Null{} => panic!("field does not exist on this variant"),
            }
        }
    }

    impl<T: DafnyType> Debug
        for Ref<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for Ref<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Ref::Ptr{deref, } => {
                    write!(_formatter, "LocalCMC_Compile.Ref.Ptr(")?;
                    DafnyPrint::fmt_print(deref, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
                Ref::Null{} => {
                    write!(_formatter, "LocalCMC_Compile.Ref.Null")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType + Eq> Eq
        for Ref<T> {}

    impl<T: DafnyType + Hash> Hash
        for Ref<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Ref::Ptr{deref, } => {
                    Hash::hash(deref, _state)
                },
                Ref::Null{} => {

                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for Ref<T> {
        fn default() -> Ref<T> {
            Ref::Ptr {
                deref: Default::default()
            }
        }
    }

    impl<T: DafnyType> AsRef<Ref<T>>
        for Ref<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(62,3)
    pub struct CacheEntry {
        pub prev: ::dafny_runtime::Field<Arc<Ref<Object<CacheEntry>>>>,
        pub next: ::dafny_runtime::Field<Arc<Ref<Object<CacheEntry>>>>,
        pub messagesUsed: ::dafny_runtime::Field<PositiveInteger>,
        pub bytesUsed: ::dafny_runtime::Field<PositiveInteger>,
        pub __i_identifier: Sequence<u8>,
        pub __i_materials: Arc<Materials>,
        pub __i_creationTime: PositiveLong,
        pub __i_expiryTime: PositiveLong
    }

    impl CacheEntry {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(73,5)
        pub fn _ctor(this: &Object<CacheEntry>, _materials_k: &Arc<Materials>, _identifier_k: &Sequence<u8>, _creationTime_k: PositiveLong, _expiryTime_k: PositiveLong, _messagesUsed_k: PositiveInteger, _bytesUsed_k: PositiveInteger) -> () {
            let mut _set_prev: bool = false;
            let mut _set_next: bool = false;
            let mut _set_messagesUsed: bool = false;
            let mut _set_bytesUsed: bool = false;
            let mut _set___i_identifier: bool = false;
            let mut _set___i_materials: bool = false;
            let mut _set___i_creationTime: bool = false;
            let mut _set___i_expiryTime: bool = false;
            update_field_uninit_object!(this.clone(), __i_materials, _set___i_materials, _materials_k.clone());
            update_field_uninit_object!(this.clone(), __i_identifier, _set___i_identifier, _identifier_k.clone());
            update_field_uninit_object!(this.clone(), __i_creationTime, _set___i_creationTime, _creationTime_k);
            update_field_uninit_object!(this.clone(), __i_expiryTime, _set___i_expiryTime, _expiryTime_k);
            update_field_mut_uninit_object!(this.clone(), messagesUsed, _set_messagesUsed, _messagesUsed_k);
            update_field_mut_uninit_object!(this.clone(), bytesUsed, _set_bytesUsed, _bytesUsed_k);
            update_field_mut_uninit_object!(this.clone(), prev, _set_prev, _default::NULL());
            update_field_mut_uninit_object!(this.clone(), next, _set_next, _default::NULL());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(67,5)
        pub fn identifier(&self) -> Sequence<u8> {
            self.__i_identifier.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(66,5)
        pub fn materials(&self) -> Arc<Materials> {
            self.__i_materials.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(68,5)
        pub fn creationTime(&self) -> PositiveLong {
            self.__i_creationTime.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(69,5)
        pub fn expiryTime(&self) -> PositiveLong {
            self.__i_expiryTime.clone()
        }
    }

    impl UpcastObject<DynAny>
        for CacheEntry {
        UpcastObjectFn!(DynAny);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(103,3)
    pub struct DoublyLinkedCacheEntryList {
        pub head: ::dafny_runtime::Field<Arc<Ref<Object<CacheEntry>>>>,
        pub tail: ::dafny_runtime::Field<Arc<Ref<Object<CacheEntry>>>>
    }

    impl DoublyLinkedCacheEntryList {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(166,5)
        pub fn _ctor(this: &Object<DoublyLinkedCacheEntryList>) -> () {
            let mut _set_head: bool = false;
            let mut _set_tail: bool = false;
            update_field_mut_uninit_object!(this.clone(), head, _set_head, Arc::new(Ref::<Object<CacheEntry>>::Null {}));
            update_field_mut_uninit_object!(this.clone(), tail, _set_tail, Arc::new(Ref::<Object<CacheEntry>>::Null {}));
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(178,5)
        pub fn pushCell(&self, toPush: &Object<CacheEntry>) -> () {
            let mut cRef: Arc<Ref<Object<CacheEntry>>> = Arc::new(Ref::<Object<CacheEntry>>::Ptr {
                        deref: toPush.clone()
                    });
            if matches!((&read_field!(self.head)).as_ref(), Ptr{ .. }) {
                let mut _obj0: Object<CacheEntry> = read_field!(self.head).deref().clone();
                modify_field!(rd!(_obj0).prev, cRef.clone());
                modify_field!(rd!(toPush).next, read_field!(self.head));
                modify_field!(self.head, cRef.clone())
            } else {
                modify_field!(self.head, cRef.clone());
                modify_field!(self.tail, read_field!(self.head))
            };
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(198,5)
        pub fn moveToFront(&self, c: &Object<CacheEntry>) -> () {
            if read_field!(self.head).deref().clone() != c.clone() {
                let mut toPush: Arc<Ref<Object<CacheEntry>>> = Arc::new(Ref::<Object<CacheEntry>>::Ptr {
                            deref: c.clone()
                        });
                self.remove(c);
                if matches!((&read_field!(self.head)).as_ref(), Ptr{ .. }) {
                    let mut _obj0: Object<CacheEntry> = read_field!(self.head).deref().clone();
                    modify_field!(rd!(_obj0).prev, toPush.clone());
                    let mut _obj1: Object<CacheEntry> = toPush.deref().clone();
                    modify_field!(rd!(_obj1).next, read_field!(self.head));
                    modify_field!(self.head, toPush.clone())
                } else {
                    modify_field!(self.head, toPush.clone());
                    modify_field!(self.tail, read_field!(self.head))
                }
            };
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(230,5)
        pub fn remove(&self, toRemove: &Object<CacheEntry>) -> () {
            if matches!((&read_field!(rd!(toRemove.clone()).prev)).as_ref(), Null{ .. }) {
                modify_field!(self.head, read_field!(rd!(toRemove.clone()).next))
            } else {
                let mut _obj0: Object<CacheEntry> = read_field!(rd!(toRemove.clone()).prev).deref().clone();
                modify_field!(rd!(_obj0).next, read_field!(rd!(toRemove.clone()).next))
            };
            if matches!((&read_field!(rd!(toRemove.clone()).next)).as_ref(), Null{ .. }) {
                modify_field!(self.tail, read_field!(rd!(toRemove.clone()).prev))
            } else {
                let mut _obj1: Object<CacheEntry> = read_field!(rd!(toRemove.clone()).next).deref().clone();
                modify_field!(rd!(_obj1).prev, read_field!(rd!(toRemove.clone()).prev))
            };
            'label_goto_0: loop {
                break;
            };
            modify_field!(rd!(toRemove).next, _default::NULL());
            modify_field!(rd!(toRemove).prev, _default::NULL());
            return ();
        }
    }

    impl UpcastObject<DynAny>
        for DoublyLinkedCacheEntryList {
        UpcastObjectFn!(DynAny);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(328,3)
    pub struct LocalCMC {
        pub queue: ::dafny_runtime::Field<Object<DoublyLinkedCacheEntryList>>,
        pub cache: ::dafny_runtime::Field<Object<MutableMap<Sequence<u8>, Object<CacheEntry>>>>,
        pub __i_entryCapacity: u64,
        pub __i_entryPruningTailSize: u64
    }

    impl LocalCMC {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(394,5)
        pub fn _ctor(this: &Object<LocalCMC>, _entryCapacity_k: u64, _entryPruningTailSize_k: u64) -> () {
            let mut _set_queue: bool = false;
            let mut _set_cache: bool = false;
            let mut _set___i_entryCapacity: bool = false;
            let mut _set___i_entryPruningTailSize: bool = false;
            update_field_uninit_object!(this.clone(), __i_entryCapacity, _set___i_entryCapacity, _entryCapacity_k);
            update_field_uninit_object!(this.clone(), __i_entryPruningTailSize, _set___i_entryPruningTailSize, _entryPruningTailSize_k);
            let mut _nw0: Object<MutableMap<Sequence<u8>, Object<CacheEntry>>> = MutableMap::<Sequence<u8>, Object<CacheEntry>>::_allocate_object(true);
            update_field_mut_uninit_object!(this.clone(), cache, _set_cache, _nw0.clone());
            let mut _nw1: Object<DoublyLinkedCacheEntryList> = DoublyLinkedCacheEntryList::_allocate_object();
            DoublyLinkedCacheEntryList::_ctor(&_nw1);
            update_field_mut_uninit_object!(this.clone(), queue, _set_queue, _nw1.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(435,5)
        pub fn GetCacheEntryWithTime(&self, input: &Arc<GetCacheEntryInput>, now: PositiveLong) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<Error>>>>::new();
            if MutableMapTrait::<Sequence<u8>, Object<CacheEntry>>::HasKey(rd!(read_field!(self.cache)), input.identifier()) {
                let mut entry: Object<CacheEntry> = MutableMapTrait::<Sequence<u8>, Object<CacheEntry>>::Select(rd!(read_field!(self.cache)), input.identifier());
                if now <= rd!(entry.clone()).expiryTime().clone() {
                    rd!(read_field!(self.queue)).moveToFront(&entry);
                    output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GetCacheEntryOutput>, Arc<Error>>::Success {
                                    value: Arc::new(GetCacheEntryOutput::GetCacheEntryOutput {
                                                materials: rd!(entry.clone()).materials().clone(),
                                                creationTime: rd!(entry.clone()).creationTime().clone(),
                                                expiryTime: rd!(entry.clone()).expiryTime().clone(),
                                                messagesUsed: read_field!(rd!(entry.clone()).messagesUsed),
                                                bytesUsed: read_field!(rd!(entry.clone()).bytesUsed)
                                            })
                                }));
                    let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>;
                    let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> = self.pruning(now);
                    valueOrError0 = _out0.clone();
                    if valueOrError0.IsFailure() {
                        output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GetCacheEntryOutput>>());
                        return output.read();
                    };
                    let mut _v0: () = valueOrError0.Extract();
                } else {
                    let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>;
                    let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> = ICryptographicMaterialsCache::_DeleteCacheEntry_k(rd!(Object::<_>::from_ref(self)), &Arc::new(DeleteCacheEntryInput::DeleteCacheEntryInput {
                                    identifier: input.identifier().clone()
                                }));
                    valueOrError1 = _out1.clone();
                    if valueOrError1.IsFailure() {
                        output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GetCacheEntryOutput>>());
                        return output.read();
                    };
                    let mut _v1: () = valueOrError1.Extract();
                    output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GetCacheEntryOutput>, Arc<Error>>::Failure {
                                    error: Arc::new(Error::EntryDoesNotExist {
                                                message: string_utf16_of("Entry past TTL")
                                            })
                                }));
                }
            } else {
                output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GetCacheEntryOutput>, Arc<Error>>::Failure {
                                error: Arc::new(Error::EntryDoesNotExist {
                                            message: string_utf16_of("Entry does not exist")
                                        })
                            }));
            };
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(684,5)
        pub fn pruning(&self, now: PositiveLong) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>>::new();
            let mut _hi0: u64 = self.entryPruningTailSize().clone();
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                if matches!((&read_field!(rd!(read_field!(self.queue).clone()).tail)).as_ref(), Ptr{ .. }) {
                    if rd!(read_field!(rd!(read_field!(self.queue).clone()).tail).deref().clone()).expiryTime().clone() < now {
                        let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>;
                        let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> = ICryptographicMaterialsCache::_DeleteCacheEntry_k(rd!(Object::<_>::from_ref(self)), &Arc::new(DeleteCacheEntryInput::DeleteCacheEntryInput {
                                        identifier: rd!(read_field!(rd!(read_field!(self.queue).clone()).tail).deref().clone()).identifier().clone()
                                    }));
                        valueOrError0 = _out0.clone();
                        if valueOrError0.IsFailure() {
                            output = MaybePlacebo::from(valueOrError0.PropagateFailure::<()>());
                            return output.read();
                        };
                        let mut _v5: () = valueOrError0.Extract();
                    } else {
                        output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<Error>>::Success {
                                        value: ()
                                    }));
                        return output.read();
                    }
                } else {
                    output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<Error>>::Success {
                                    value: ()
                                }));
                    return output.read();
                }
            }
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<Error>>::Success {
                            value: ()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(376,5)
        pub fn entryCapacity(&self) -> u64 {
            self.__i_entryCapacity.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(383,5)
        pub fn entryPruningTailSize(&self) -> u64 {
            self.__i_entryPruningTailSize.clone()
        }
    }

    impl UpcastObject<DynAny>
        for LocalCMC {
        UpcastObjectFn!(DynAny);
    }

    impl ICryptographicMaterialsCache
        for LocalCMC {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(421,5)
        fn _GetCacheEntry_k(&self, input: &Arc<GetCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<Error>>>;
            let mut now: i64;
            let mut _out0: i64 = crate::implementation_from_dafny::Time::_default::CurrentRelativeTime();
            now = _out0;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<Error>>> = self.GetCacheEntryWithTime(input, now);
            output = _out1.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(488,5)
        fn _PutCacheEntry_k(&self, input: &Arc<PutCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>>::new();
            if self.entryCapacity().clone() == 0 {
                output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<Error>>::Success {
                                value: ()
                            }));
                return output.read();
            };
            if MutableMapTrait::<Sequence<u8>, Object<CacheEntry>>::HasKey(rd!(read_field!(self.cache)), input.identifier()) {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> = ICryptographicMaterialsCache::_DeleteCacheEntry_k(rd!(Object::<_>::from_ref(self)), &Arc::new(DeleteCacheEntryInput::DeleteCacheEntryInput {
                                identifier: input.identifier().clone()
                            }));
                valueOrError0 = _out0.clone();
                if valueOrError0.IsFailure() {
                    output = MaybePlacebo::from(valueOrError0.PropagateFailure::<()>());
                    return output.read();
                };
                let mut _v2: () = valueOrError0.Extract();
            };
            if self.entryCapacity().clone() == truncate!(MutableMapTrait::<Sequence<u8>, Object<CacheEntry>>::Size(rd!(read_field!(self.cache))), u64) {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>;
                let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> = ICryptographicMaterialsCache::_DeleteCacheEntry_k(rd!(Object::<_>::from_ref(self)), &Arc::new(DeleteCacheEntryInput::DeleteCacheEntryInput {
                                identifier: rd!(read_field!(rd!(read_field!(self.queue).clone()).tail).deref().clone()).identifier().clone()
                            }));
                valueOrError1 = _out1.clone();
                if valueOrError1.IsFailure() {
                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<()>());
                    return output.read();
                };
                let mut _v3: () = valueOrError1.Extract();
            };
            let mut cell: Object<CacheEntry>;
            let mut _nw0: Object<CacheEntry> = CacheEntry::_allocate_object();
            CacheEntry::_ctor(&_nw0, input.materials(), input.identifier(), input.creationTime().clone(), input.expiryTime().clone(), input.messagesUsed().UnwrapOr(&truncate!((&int!(0)).clone(), i32)), input.bytesUsed().UnwrapOr(&truncate!((&int!(0)).clone(), i32)));
            cell = _nw0.clone();
            rd!(read_field!(self.queue)).pushCell(&cell);
            MutableMapTrait::<Sequence<u8>, Object<CacheEntry>>::Put(rd!(read_field!(self.cache)), input.identifier(), &cell);
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<Error>>::Success {
                            value: ()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(598,5)
        fn _DeleteCacheEntry_k(&self, input: &Arc<DeleteCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>;
            if MutableMapTrait::<Sequence<u8>, Object<CacheEntry>>::HasKey(rd!(read_field!(self.cache)), input.identifier()) {
                let mut cell: Object<CacheEntry> = MutableMapTrait::<Sequence<u8>, Object<CacheEntry>>::Select(rd!(read_field!(self.cache)), input.identifier());
                'label_goto_1: loop {
                    MutableMapTrait::<Sequence<u8>, Object<CacheEntry>>::Remove(rd!(read_field!(self.cache)), input.identifier());
                    break;
                };
                rd!(read_field!(self.queue)).remove(&cell)
            };
            output = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<Error>>::Success {
                        value: ()
                    });
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/LocalCMC.dfy(648,5)
        fn _UpdateUsageMetadata_k(&self, input: &Arc<UpdateUsageMetadataInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>>::new();
            if MutableMapTrait::<Sequence<u8>, Object<CacheEntry>>::HasKey(rd!(read_field!(self.cache)), input.identifier()) {
                let mut cell: Object<CacheEntry> = MutableMapTrait::<Sequence<u8>, Object<CacheEntry>>::Select(rd!(read_field!(self.cache)), input.identifier());
                if read_field!(rd!(cell.clone()).messagesUsed) <= _default::INT32_MAX_VALUE() - 1 && read_field!(rd!(cell.clone()).bytesUsed) <= _default::INT32_MAX_VALUE() - input.bytesUsed().clone() {
                    let mut _rhs0: i32 = read_field!(rd!(cell.clone()).messagesUsed) + 1;
                    let mut _rhs1: i32 = read_field!(rd!(cell.clone()).bytesUsed) + input.bytesUsed().clone();
                    let mut _lhs0: Object<CacheEntry> = cell.clone();
                    let mut _lhs1: Object<CacheEntry> = cell.clone();
                    modify_field!(rd!(_lhs0).messagesUsed, _rhs0);
                    modify_field!(rd!(_lhs1).bytesUsed, _rhs1)
                } else {
                    let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>;
                    let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> = ICryptographicMaterialsCache::_DeleteCacheEntry_k(rd!(Object::<_>::from_ref(self)), &Arc::new(DeleteCacheEntryInput::DeleteCacheEntryInput {
                                    identifier: input.identifier().clone()
                                }));
                    valueOrError0 = _out0.clone();
                    if valueOrError0.IsFailure() {
                        output = MaybePlacebo::from(valueOrError0.PropagateFailure::<()>());
                        return output.read();
                    };
                    let mut _v4: () = valueOrError0.Extract();
                }
            };
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<(), Arc<Error>>::Success {
                            value: ()
                        }));
            return output.read();
        }
    }

    impl UpcastObject<dyn ICryptographicMaterialsCache>
        for LocalCMC {
        UpcastObjectFn!(dyn ICryptographicMaterialsCache);
    }
}
/// ../mpl/libraries/src/NonlinearArithmetic/Logarithm.dfy(7,1)
pub mod _Logarithm_Compile {
    pub use ::dafny_runtime::_System::nat;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::euclidian_division;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/NonlinearArithmetic/Logarithm.dfy(12,3)
        pub fn Log(base: &nat, pow: &nat) -> nat {
            let mut _accumulator: nat = int!(0);
            let mut _r0 = base.clone();
            let mut _r1 = pow.clone();
            'TAIL_CALL_START: loop {
                let base = _r0;
                let pow = _r1;
                if pow.clone() < base.clone() {
                    return int!(0) + _accumulator.clone();
                } else {
                    _accumulator = _accumulator.clone() + int!(1);
                    let mut _in0: nat = base.clone();
                    let mut _in1: DafnyInt = euclidian_division(pow.clone(), base.clone());
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(11,1)
pub mod _MaterialWrapping_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use ::dafny_runtime::DafnyType;
    pub use ::dafny_runtime::Any;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::UpcastObject;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(22,3)
    #[derive(PartialEq, Clone)]
    pub enum GenerateAndWrapInput {
        GenerateAndWrapInput {
            algorithmSuite: Arc<AlgorithmSuiteInfo>,
            encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
            serializedEC: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>
        }
    }

    impl GenerateAndWrapInput {
        /// Returns a borrow of the field algorithmSuite
        pub fn algorithmSuite(&self) -> &Arc<AlgorithmSuiteInfo> {
            match self {
                GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, serializedEC, } => algorithmSuite,
            }
        }
        /// Returns a borrow of the field encryptionContext
        pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
            match self {
                GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, serializedEC, } => encryptionContext,
            }
        }
        /// Returns a borrow of the field serializedEC
        pub fn serializedEC(&self) -> &Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            match self {
                GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, serializedEC, } => serializedEC,
            }
        }
    }

    impl Debug
        for GenerateAndWrapInput {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for GenerateAndWrapInput {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, serializedEC, } => {
                    write!(_formatter, "MaterialWrapping_Compile.GenerateAndWrapInput.GenerateAndWrapInput(")?;
                    DafnyPrint::fmt_print(algorithmSuite, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(serializedEC, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for GenerateAndWrapInput {}

    impl Hash
        for GenerateAndWrapInput {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                GenerateAndWrapInput::GenerateAndWrapInput{algorithmSuite, encryptionContext, serializedEC, } => {
                    Hash::hash(algorithmSuite, _state);
                    Hash::hash(encryptionContext, _state);
                    Hash::hash(serializedEC, _state)
                },
            }
        }
    }

    impl Default
        for GenerateAndWrapInput {
        fn default() -> GenerateAndWrapInput {
            GenerateAndWrapInput::GenerateAndWrapInput {
                algorithmSuite: Default::default(),
                encryptionContext: Default::default(),
                serializedEC: Default::default()
            }
        }
    }

    impl AsRef<GenerateAndWrapInput>
        for GenerateAndWrapInput {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(28,3)
    #[derive(PartialEq, Clone)]
    pub enum GenerateAndWrapOutput<T: DafnyType> {
        GenerateAndWrapOutput {
            plaintextMaterial: Sequence<u8>,
            wrappedMaterial: Sequence<u8>,
            wrapInfo: T
        }
    }

    impl<T: DafnyType> GenerateAndWrapOutput<T> {
        /// Returns a borrow of the field plaintextMaterial
        pub fn plaintextMaterial(&self) -> &Sequence<u8> {
            match self {
                GenerateAndWrapOutput::GenerateAndWrapOutput{plaintextMaterial, wrappedMaterial, wrapInfo, } => plaintextMaterial,
            }
        }
        /// Returns a borrow of the field wrappedMaterial
        pub fn wrappedMaterial(&self) -> &Sequence<u8> {
            match self {
                GenerateAndWrapOutput::GenerateAndWrapOutput{plaintextMaterial, wrappedMaterial, wrapInfo, } => wrappedMaterial,
            }
        }
        /// Returns a borrow of the field wrapInfo
        pub fn wrapInfo(&self) -> &T {
            match self {
                GenerateAndWrapOutput::GenerateAndWrapOutput{plaintextMaterial, wrappedMaterial, wrapInfo, } => wrapInfo,
            }
        }
    }

    impl<T: DafnyType> Debug
        for GenerateAndWrapOutput<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for GenerateAndWrapOutput<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                GenerateAndWrapOutput::GenerateAndWrapOutput{plaintextMaterial, wrappedMaterial, wrapInfo, } => {
                    write!(_formatter, "MaterialWrapping_Compile.GenerateAndWrapOutput.GenerateAndWrapOutput(")?;
                    DafnyPrint::fmt_print(plaintextMaterial, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(wrappedMaterial, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(wrapInfo, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType + Eq> Eq
        for GenerateAndWrapOutput<T> {}

    impl<T: DafnyType + Hash> Hash
        for GenerateAndWrapOutput<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                GenerateAndWrapOutput::GenerateAndWrapOutput{plaintextMaterial, wrappedMaterial, wrapInfo, } => {
                    Hash::hash(plaintextMaterial, _state);
                    Hash::hash(wrappedMaterial, _state);
                    Hash::hash(wrapInfo, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for GenerateAndWrapOutput<T> {
        fn default() -> GenerateAndWrapOutput<T> {
            GenerateAndWrapOutput::GenerateAndWrapOutput {
                plaintextMaterial: Default::default(),
                wrappedMaterial: Default::default(),
                wrapInfo: Default::default()
            }
        }
    }

    impl<T: DafnyType> AsRef<GenerateAndWrapOutput<T>>
        for GenerateAndWrapOutput<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(34,3)
    #[derive(PartialEq, Clone)]
    pub enum WrapInput {
        WrapInput {
            plaintextMaterial: Sequence<u8>,
            algorithmSuite: Arc<AlgorithmSuiteInfo>,
            encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
            serializedEC: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>
        }
    }

    impl WrapInput {
        /// Returns a borrow of the field plaintextMaterial
        pub fn plaintextMaterial(&self) -> &Sequence<u8> {
            match self {
                WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => plaintextMaterial,
            }
        }
        /// Returns a borrow of the field algorithmSuite
        pub fn algorithmSuite(&self) -> &Arc<AlgorithmSuiteInfo> {
            match self {
                WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => algorithmSuite,
            }
        }
        /// Returns a borrow of the field encryptionContext
        pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
            match self {
                WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => encryptionContext,
            }
        }
        /// Returns a borrow of the field serializedEC
        pub fn serializedEC(&self) -> &Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            match self {
                WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => serializedEC,
            }
        }
    }

    impl Debug
        for WrapInput {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for WrapInput {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => {
                    write!(_formatter, "MaterialWrapping_Compile.WrapInput.WrapInput(")?;
                    DafnyPrint::fmt_print(plaintextMaterial, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(algorithmSuite, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(serializedEC, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for WrapInput {}

    impl Hash
        for WrapInput {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                WrapInput::WrapInput{plaintextMaterial, algorithmSuite, encryptionContext, serializedEC, } => {
                    Hash::hash(plaintextMaterial, _state);
                    Hash::hash(algorithmSuite, _state);
                    Hash::hash(encryptionContext, _state);
                    Hash::hash(serializedEC, _state)
                },
            }
        }
    }

    impl Default
        for WrapInput {
        fn default() -> WrapInput {
            WrapInput::WrapInput {
                plaintextMaterial: Default::default(),
                algorithmSuite: Default::default(),
                encryptionContext: Default::default(),
                serializedEC: Default::default()
            }
        }
    }

    impl AsRef<WrapInput>
        for WrapInput {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(41,3)
    #[derive(PartialEq, Clone)]
    pub enum WrapOutput<T: DafnyType> {
        WrapOutput {
            wrappedMaterial: Sequence<u8>,
            wrapInfo: T
        }
    }

    impl<T: DafnyType> WrapOutput<T> {
        /// Returns a borrow of the field wrappedMaterial
        pub fn wrappedMaterial(&self) -> &Sequence<u8> {
            match self {
                WrapOutput::WrapOutput{wrappedMaterial, wrapInfo, } => wrappedMaterial,
            }
        }
        /// Returns a borrow of the field wrapInfo
        pub fn wrapInfo(&self) -> &T {
            match self {
                WrapOutput::WrapOutput{wrappedMaterial, wrapInfo, } => wrapInfo,
            }
        }
    }

    impl<T: DafnyType> Debug
        for WrapOutput<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for WrapOutput<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                WrapOutput::WrapOutput{wrappedMaterial, wrapInfo, } => {
                    write!(_formatter, "MaterialWrapping_Compile.WrapOutput.WrapOutput(")?;
                    DafnyPrint::fmt_print(wrappedMaterial, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(wrapInfo, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType + Eq> Eq
        for WrapOutput<T> {}

    impl<T: DafnyType + Hash> Hash
        for WrapOutput<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                WrapOutput::WrapOutput{wrappedMaterial, wrapInfo, } => {
                    Hash::hash(wrappedMaterial, _state);
                    Hash::hash(wrapInfo, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for WrapOutput<T> {
        fn default() -> WrapOutput<T> {
            WrapOutput::WrapOutput {
                wrappedMaterial: Default::default(),
                wrapInfo: Default::default()
            }
        }
    }

    impl<T: DafnyType> AsRef<WrapOutput<T>>
        for WrapOutput<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(46,3)
    #[derive(PartialEq, Clone)]
    pub enum UnwrapInput {
        UnwrapInput {
            wrappedMaterial: Sequence<u8>,
            algorithmSuite: Arc<AlgorithmSuiteInfo>,
            encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>,
            serializedEC: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>>
        }
    }

    impl UnwrapInput {
        /// Returns a borrow of the field wrappedMaterial
        pub fn wrappedMaterial(&self) -> &Sequence<u8> {
            match self {
                UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => wrappedMaterial,
            }
        }
        /// Returns a borrow of the field algorithmSuite
        pub fn algorithmSuite(&self) -> &Arc<AlgorithmSuiteInfo> {
            match self {
                UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => algorithmSuite,
            }
        }
        /// Returns a borrow of the field encryptionContext
        pub fn encryptionContext(&self) -> &Map<ValidUTF8Bytes, ValidUTF8Bytes> {
            match self {
                UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => encryptionContext,
            }
        }
        /// Returns a borrow of the field serializedEC
        pub fn serializedEC(&self) -> &Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            match self {
                UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => serializedEC,
            }
        }
    }

    impl Debug
        for UnwrapInput {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for UnwrapInput {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => {
                    write!(_formatter, "MaterialWrapping_Compile.UnwrapInput.UnwrapInput(")?;
                    DafnyPrint::fmt_print(wrappedMaterial, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(algorithmSuite, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(encryptionContext, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(serializedEC, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for UnwrapInput {}

    impl Hash
        for UnwrapInput {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                UnwrapInput::UnwrapInput{wrappedMaterial, algorithmSuite, encryptionContext, serializedEC, } => {
                    Hash::hash(wrappedMaterial, _state);
                    Hash::hash(algorithmSuite, _state);
                    Hash::hash(encryptionContext, _state);
                    Hash::hash(serializedEC, _state)
                },
            }
        }
    }

    impl Default
        for UnwrapInput {
        fn default() -> UnwrapInput {
            UnwrapInput::UnwrapInput {
                wrappedMaterial: Default::default(),
                algorithmSuite: Default::default(),
                encryptionContext: Default::default(),
                serializedEC: Default::default()
            }
        }
    }

    impl AsRef<UnwrapInput>
        for UnwrapInput {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(53,3)
    #[derive(PartialEq, Clone)]
    pub enum UnwrapOutput<T: DafnyType> {
        UnwrapOutput {
            unwrappedMaterial: Sequence<u8>,
            unwrapInfo: T
        }
    }

    impl<T: DafnyType> UnwrapOutput<T> {
        /// Returns a borrow of the field unwrappedMaterial
        pub fn unwrappedMaterial(&self) -> &Sequence<u8> {
            match self {
                UnwrapOutput::UnwrapOutput{unwrappedMaterial, unwrapInfo, } => unwrappedMaterial,
            }
        }
        /// Returns a borrow of the field unwrapInfo
        pub fn unwrapInfo(&self) -> &T {
            match self {
                UnwrapOutput::UnwrapOutput{unwrappedMaterial, unwrapInfo, } => unwrapInfo,
            }
        }
    }

    impl<T: DafnyType> Debug
        for UnwrapOutput<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for UnwrapOutput<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                UnwrapOutput::UnwrapOutput{unwrappedMaterial, unwrapInfo, } => {
                    write!(_formatter, "MaterialWrapping_Compile.UnwrapOutput.UnwrapOutput(")?;
                    DafnyPrint::fmt_print(unwrappedMaterial, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(unwrapInfo, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType + Eq> Eq
        for UnwrapOutput<T> {}

    impl<T: DafnyType + Hash> Hash
        for UnwrapOutput<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                UnwrapOutput::UnwrapOutput{unwrappedMaterial, unwrapInfo, } => {
                    Hash::hash(unwrappedMaterial, _state);
                    Hash::hash(unwrapInfo, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for UnwrapOutput<T> {
        fn default() -> UnwrapOutput<T> {
            UnwrapOutput::UnwrapOutput {
                unwrappedMaterial: Default::default(),
                unwrapInfo: Default::default()
            }
        }
    }

    impl<T: DafnyType> AsRef<UnwrapOutput<T>>
        for UnwrapOutput<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(77,3)
    pub trait GenerateAndWrapMaterial<T>: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> + ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<T>>, Arc<Error>> + UpcastObject<dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<T>>, Arc<Error>>>
        where
        T: DafnyType {}

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(98,3)
    pub trait WrapMaterial<T>: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> + ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<T>>, Arc<Error>> + UpcastObject<dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<T>>, Arc<Error>>>
        where
        T: DafnyType {}

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/KeyWrapping/MaterialWrapping.dfy(117,3)
    pub trait UnwrapMaterial<T>: Any + Sync + Send + UpcastObject<dyn Any + Sync + Send> + ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<T>>, Arc<Error>> + UpcastObject<dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<T>>, Arc<Error>>>
        where
        T: DafnyType {}
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(7,1)
pub mod _Materials_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeEncryptionMaterialsInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::itertools::Itertools;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::_AlgorithmSuites_Compile::AlgorithmSuite;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::InitializeDecryptionMaterialsInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::HMAC;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::set;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(30,3)
        pub fn InitializeEncryptionMaterials(input: &Arc<InitializeEncryptionMaterialsInput>) -> Arc<Result<Arc<EncryptionMaterials>, Arc<Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(!input.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Encryption Context ")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<EncryptionMaterials>>()
            } else {
                let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(Itertools::unique(input.requiredEncryptionContextKeys().iter()).all(({
                                let mut input = input.clone();
                                Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{
                                        let mut key: ValidUTF8Bytes = __forall_var_0.clone();
                                        if {
                                                let i: Sequence<u8> = key.clone();
                                                crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                            } {
                                            !input.requiredEncryptionContextKeys().contains(&key) || input.encryptionContext().contains(&key)
                                        } else {
                                            true
                                        }
                                    })
                            }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Required encryption context keys do not exist in provided encryption context.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<EncryptionMaterials>>()
                } else {
                    let mut suite: AlgorithmSuite = crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetSuite(input.algorithmSuiteId());
                    let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) == (matches!(input.signingKey().as_ref(), Some{ .. }) && matches!(input.verificationKey().as_ref(), Some{ .. })), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Missing signature key for signed suite.")
                                }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<EncryptionMaterials>>()
                    } else {
                        let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == (matches!(input.signingKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && matches!(input.verificationKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. })), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                        message: string_utf16_of("Signature key not allowed for non-signed suites.")
                                    }));
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<EncryptionMaterials>>()
                        } else {
                            let mut valueOrError4: Arc<Result<Map<ValidUTF8Bytes, ValidUTF8Bytes>, Arc<Error>>> = (&({
                                    let mut input = input.clone();
                                    let mut suite = suite.clone();
                                    Arc::new(move |_source0: &Arc<SignatureAlgorithm>| -> Arc<Result<Map<ValidUTF8Bytes, ValidUTF8Bytes>, Arc<Error>>>{
                                            if matches!(_source0.as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) {
                                                let mut ___mcc_h0: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ECDSA> = _source0.ECDSA().clone();
                                                let mut curve: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ECDSA> = ___mcc_h0.clone();
                                                let mut valueOrError5: Arc<Result<ValidUTF8Bytes, Arc<Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&crate::implementation_from_dafny::_Base64_Compile::_default::Encode(input.verificationKey().value())).MapFailure::<Arc<Error>>(&({
                                                            Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                                                    Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                                                            message: e.clone()
                                                                        })
                                                                })
                                                        }));
                                                if valueOrError5.IsFailure() {
                                                    valueOrError5.PropagateFailure::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>()
                                                } else {
                                                    let mut enc_vk: ValidUTF8Bytes = valueOrError5.Extract();
                                                    Arc::new(Result::<Map<ValidUTF8Bytes, ValidUTF8Bytes>, Arc<Error>>::Success {
                                                            value: input.encryptionContext().update_index(&_default::EC_PUBLIC_KEY_FIELD(), &enc_vk)
                                                        })
                                                }
                                            } else {
                                                let mut ___mcc_h2: Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::None> = _source0._None().clone();
                                                let mut _None: Arc<SignatureAlgorithm> = suite.signature().clone();
                                                Arc::new(Result::<Map<ValidUTF8Bytes, ValidUTF8Bytes>, Arc<Error>>::Success {
                                                        value: input.encryptionContext().clone()
                                                    })
                                            }
                                        })
                                }))(suite.signature());
                            if valueOrError4.IsFailure() {
                                valueOrError4.PropagateFailure::<Arc<EncryptionMaterials>>()
                            } else {
                                let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = valueOrError4.Extract();
                                Arc::new(Result::<Arc<EncryptionMaterials>, Arc<Error>>::Success {
                                        value: Arc::new(EncryptionMaterials::EncryptionMaterials {
                                                    algorithmSuite: suite.clone(),
                                                    encryptionContext: encryptionContext.clone(),
                                                    encryptedDataKeys: seq![] as Sequence<Arc<EncryptedDataKey>>,
                                                    requiredEncryptionContextKeys: input.requiredEncryptionContextKeys().clone(),
                                                    plaintextDataKey: Arc::new(Option::<Sequence<u8>>::None {}),
                                                    signingKey: input.signingKey().clone(),
                                                    symmetricSigningKeys: if matches!(suite.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) {
                                                            Arc::new(Option::<Sequence<Sequence<u8>>>::None {})
                                                        } else {
                                                            Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                                                                    value: seq![] as Sequence<Sequence<u8>>
                                                                })
                                                        }
                                                })
                                    })
                            }
                        }
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(93,3)
        pub fn InitializeDecryptionMaterials(input: &Arc<InitializeDecryptionMaterialsInput>) -> Arc<Result<Arc<DecryptionMaterials>, Arc<Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(Itertools::unique(input.requiredEncryptionContextKeys().iter()).all(({
                            let mut input = input.clone();
                            Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{
                                    let mut key: ValidUTF8Bytes = __forall_var_0.clone();
                                    if {
                                            let i: Sequence<u8> = key.clone();
                                            crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                        } {
                                        !input.requiredEncryptionContextKeys().contains(&key) || input.encryptionContext().contains(&key)
                                    } else {
                                        true
                                    }
                                })
                        }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Reproduced encryption context key did not exist in provided encryption context.")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<DecryptionMaterials>>()
            } else {
                let mut suite: AlgorithmSuite = crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetSuite(input.algorithmSuiteId());
                let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) == input.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Encryption Context missing verification key.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<DecryptionMaterials>>()
                } else {
                    let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == !input.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Verification key can not exist in non-signed Algorithm Suites.")
                                }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<DecryptionMaterials>>()
                    } else {
                        let mut valueOrError3: Arc<Result<Arc<Option<Sequence<u8>>>, Arc<Error>>> = _default::DecodeVerificationKey(input.encryptionContext());
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<DecryptionMaterials>>()
                        } else {
                            let mut verificationKey: Arc<Option<Sequence<u8>>> = valueOrError3.Extract();
                            Arc::new(Result::<Arc<DecryptionMaterials>, Arc<Error>>::Success {
                                    value: Arc::new(DecryptionMaterials::DecryptionMaterials {
                                                algorithmSuite: suite.clone(),
                                                encryptionContext: input.encryptionContext().clone(),
                                                requiredEncryptionContextKeys: input.requiredEncryptionContextKeys().clone(),
                                                plaintextDataKey: Arc::new(Option::<Sequence<u8>>::None {}),
                                                verificationKey: verificationKey.clone(),
                                                symmetricSigningKey: Arc::new(Option::<Sequence<u8>>::None {})
                                            })
                                })
                        }
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(142,3)
        pub fn DecodeVerificationKey(encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> Arc<Result<Arc<Option<Sequence<u8>>>, Arc<Error>>> {
            if encryptionContext.contains(&_default::EC_PUBLIC_KEY_FIELD()) {
                let mut utf8Key: ValidUTF8Bytes = encryptionContext.get(&_default::EC_PUBLIC_KEY_FIELD());
                let mut valueOrError0: Arc<Result<Sequence<DafnyCharUTF16>, Arc<Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(&utf8Key).MapFailure::<Arc<Error>>(&({
                            Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                    Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                            message: e.clone()
                                        })
                                })
                        }));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Arc<Option<Sequence<u8>>>>()
                } else {
                    let mut base64Key: Sequence<DafnyCharUTF16> = valueOrError0.Extract();
                    let mut valueOrError1: Arc<Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::_Base64_Compile::_default::Decode(&base64Key).MapFailure::<Arc<Error>>(&({
                                Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                        Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                                message: e.clone()
                                            })
                                    })
                            }));
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Arc<Option<Sequence<u8>>>>()
                    } else {
                        let mut key: Sequence<u8> = valueOrError1.Extract();
                        Arc::new(Result::<Arc<Option<Sequence<u8>>>, Arc<Error>>::Success {
                                value: Arc::new(Option::<Sequence<u8>>::Some {
                                            value: key.clone()
                                        })
                            })
                    }
                }
            } else {
                Arc::new(Result::<Arc<Option<Sequence<u8>>>, Arc<Error>>::Success {
                        value: Arc::new(Option::<Sequence<u8>>::None {})
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(167,3)
        pub fn ValidEncryptionMaterialsTransition(oldMat: &Arc<EncryptionMaterials>, newMat: &Arc<EncryptionMaterials>) -> bool {
            newMat.algorithmSuite().clone() == oldMat.algorithmSuite().clone() && newMat.encryptionContext().clone() == oldMat.encryptionContext().clone() && newMat.requiredEncryptionContextKeys().clone() == oldMat.requiredEncryptionContextKeys().clone() && newMat.signingKey().clone() == oldMat.signingKey().clone() && (matches!(oldMat.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && matches!(newMat.plaintextDataKey().as_ref(), Some{ .. }) || oldMat.plaintextDataKey().clone() == newMat.plaintextDataKey().clone()) && matches!(newMat.plaintextDataKey().as_ref(), Some{ .. }) && truncate!(oldMat.encryptedDataKeys().cardinality(), u64) <= truncate!(newMat.encryptedDataKeys().cardinality(), u64) && oldMat.encryptedDataKeys().as_dafny_multiset() <= newMat.encryptedDataKeys().as_dafny_multiset() && (!(!matches!(oldMat.algorithmSuite().symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. })) || matches!(newMat.symmetricSigningKeys().as_ref(), Some{ .. }) && (matches!(oldMat.symmetricSigningKeys().as_ref(), Some{ .. }) || matches!(oldMat.symmetricSigningKeys().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && truncate!(oldMat.encryptedDataKeys().cardinality(), u64) == 0) && oldMat.symmetricSigningKeys().UnwrapOr(&(seq![] as Sequence<Sequence<u8>>)).as_dafny_multiset() <= newMat.symmetricSigningKeys().value().as_dafny_multiset()) && _default::ValidEncryptionMaterials(oldMat) && _default::ValidEncryptionMaterials(newMat)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(217,3)
        pub fn ValidEncryptionMaterials(encryptionMaterials: &Arc<EncryptionMaterials>) -> bool {
            crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::_AlgorithmSuite_q(encryptionMaterials.algorithmSuite()) && ({
                    let __pat_let18_0: Arc<AlgorithmSuiteInfo> = encryptionMaterials.algorithmSuite().clone();
                    {
                        let suite: Arc<AlgorithmSuiteInfo> = __pat_let18_0.clone();
                        matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == matches!(encryptionMaterials.signingKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && (!matches!(encryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) || crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64 == truncate!(encryptionMaterials.plaintextDataKey().value().cardinality(), u64)) && (!matches!(encryptionMaterials.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) || truncate!(encryptionMaterials.encryptedDataKeys().cardinality(), u64) == 0) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == encryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) == matches!(encryptionMaterials.signingKey().as_ref(), Some{ .. }) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == encryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && (!(matches!(suite.symmetricSignature().as_ref(), HMAC{ .. }) && matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), Some{ .. })) || truncate!(encryptionMaterials.symmetricSigningKeys().value().cardinality(), u64) == truncate!(encryptionMaterials.encryptedDataKeys().cardinality(), u64)) && (!matches!(suite.symmetricSignature().as_ref(), HMAC{ .. }) || (matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), Some{ .. }) || truncate!(encryptionMaterials.encryptedDataKeys().cardinality(), u64) == 0 && matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }))) && (!matches!(suite.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) || matches!(encryptionMaterials.symmetricSigningKeys().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. })) && Itertools::unique(encryptionMaterials.requiredEncryptionContextKeys().iter()).all(({
                                let mut encryptionMaterials = encryptionMaterials.clone();
                                Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{
                                        let mut key: ValidUTF8Bytes = __forall_var_0.clone();
                                        if {
                                                let i: Sequence<u8> = key.clone();
                                                crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                            } {
                                            !encryptionMaterials.requiredEncryptionContextKeys().contains(&key) || encryptionMaterials.encryptionContext().contains(&key)
                                        } else {
                                            true
                                        }
                                    })
                            }).as_ref())
                    }
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(297,3)
        pub fn EncryptionMaterialsHasPlaintextDataKey(encryptionMaterials: &Arc<EncryptionMaterials>) -> bool {
            matches!(encryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) && 0 < truncate!(encryptionMaterials.encryptedDataKeys().cardinality(), u64) && _default::ValidEncryptionMaterials(encryptionMaterials)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(304,3)
        pub fn EncryptionMaterialAddEncryptedDataKeys(encryptionMaterials: &Arc<EncryptionMaterials>, encryptedDataKeysToAdd: &Sequence<Arc<EncryptedDataKey>>, symmetricSigningKeysToAdd: &Arc<Option<Sequence<Sequence<u8>>>>) -> Arc<Result<Arc<EncryptionMaterials>, Arc<Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(_default::ValidEncryptionMaterials(encryptionMaterials), &Arc::new(Error::InvalidEncryptionMaterialsTransition {
                            message: string_utf16_of("Attempt to modify invalid encryption material.")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<EncryptionMaterials>>()
            } else {
                let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(encryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }), &Arc::new(Error::InvalidEncryptionMaterialsTransition {
                                message: string_utf16_of("Adding encrypted data keys without a plaintext data key is not allowed.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<EncryptionMaterials>>()
                } else {
                    let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(!matches!(symmetricSigningKeysToAdd.as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) || matches!(encryptionMaterials.algorithmSuite().symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }), &Arc::new(Error::InvalidEncryptionMaterialsTransition {
                                    message: string_utf16_of("Adding encrypted data keys without a symmetric signing key when using symmetric signing is not allowed.")
                                }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<EncryptionMaterials>>()
                    } else {
                        let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(!matches!(symmetricSigningKeysToAdd.as_ref(), Some{ .. }) || !matches!(encryptionMaterials.algorithmSuite().symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }), &Arc::new(Error::InvalidEncryptionMaterialsTransition {
                                        message: string_utf16_of("Adding encrypted data keys with a symmetric signing key when not using symmetric signing is not allowed.")
                                    }));
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<EncryptionMaterials>>()
                        } else {
                            let mut symmetricSigningKeys: Arc<Option<Sequence<Sequence<u8>>>> = if matches!(symmetricSigningKeysToAdd.as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) {
                                    encryptionMaterials.symmetricSigningKeys().clone()
                                } else {
                                    Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                                            value: encryptionMaterials.symmetricSigningKeys().UnwrapOr(&(seq![] as Sequence<Sequence<u8>>)).concat(symmetricSigningKeysToAdd.value())
                                        })
                                };
                            Arc::new(Result::<Arc<EncryptionMaterials>, Arc<Error>>::Success {
                                    value: Arc::new(EncryptionMaterials::EncryptionMaterials {
                                                algorithmSuite: encryptionMaterials.algorithmSuite().clone(),
                                                encryptionContext: encryptionMaterials.encryptionContext().clone(),
                                                encryptedDataKeys: encryptionMaterials.encryptedDataKeys().concat(encryptedDataKeysToAdd),
                                                requiredEncryptionContextKeys: encryptionMaterials.requiredEncryptionContextKeys().clone(),
                                                plaintextDataKey: encryptionMaterials.plaintextDataKey().clone(),
                                                signingKey: encryptionMaterials.signingKey().clone(),
                                                symmetricSigningKeys: symmetricSigningKeys.clone()
                                            })
                                })
                        }
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(343,3)
        pub fn EncryptionMaterialAddDataKey(encryptionMaterials: &Arc<EncryptionMaterials>, plaintextDataKey: &Sequence<u8>, encryptedDataKeysToAdd: &Sequence<Arc<EncryptedDataKey>>, symmetricSigningKeysToAdd: &Arc<Option<Sequence<Sequence<u8>>>>) -> Arc<Result<Arc<EncryptionMaterials>, Arc<Error>>> {
            let mut suite: Arc<AlgorithmSuiteInfo> = encryptionMaterials.algorithmSuite().clone();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(_default::ValidEncryptionMaterials(encryptionMaterials), &Arc::new(Error::InvalidEncryptionMaterialsTransition {
                            message: string_utf16_of("Attempt to modify invalid encryption material.")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<EncryptionMaterials>>()
            } else {
                let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(encryptionMaterials.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }), &Arc::new(Error::InvalidEncryptionMaterialsTransition {
                                message: string_utf16_of("Attempt to modify plaintextDataKey.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<EncryptionMaterials>>()
                } else {
                    let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64 == truncate!(plaintextDataKey.cardinality(), u64), &Arc::new(Error::InvalidEncryptionMaterialsTransition {
                                    message: string_utf16_of("plaintextDataKey does not match Algorithm Suite specification.")
                                }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<EncryptionMaterials>>()
                    } else {
                        let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(symmetricSigningKeysToAdd.as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) == matches!(encryptionMaterials.algorithmSuite().symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }), &Arc::new(Error::InvalidEncryptionMaterialsTransition {
                                        message: string_utf16_of("Adding encrypted data keys without a symmetric signing key when using symmetric signing is not allowed.")
                                    }));
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<EncryptionMaterials>>()
                        } else {
                            let mut valueOrError4: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(symmetricSigningKeysToAdd.as_ref(), Some{ .. }) == !matches!(encryptionMaterials.algorithmSuite().symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }), &Arc::new(Error::InvalidEncryptionMaterialsTransition {
                                            message: string_utf16_of("Adding encrypted data keys with a symmetric signing key when not using symmetric signing is not allowed.")
                                        }));
                            if valueOrError4.IsFailure() {
                                valueOrError4.PropagateFailure::<Arc<EncryptionMaterials>>()
                            } else {
                                let mut symmetricSigningKeys: Arc<Option<Sequence<Sequence<u8>>>> = if matches!(symmetricSigningKeysToAdd.as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) {
                                        encryptionMaterials.symmetricSigningKeys().clone()
                                    } else {
                                        Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                                                value: encryptionMaterials.symmetricSigningKeys().UnwrapOr(&(seq![] as Sequence<Sequence<u8>>)).concat(symmetricSigningKeysToAdd.value())
                                            })
                                    };
                                Arc::new(Result::<Arc<EncryptionMaterials>, Arc<Error>>::Success {
                                        value: Arc::new(EncryptionMaterials::EncryptionMaterials {
                                                    algorithmSuite: encryptionMaterials.algorithmSuite().clone(),
                                                    encryptionContext: encryptionMaterials.encryptionContext().clone(),
                                                    encryptedDataKeys: encryptionMaterials.encryptedDataKeys().concat(encryptedDataKeysToAdd),
                                                    requiredEncryptionContextKeys: encryptionMaterials.requiredEncryptionContextKeys().clone(),
                                                    plaintextDataKey: Arc::new(Option::<Sequence<u8>>::Some {
                                                                value: plaintextDataKey.clone()
                                                            }),
                                                    signingKey: encryptionMaterials.signingKey().clone(),
                                                    symmetricSigningKeys: symmetricSigningKeys.clone()
                                                })
                                    })
                            }
                        }
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(397,3)
        pub fn DecryptionMaterialsTransitionIsValid(oldMat: &Arc<DecryptionMaterials>, newMat: &Arc<DecryptionMaterials>) -> bool {
            newMat.algorithmSuite().clone() == oldMat.algorithmSuite().clone() && newMat.encryptionContext().clone() == oldMat.encryptionContext().clone() && newMat.requiredEncryptionContextKeys().clone() == oldMat.requiredEncryptionContextKeys().clone() && newMat.verificationKey().clone() == oldMat.verificationKey().clone() && matches!(oldMat.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && matches!(newMat.plaintextDataKey().as_ref(), Some{ .. }) && matches!(oldMat.symmetricSigningKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && _default::ValidDecryptionMaterials(oldMat) && _default::ValidDecryptionMaterials(newMat)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(428,3)
        pub fn ValidDecryptionMaterials(decryptionMaterials: &Arc<DecryptionMaterials>) -> bool {
            crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::_AlgorithmSuite_q(decryptionMaterials.algorithmSuite()) && ({
                    let __pat_let19_0: Arc<AlgorithmSuiteInfo> = decryptionMaterials.algorithmSuite().clone();
                    {
                        let suite: Arc<AlgorithmSuiteInfo> = __pat_let19_0.clone();
                        (!matches!(decryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) || crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64 == truncate!(decryptionMaterials.plaintextDataKey().value().cardinality(), u64)) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == decryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::ECDSA{ .. }) == matches!(decryptionMaterials.verificationKey().as_ref(), Some{ .. }) && !matches!(suite.signature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SignatureAlgorithm::None{ .. }) == decryptionMaterials.encryptionContext().contains(&_default::EC_PUBLIC_KEY_FIELD()) && (!(!matches!(suite.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. })) || matches!(decryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) == matches!(decryptionMaterials.symmetricSigningKey().as_ref(), Some{ .. })) && (!matches!(suite.symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }) || matches!(decryptionMaterials.symmetricSigningKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. })) && Itertools::unique(decryptionMaterials.requiredEncryptionContextKeys().iter()).all(({
                                let mut decryptionMaterials = decryptionMaterials.clone();
                                Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{
                                        let mut k: ValidUTF8Bytes = __forall_var_0.clone();
                                        if {
                                                let i: Sequence<u8> = k.clone();
                                                crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                            } {
                                            !decryptionMaterials.requiredEncryptionContextKeys().contains(&k) || decryptionMaterials.encryptionContext().contains(&k)
                                        } else {
                                            true
                                        }
                                    })
                            }).as_ref())
                    }
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(482,3)
        pub fn DecryptionMaterialsAddDataKey(decryptionMaterials: &Arc<DecryptionMaterials>, plaintextDataKey: &Sequence<u8>, symmetricSigningKey: &Arc<Option<Sequence<u8>>>) -> Arc<Result<Arc<DecryptionMaterials>, Arc<Error>>> {
            let mut suite: Arc<AlgorithmSuiteInfo> = decryptionMaterials.algorithmSuite().clone();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(_default::ValidDecryptionMaterials(decryptionMaterials), &Arc::new(Error::InvalidDecryptionMaterialsTransition {
                            message: string_utf16_of("Attempt to modify invalid decryption material.")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<DecryptionMaterials>>()
            } else {
                let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(decryptionMaterials.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }), &Arc::new(Error::InvalidDecryptionMaterialsTransition {
                                message: string_utf16_of("Attempt to modify plaintextDataKey.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<DecryptionMaterials>>()
                } else {
                    let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64 == truncate!(plaintextDataKey.cardinality(), u64), &Arc::new(Error::InvalidDecryptionMaterialsTransition {
                                    message: string_utf16_of("plaintextDataKey does not match Algorithm Suite specification.")
                                }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<DecryptionMaterials>>()
                    } else {
                        let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(symmetricSigningKey.as_ref(), Some{ .. }) == !matches!(decryptionMaterials.algorithmSuite().symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }), &Arc::new(Error::InvalidDecryptionMaterialsTransition {
                                        message: string_utf16_of("symmetric signature key must be added with plaintextDataKey if using an algorithm suite with symmetric signing.")
                                    }));
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<DecryptionMaterials>>()
                        } else {
                            let mut valueOrError4: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(symmetricSigningKey.as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) == matches!(decryptionMaterials.algorithmSuite().symmetricSignature().as_ref(), crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::SymmetricSignatureAlgorithm::None{ .. }), &Arc::new(Error::InvalidDecryptionMaterialsTransition {
                                            message: string_utf16_of("symmetric signature key cannot be added with plaintextDataKey if using an algorithm suite without symmetric signing.")
                                        }));
                            if valueOrError4.IsFailure() {
                                valueOrError4.PropagateFailure::<Arc<DecryptionMaterials>>()
                            } else {
                                Arc::new(Result::<Arc<DecryptionMaterials>, Arc<Error>>::Success {
                                        value: Arc::new(DecryptionMaterials::DecryptionMaterials {
                                                    algorithmSuite: decryptionMaterials.algorithmSuite().clone(),
                                                    encryptionContext: decryptionMaterials.encryptionContext().clone(),
                                                    requiredEncryptionContextKeys: decryptionMaterials.requiredEncryptionContextKeys().clone(),
                                                    plaintextDataKey: Arc::new(Option::<Sequence<u8>>::Some {
                                                                value: plaintextDataKey.clone()
                                                            }),
                                                    verificationKey: decryptionMaterials.verificationKey().clone(),
                                                    symmetricSigningKey: symmetricSigningKey.clone()
                                                })
                                    })
                            }
                        }
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(516,3)
        pub fn DecryptionMaterialsWithoutPlaintextDataKey(decryptionMaterials: &Arc<DecryptionMaterials>) -> bool {
            matches!(decryptionMaterials.plaintextDataKey().as_ref(), crate::implementation_from_dafny::_Wrappers_Compile::Option::None{ .. }) && _default::ValidDecryptionMaterials(decryptionMaterials)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(540,3)
        pub fn DecryptionMaterialsWithPlaintextDataKey(decryptionMaterials: &Arc<DecryptionMaterials>) -> bool {
            matches!(decryptionMaterials.plaintextDataKey().as_ref(), Some{ .. }) && _default::ValidDecryptionMaterials(decryptionMaterials)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(18,3)
        pub fn EC_PUBLIC_KEY_FIELD() -> ValidUTF8Bytes {
            let mut s: Sequence<u8> = seq![97, 119, 115, 45, 99, 114, 121, 112, 116, 111, 45, 112, 117, 98, 108, 105, 99, 45, 107, 101, 121];
            s.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(24,3)
        pub fn RESERVED_KEY_VALUES() -> Set<ValidUTF8Bytes> {
            set!{_default::EC_PUBLIC_KEY_FIELD()}
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(550,3)
    pub type DecryptionMaterialsPendingPlaintextDataKey = Arc<DecryptionMaterials>;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Materials.dfy(554,3)
    pub type SealedDecryptionMaterials = Arc<DecryptionMaterials>;
}
/// *****************************************************************************
///  Copyright by the contributors to the Dafny Project
///  SPDX-License-Identifier: MIT
/// *****************************************************************************
/// ../mpl/libraries/src/Math.dfy(8,1)
pub mod _Math_Compile {
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::int;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/Math.dfy(9,3)
        pub fn Min(a: &DafnyInt, b: &DafnyInt) -> DafnyInt {
            if a.clone() < b.clone() {
                a.clone()
            } else {
                b.clone()
            }
        }
        /// ../mpl/libraries/src/Math.dfy(17,3)
        pub fn Max(a: &DafnyInt, b: &DafnyInt) -> DafnyInt {
            if a.clone() < b.clone() {
                b.clone()
            } else {
                a.clone()
            }
        }
        /// ../mpl/libraries/src/Math.dfy(25,3)
        pub fn Abs(a: &DafnyInt) -> DafnyInt {
            if a.clone() >= int!(0) {
                a.clone()
            } else {
                int!(0) - a.clone()
            }
        }
    }
}
/// dafny/AwsEncryptionSdk/src/MessageBody.dfy(14,1)
pub mod _MessageBody_Compile {
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_MessageBody_Compile::BodyAADContent::AADRegularFrame;
    pub use crate::implementation_from_dafny::_MessageBody_Compile::BodyAADContent::AADFinalFrame;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::Zero;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::_Header_Compile::Header;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use ::std::convert::Into;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::_Frames_Compile::FramedHeader;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded;
    pub use crate::implementation_from_dafny::_Frames_Compile::NonFramedHeader;
    pub use crate::implementation_from_dafny::_Frames_Compile::NonFramed;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(42,3)
        pub fn BodyAADContentTypeString(bc: &Arc<BodyAADContent>) -> Sequence<DafnyCharUTF16> {
            let mut _source0: Arc<BodyAADContent> = bc.clone();
            if matches!((&_source0).as_ref(), AADRegularFrame{ .. }) {
                _default::BODY_AAD_CONTENT_REGULAR_FRAME()
            } else {
                if matches!((&_source0).as_ref(), AADFinalFrame{ .. }) {
                    _default::BODY_AAD_CONTENT_FINAL_FRAME()
                } else {
                    _default::BODY_AAD_CONTENT_SINGLE_BLOCK()
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(53,3)
        pub fn IVSeq(suite: &Arc<AlgorithmSuiteInfo>, sequenceNumber: u32) -> Sequence<u8> {
            let mut len: u8 = crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite);
            let mut num: Sequence<u8> = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(sequenceNumber);
            if len == 12 {
                seq![0, 0, 0, 0, 0, 0, 0, 0].concat(&num)
            } else {
                ({
                    let _initializer = {
                            Arc::new(move |_v0: &DafnyInt| -> u8{
                                    0
                                })
                        };
                    integer_range(Zero::zero(), int!(len) - int!(4)).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                }).concat(&num)
            }
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(222,3)
        pub fn EncryptMessageBody(plaintext: &Sequence<u8>, header: &Header, key: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<FramedMessage, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut result = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<FramedMessage, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut n: u64;
            let mut sequenceNumber: u32;
            let mut _rhs0: u64 = 0;
            let mut _rhs1: u32 = _default::START_SEQUENCE_NUMBER();
            n = _rhs0;
            sequenceNumber = _rhs1;
            let mut regularFrames: MessageRegularFrames = seq![] as Sequence<crate::implementation_from_dafny::_Frames_Compile::RegularFrame>;
            while crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(n, header.body().frameLength().clone() as u64) < truncate!(plaintext.cardinality(), u64) {
                let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(sequenceNumber < _default::ENDFRAME_SEQUENCE_NUMBER(), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsEncryptionSdkException {
                                message: string_utf16_of("too many frames")
                            }));
                if valueOrError0.IsFailure() {
                    result = MaybePlacebo::from(valueOrError0.PropagateFailure::<FramedMessage>());
                    return result.read();
                };
                let mut plaintextFrame: Sequence<u8> = plaintext.slice(&int!((&n).clone()), &int!((&crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(n, header.body().frameLength().clone() as u64)).clone()));
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_Frames_Compile::RegularFrame, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_Frames_Compile::RegularFrame, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::EncryptRegularFrame(key, header, &plaintextFrame, sequenceNumber, crypto);
                valueOrError1 = _out0.clone();
                if valueOrError1.IsFailure() {
                    result = MaybePlacebo::from(valueOrError1.PropagateFailure::<FramedMessage>());
                    return result.read();
                };
                let mut regularFrame: Arc<crate::implementation_from_dafny::_Frames_Compile::Frame> = valueOrError1.Extract();
                regularFrames = regularFrames.concat(&seq![regularFrame.clone()]);
                n = crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(n, header.body().frameLength().clone() as u64);
                sequenceNumber = sequenceNumber + 1;
            };
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_Frames_Compile::FinalFrame, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_Frames_Compile::FinalFrame, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::EncryptFinalFrame(key, header, &plaintext.drop(&int!((&n).clone())), sequenceNumber, crypto);
            valueOrError2 = _out1.clone();
            if valueOrError2.IsFailure() {
                result = MaybePlacebo::from(valueOrError2.PropagateFailure::<FramedMessage>());
                return result.read();
            };
            let mut finalFrame: crate::implementation_from_dafny::_Frames_Compile::FinalFrame = valueOrError2.Extract();
            result = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<FramedMessageBody>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: Arc::new(FramedMessageBody::FramedMessageBody {
                                        regularFrames: regularFrames.clone(),
                                        finalFrame: finalFrame.clone()
                                    })
                        }));
            return result.read();
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(370,3)
        pub fn EncryptRegularFrame(key: &Sequence<u8>, header: &Header, plaintext: &Sequence<u8>, sequenceNumber: u32, crypto: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_Frames_Compile::RegularFrame, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_Frames_Compile::RegularFrame, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut iv: Sequence<u8> = _default::IVSeq(header.suite(), sequenceNumber);
            let mut aad: Sequence<u8> = _default::BodyAAD(header.body().messageId(), &Arc::new(BodyAADContent::AADRegularFrame {}), sequenceNumber, truncate!(plaintext.cardinality(), u64));
            let mut aesEncryptInput: Arc<AESEncryptInput> = Arc::new(AESEncryptInput::AESEncryptInput {
                        encAlg: header.suite().encrypt().AES_GCM().clone(),
                        iv: iv.clone(),
                        key: key.clone(),
                        msg: plaintext.clone(),
                        aad: aad.clone()
                    });
            let mut maybeEncryptionOutput: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESEncrypt(rd!(crypto.clone()), &aesEncryptInput);
            maybeEncryptionOutput = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeEncryptionOutput.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<crate::implementation_from_dafny::_Frames_Compile::RegularFrame>());
                return res.read();
            };
            let mut encryptionOutput: Arc<AESEncryptOutput> = valueOrError0.Extract();
            let mut frame: crate::implementation_from_dafny::_Frames_Compile::RegularFrame = Arc::new(crate::implementation_from_dafny::_Frames_Compile::Frame::RegularFrame {
                        header: header.clone(),
                        seqNum: sequenceNumber,
                        iv: iv.clone(),
                        encContent: encryptionOutput.cipherText().clone(),
                        authTag: encryptionOutput.authTag().clone()
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<crate::implementation_from_dafny::_Frames_Compile::RegularFrame, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: frame.clone()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(524,3)
        pub fn EncryptFinalFrame(key: &Sequence<u8>, header: &Header, plaintext: &Sequence<u8>, sequenceNumber: u32, crypto: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_Frames_Compile::FinalFrame, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<crate::implementation_from_dafny::_Frames_Compile::FinalFrame, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut iv: Sequence<u8> = _default::IVSeq(header.suite(), sequenceNumber);
            let mut aad: Sequence<u8> = _default::BodyAAD(header.body().messageId(), &Arc::new(BodyAADContent::AADFinalFrame {}), sequenceNumber, truncate!(plaintext.cardinality(), u64));
            let mut aesEncryptInput: Arc<AESEncryptInput> = Arc::new(AESEncryptInput::AESEncryptInput {
                        encAlg: header.suite().encrypt().AES_GCM().clone(),
                        iv: iv.clone(),
                        key: key.clone(),
                        msg: plaintext.clone(),
                        aad: aad.clone()
                    });
            let mut maybeEncryptionOutput: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESEncrypt(rd!(crypto.clone()), &aesEncryptInput);
            maybeEncryptionOutput = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybeEncryptionOutput.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<crate::implementation_from_dafny::_Frames_Compile::FinalFrame>());
                return res.read();
            };
            let mut encryptionOutput: Arc<AESEncryptOutput> = valueOrError0.Extract();
            let mut finalFrame: crate::implementation_from_dafny::_Frames_Compile::FinalFrame = Arc::new(crate::implementation_from_dafny::_Frames_Compile::Frame::FinalFrame {
                        header: header.clone(),
                        seqNum: sequenceNumber,
                        iv: iv.clone(),
                        encContent: encryptionOutput.cipherText().clone(),
                        authTag: encryptionOutput.authTag().clone()
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<crate::implementation_from_dafny::_Frames_Compile::FinalFrame, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: finalFrame.clone()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(686,3)
        pub fn DecryptFramedMessageBody(body: &FramedMessage, key: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut plaintext: Sequence<u8> = seq![] as Sequence<u8>;
            let mut _hi0: u64 = truncate!(body.regularFrames().cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
                let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::DecryptFrame(&body.regularFrames().get(&int!((&i).clone())), key, crypto);
                valueOrError0 = _out0.clone();
                if valueOrError0.IsFailure() {
                    res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                    return res.read();
                };
                let mut plaintextSegment: Sequence<u8> = valueOrError0.Extract();
                plaintext = plaintext.concat(&plaintextSegment);
            }
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = _default::DecryptFrame(body.finalFrame(), key, crypto);
            valueOrError1 = _out1.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut finalPlaintextSegment: Sequence<u8> = valueOrError1.Extract();
            plaintext = plaintext.concat(&finalPlaintextSegment);
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: plaintext.clone()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(759,3)
        pub fn DecryptFrame(frame: &Frame, key: &Sequence<u8>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>>::new();
            let mut aad: Sequence<u8> = _default::BodyAADByFrameType(frame);
            let mut maybePlaintextSegment: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESDecrypt(rd!(crypto.clone()), &Arc::new(AESDecryptInput::AESDecryptInput {
                            encAlg: frame.header().suite().encrypt().AES_GCM().clone(),
                            key: key.clone(),
                            cipherTxt: frame.encContent().clone(),
                            authTag: frame.authTag().clone(),
                            iv: frame.iv().clone(),
                            aad: aad.clone()
                        }));
            maybePlaintextSegment = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = maybePlaintextSegment.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut plaintextSegment: Sequence<u8> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>::Success {
                            value: plaintextSegment.clone()
                        }));
            return res.read();
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(840,3)
        pub fn BodyAADByFrameType(frame: &Frame) -> Sequence<u8> {
            let mut __let_tmp_rhs0: (u32, Arc<BodyAADContent>, u64) = (&({
                    Arc::new(move |_source0: &Frame| -> (u32, Arc<BodyAADContent>, u64){
                            if matches!(_source0.as_ref(), crate::implementation_from_dafny::_Frames_Compile::Frame::RegularFrame{ .. }) {
                                let mut ___mcc_h0: Header = _source0.header().clone();
                                let mut ___mcc_h1: u32 = _source0.seqNum().clone();
                                let mut ___mcc_h2: Sequence<u8> = _source0.iv().clone();
                                let mut ___mcc_h3: Sequence<u8> = _source0.encContent().clone();
                                let mut ___mcc_h4: Sequence<u8> = _source0.authTag().clone();
                                let mut seqNum: u32 = ___mcc_h1;
                                let mut header: Header = ___mcc_h0.clone();
                                (
                                    seqNum,
                                    Arc::new(BodyAADContent::AADRegularFrame {}),
                                    header.body().frameLength().clone() as u64
                                )
                            } else {
                                if matches!(_source0.as_ref(), crate::implementation_from_dafny::_Frames_Compile::Frame::FinalFrame{ .. }) {
                                    let mut ___mcc_h5: Header = _source0.header().clone();
                                    let mut ___mcc_h6: u32 = _source0.seqNum().clone();
                                    let mut ___mcc_h7: Sequence<u8> = _source0.iv().clone();
                                    let mut ___mcc_h8: Sequence<u8> = _source0.encContent().clone();
                                    let mut ___mcc_h9: Sequence<u8> = _source0.authTag().clone();
                                    let mut encContent: Sequence<u8> = ___mcc_h8.clone();
                                    let mut seqNum: u32 = ___mcc_h6;
                                    (
                                        seqNum,
                                        Arc::new(BodyAADContent::AADFinalFrame {}),
                                        truncate!(encContent.cardinality(), u64)
                                    )
                                } else {
                                    let mut ___mcc_h10: Header = _source0.header().clone();
                                    let mut ___mcc_h11: Sequence<u8> = _source0.iv().clone();
                                    let mut ___mcc_h12: Sequence<u8> = _source0.encContent().clone();
                                    let mut ___mcc_h13: Sequence<u8> = _source0.authTag().clone();
                                    let mut encContent: Sequence<u8> = ___mcc_h12.clone();
                                    (
                                        _default::NONFRAMED_SEQUENCE_NUMBER(),
                                        Arc::new(BodyAADContent::AADSingleBlock {}),
                                        truncate!(encContent.cardinality(), u64)
                                    )
                                }
                            }
                        })
                }))(frame);
            let mut sequenceNumber: u32 = __let_tmp_rhs0.0.clone();
            let mut bc: Arc<BodyAADContent> = __let_tmp_rhs0.1.clone();
            let mut length: u64 = __let_tmp_rhs0.2.clone();
            _default::BodyAAD(frame.header().body().messageId(), &bc, sequenceNumber, length)
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(923,3)
        pub fn BodyAAD(messageID: &Sequence<u8>, bc: &Arc<BodyAADContent>, sequenceNumber: u32, length: u64) -> Sequence<u8> {
            let mut contentAAD: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&_default::BodyAADContentTypeString(bc));
            messageID.concat(contentAAD.value()).concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(sequenceNumber)).concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt64ToSeq(length))
        }
        /// = compliance/data-format/message-body.txt#2.5.2.2
        /// = type=implication
        /// # The final frame
        /// # MUST be the last frame.
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(958,3)
        pub fn WriteFramedMessageBody(body: &FramedMessage) -> Sequence<u8> {
            _default::WriteMessageRegularFrames(body.regularFrames()).concat(&crate::implementation_from_dafny::_Frames_Compile::_default::WriteFinalFrame(body.finalFrame()))
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(972,3)
        pub fn WriteMessageRegularFrames(frames: &MessageRegularFrames) -> Sequence<u8> {
            let mut ret = MaybePlacebo::<Sequence<u8>>::new();
            let mut result: Sequence<u8> = seq![] as Sequence<u8>;
            let mut _hi0: u64 = truncate!(frames.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                result = result.concat(&crate::implementation_from_dafny::_Frames_Compile::_default::WriteRegularFrame(&frames.get(&int!((&i).clone()))));
            }
            ret = MaybePlacebo::from(result.clone());
            return ret.read();
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(1010,3)
        pub fn ReadFramedMessageBody(buffer: &Arc<ReadableBuffer>, header: &FramedHeader, regularFrames: &MessageRegularFrames, continuation: &Arc<ReadableBuffer>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<FramedMessage>>, Arc<ReadProblems>>> {
            let mut _r0 = buffer.clone();
            let mut _r1 = header.clone();
            let mut _r2 = regularFrames.clone();
            let mut _r3 = continuation.clone();
            'TAIL_CALL_START: loop {
                let buffer = _r0;
                let header = _r1;
                let regularFrames = _r2;
                let continuation = _r3;
                let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u32>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt32(&continuation);
                if valueOrError0.IsFailure() {
                    return valueOrError0.PropagateFailure::<Arc<SuccessfulRead<FramedMessage>>>();
                } else {
                    let mut sequenceNumber: Arc<SuccessfulRead<u32>> = valueOrError0.Extract();
                    if sequenceNumber.data().clone() != _default::ENDFRAME_SEQUENCE_NUMBER() {
                        let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<crate::implementation_from_dafny::_Frames_Compile::RegularFrame>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_Frames_Compile::_default::ReadRegularFrame(&continuation, &header);
                        if valueOrError1.IsFailure() {
                            return valueOrError1.PropagateFailure::<Arc<SuccessfulRead<FramedMessage>>>();
                        } else {
                            let mut regularFrame: Arc<SuccessfulRead<crate::implementation_from_dafny::_Frames_Compile::RegularFrame>> = valueOrError1.Extract();
                            let mut valueOrError2: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(regularFrame.data().seqNum().clone() as u64 == truncate!(regularFrames.cardinality(), u64) + 1, &Arc::new(ReadProblems::Error {
                                            message: string_utf16_of("Sequence number out of order.")
                                        }));
                            if valueOrError2.IsFailure() {
                                return valueOrError2.PropagateFailure::<Arc<SuccessfulRead<FramedMessage>>>();
                            } else {
                                let mut nextRegularFrames: MessageRegularFrames = regularFrames.concat(&seq![regularFrame.data().clone()]);
                                let mut _in0: Arc<ReadableBuffer> = buffer.clone();
                                let mut _in1: FramedHeader = header.clone();
                                let mut _in2: MessageRegularFrames = nextRegularFrames.clone();
                                let mut _in3: Arc<ReadableBuffer> = regularFrame.tail().clone();
                                _r0 = _in0.clone();
                                _r1 = _in1.clone();
                                _r2 = _in2.clone();
                                _r3 = _in3.clone();
                                continue 'TAIL_CALL_START;
                            }
                        }
                    } else {
                        let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<crate::implementation_from_dafny::_Frames_Compile::FinalFrame>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_Frames_Compile::_default::ReadFinalFrame(&continuation, &header);
                        if valueOrError3.IsFailure() {
                            return valueOrError3.PropagateFailure::<Arc<SuccessfulRead<FramedMessage>>>();
                        } else {
                            let mut finalFrame: Arc<SuccessfulRead<crate::implementation_from_dafny::_Frames_Compile::FinalFrame>> = valueOrError3.Extract();
                            let mut valueOrError4: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(finalFrame.data().seqNum().clone() as u64 == truncate!(regularFrames.cardinality(), u64) + 1, &Arc::new(ReadProblems::Error {
                                            message: string_utf16_of("Sequence number out of order.")
                                        }));
                            if valueOrError4.IsFailure() {
                                return valueOrError4.PropagateFailure::<Arc<SuccessfulRead<FramedMessage>>>();
                            } else {
                                let mut body: FramedMessage = Arc::new(FramedMessageBody::FramedMessageBody {
                                            regularFrames: regularFrames.clone(),
                                            finalFrame: finalFrame.data().clone()
                                        });
                                return Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<FramedMessage>>, Arc<ReadProblems>>::Success {
                                            value: Arc::new(SuccessfulRead::<FramedMessage>::SuccessfulRead {
                                                        data: body.clone(),
                                                        tail: finalFrame.tail().clone()
                                                    })
                                        });
                            }
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(1149,3)
        pub fn ReadNonFramedMessageBody(buffer: &Arc<ReadableBuffer>, header: &NonFramedHeader) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<NonFramed>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<NonFramed>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_Frames_Compile::_default::ReadNonFrame(buffer, header);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<NonFramed>>>()
            } else {
                let mut block: Arc<SuccessfulRead<NonFramed>> = valueOrError0.Extract();
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<NonFramed>>, Arc<ReadProblems>>::Success {
                        value: Arc::new(SuccessfulRead::<NonFramed>::SuccessfulRead {
                                    data: block.data().clone(),
                                    tail: block.tail().clone()
                                })
                    })
            }
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(38,3)
        pub fn BODY_AAD_CONTENT_REGULAR_FRAME() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("AWSKMSEncryptionClient Frame")
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(39,3)
        pub fn BODY_AAD_CONTENT_FINAL_FRAME() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("AWSKMSEncryptionClient Final Frame")
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(40,3)
        pub fn BODY_AAD_CONTENT_SINGLE_BLOCK() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("AWSKMSEncryptionClient Single Block")
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(50,3)
        pub fn ENDFRAME_SEQUENCE_NUMBER() -> u32 {
            crate::implementation_from_dafny::_Frames_Compile::_default::ENDFRAME_SEQUENCE_NUMBER()
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(49,3)
        pub fn START_SEQUENCE_NUMBER() -> u32 {
            crate::implementation_from_dafny::_Frames_Compile::_default::START_SEQUENCE_NUMBER()
        }
        /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(51,3)
        pub fn NONFRAMED_SEQUENCE_NUMBER() -> u32 {
            crate::implementation_from_dafny::_Frames_Compile::_default::NONFRAMED_SEQUENCE_NUMBER()
        }
    }

    /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(36,3)
    #[derive(PartialEq, Clone)]
    pub enum BodyAADContent {
        AADRegularFrame {},
        AADFinalFrame {},
        AADSingleBlock {}
    }

    impl BodyAADContent {}

    impl Debug
        for BodyAADContent {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for BodyAADContent {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                BodyAADContent::AADRegularFrame{} => {
                    write!(_formatter, "MessageBody_Compile.BodyAADContent.AADRegularFrame")?;
                    Ok(())
                },
                BodyAADContent::AADFinalFrame{} => {
                    write!(_formatter, "MessageBody_Compile.BodyAADContent.AADFinalFrame")?;
                    Ok(())
                },
                BodyAADContent::AADSingleBlock{} => {
                    write!(_formatter, "MessageBody_Compile.BodyAADContent.AADSingleBlock")?;
                    Ok(())
                },
            }
        }
    }

    impl BodyAADContent {
        /// Enumerates all possible values of BodyAADContent
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<BodyAADContent>> {
            seq![Arc::new(BodyAADContent::AADRegularFrame {}), Arc::new(BodyAADContent::AADFinalFrame {}), Arc::new(BodyAADContent::AADSingleBlock {})].iter()
        }
    }

    impl Eq
        for BodyAADContent {}

    impl Hash
        for BodyAADContent {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                BodyAADContent::AADRegularFrame{} => {

                },
                BodyAADContent::AADFinalFrame{} => {

                },
                BodyAADContent::AADSingleBlock{} => {

                },
            }
        }
    }

    impl Default
        for BodyAADContent {
        fn default() -> BodyAADContent {
            BodyAADContent::AADRegularFrame {}
        }
    }

    impl AsRef<BodyAADContent>
        for BodyAADContent {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(111,3)
    pub type MessageRegularFrames = Sequence<crate::implementation_from_dafny::_Frames_Compile::RegularFrame>;

    /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(181,3)
    #[derive(PartialEq, Clone)]
    pub enum FramedMessageBody {
        FramedMessageBody {
            regularFrames: MessageRegularFrames,
            finalFrame: crate::implementation_from_dafny::_Frames_Compile::FinalFrame
        }
    }

    impl FramedMessageBody {
        /// Returns a borrow of the field regularFrames
        pub fn regularFrames(&self) -> &MessageRegularFrames {
            match self {
                FramedMessageBody::FramedMessageBody{regularFrames, finalFrame, } => regularFrames,
            }
        }
        /// Returns a borrow of the field finalFrame
        pub fn finalFrame(&self) -> &crate::implementation_from_dafny::_Frames_Compile::FinalFrame {
            match self {
                FramedMessageBody::FramedMessageBody{regularFrames, finalFrame, } => finalFrame,
            }
        }
    }

    impl Debug
        for FramedMessageBody {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for FramedMessageBody {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                FramedMessageBody::FramedMessageBody{regularFrames, finalFrame, } => {
                    write!(_formatter, "MessageBody_Compile.FramedMessageBody.FramedMessageBody(")?;
                    DafnyPrint::fmt_print(regularFrames, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(finalFrame, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for FramedMessageBody {}

    impl Hash
        for FramedMessageBody {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                FramedMessageBody::FramedMessageBody{regularFrames, finalFrame, } => {
                    Hash::hash(regularFrames, _state);
                    Hash::hash(finalFrame, _state)
                },
            }
        }
    }

    impl Default
        for FramedMessageBody {
        fn default() -> FramedMessageBody {
            FramedMessageBody::FramedMessageBody {
                regularFrames: Default::default(),
                finalFrame: Default::default()
            }
        }
    }

    impl AsRef<FramedMessageBody>
        for FramedMessageBody {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(189,3)
    pub type FramedMessage = Arc<FramedMessageBody>;

    /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(199,3)
    pub type MessageFrame = Arc<crate::implementation_from_dafny::_Frames_Compile::Frame>;

    /// dafny/AwsEncryptionSdk/src/MessageBody.dfy(205,3)
    pub type Frame = Arc<crate::implementation_from_dafny::_Frames_Compile::Frame>;
}
/// ../mpl/libraries/src/NonlinearArithmetic/Internals/ModInternals.dfy(27,1)
pub mod _ModInternals_Compile {
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::int;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/NonlinearArithmetic/Internals/ModInternals.dfy(37,3)
        pub fn ModRecursive(x: &DafnyInt, d: &DafnyInt) -> DafnyInt {
            let mut _r0 = x.clone();
            let mut _r1 = d.clone();
            'TAIL_CALL_START: loop {
                let x = _r0;
                let d = _r1;
                if x.clone() < int!(0) {
                    let mut _in0: DafnyInt = d.clone() + x.clone();
                    let mut _in1: DafnyInt = d.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                } else {
                    if x.clone() < d.clone() {
                        return x.clone();
                    } else {
                        let mut _in2: DafnyInt = x.clone() - d.clone();
                        let mut _in3: DafnyInt = d.clone();
                        _r0 = _in2.clone();
                        _r1 = _in3.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
    }
}
/// *****************************************************************************
///  Original: Copyright (c) Microsoft Corporation
///  SPDX-License-Identifier: MIT
///
///  Modifications and Extensions: Copyright by the contributors to the Dafny Project
///  SPDX-License-Identifier: MIT
/// *****************************************************************************
/// ../mpl/libraries/src/NonlinearArithmetic/Internals/ModInternalsNonlinear.dfy(11,1)
pub mod _ModInternalsNonlinear_Compile {

}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/MrkAwareDiscoveryMultiKeyring.dfy(12,1)
pub mod _MrkAwareDiscoveryMultiKeyring_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DiscoveryFilter;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_MultiKeyring_Compile::MultiKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use crate::implementation_from_dafny::_AwsKmsMrkDiscoveryKeyring_Compile::AwsKmsMrkDiscoveryKeyring;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use ::dafny_runtime::upcast_object;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/MrkAwareDiscoveryMultiKeyring.dfy(34,3)
        pub fn MrkAwareDiscoveryMultiKeyring(regions: &Sequence<Sequence<DafnyCharUTF16>>, discoveryFilter: &Arc<Option<Arc<DiscoveryFilter>>>, clientSupplier: &Object<dyn IClientSupplier>, grantTokens: &Arc<Option<GrantTokenList>>) -> Arc<Result<Object<MultiKeyring>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Object<MultiKeyring>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(0 < truncate!(regions.cardinality(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("No regions passed.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<MultiKeyring>>());
                return output.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!((&crate::implementation_from_dafny::_Seq_Compile::_default::IndexOfOption::<Sequence<DafnyCharUTF16>>(regions, &string_utf16_of(""))).as_ref(), None{ .. }), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Empty string is not a valid region.")
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<MultiKeyring>>());
                return output.read();
            };
            let mut children: Sequence<Object<AwsKmsMrkDiscoveryKeyring>> = seq![] as Sequence<Object<AwsKmsMrkDiscoveryKeyring>>;
            let mut _hi0: u64 = truncate!(regions.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut region: Sequence<DafnyCharUTF16> = regions.get(&int!((&i).clone()));
                let mut valueOrError2: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>>;
                let mut _out0: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput {
                                region: region.clone()
                            }));
                valueOrError2 = _out0.clone();
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<MultiKeyring>>());
                    return output.read();
                };
                let mut client: Object<dyn IKMSClient> = valueOrError2.Extract();
                let mut keyring: Object<AwsKmsMrkDiscoveryKeyring>;
                let mut _nw0: Object<AwsKmsMrkDiscoveryKeyring> = AwsKmsMrkDiscoveryKeyring::_allocate_object();
                AwsKmsMrkDiscoveryKeyring::_ctor(&_nw0, &client, &region, discoveryFilter, &grantTokens.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>)));
                keyring = _nw0.clone();
                children = children.concat(&seq![keyring.clone()]);
            }
            let mut keyring: Object<MultiKeyring>;
            let mut _nw1: Object<MultiKeyring> = MultiKeyring::_allocate_object();
            MultiKeyring::_ctor(&_nw1, &Arc::new(Option::<Object<dyn IKeyring>>::None {}), &Sequence::<Object<AwsKmsMrkDiscoveryKeyring>>::coerce(upcast_object::<AwsKmsMrkDiscoveryKeyring, dyn IKeyring>())(children.clone()));
            keyring = _nw1.clone();
            output = MaybePlacebo::from(Arc::new(Result::<Object<MultiKeyring>, Arc<Error>>::Success {
                            value: keyring.clone()
                        }));
            return output.read();
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/MrkAwareStrictMultiKeyring.dfy(12,1)
pub mod _MrkAwareStrictMultiKeyring_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_MultiKeyring_Compile::MultiKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_AwsKmsMrkKeyring_Compile::AwsKmsMrkKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::rc_coerce;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/MrkAwareStrictMultiKeyring.dfy(25,3)
        pub fn MrkAwareStrictMultiKeyring(generator: &Arc<Option<Sequence<DafnyCharUTF16>>>, awsKmsKeys: &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>, clientSupplier: &Object<dyn IClientSupplier>, grantTokens: &Arc<Option<GrantTokenList>>) -> Arc<Result<Object<MultiKeyring>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Object<MultiKeyring>, Arc<Error>>>>::new();
            let mut allStrings: Sequence<Sequence<DafnyCharUTF16>>;
            let mut _source0: Arc<Option<Sequence<DafnyCharUTF16>>> = generator.clone();
            if matches!((&_source0).as_ref(), None{ .. }) {
                allStrings = awsKmsKeys.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>));
            } else {
                let mut ___mcc_h0: Sequence<DafnyCharUTF16> = _source0.value().clone();
                let mut g: Sequence<DafnyCharUTF16> = ___mcc_h0.clone();
                allStrings = seq![g.clone()].concat(&awsKmsKeys.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>)));
            };
            let mut valueOrError0: Arc<Result<Sequence<Arc<AwsKmsIdentifier>>, Arc<Error>>> = crate::implementation_from_dafny::_Seq_Compile::_default::MapWithResult::<Sequence<DafnyCharUTF16>, Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsAwsKmsIdentifierString(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>), &allStrings).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<MultiKeyring>>());
                return output.read();
            };
            let mut allIdentifiers: Sequence<Arc<AwsKmsIdentifier>> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_AwsKmsMrkAreUnique_Compile::_default::AwsKmsMrkAreUnique(&allIdentifiers);
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<MultiKeyring>>());
                return output.read();
            };
            let mut generatorKeyring: Arc<Option<Object<AwsKmsMrkKeyring>>>;
            let mut _source1: Arc<Option<Sequence<DafnyCharUTF16>>> = generator.clone();
            if matches!((&_source1).as_ref(), None{ .. }) {
                generatorKeyring = Arc::new(Option::<Object<AwsKmsMrkKeyring>>::None {});
            } else {
                let mut ___mcc_h1: Sequence<DafnyCharUTF16> = _source1.value().clone();
                let mut generatorIdentifier: Sequence<DafnyCharUTF16> = ___mcc_h1.clone();
                let mut valueOrError2: Arc<Result<Arc<AwsKmsIdentifier>, Arc<Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsAwsKmsIdentifierString(&generatorIdentifier).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<MultiKeyring>>());
                    return output.read();
                };
                let mut arn: Arc<AwsKmsIdentifier> = valueOrError2.Extract();
                let mut region: Arc<Option<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::GetRegion(&arn);
                let mut valueOrError3: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>>;
                let mut _out0: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput {
                                region: region.UnwrapOr(&string_utf16_of(""))
                            }));
                valueOrError3 = _out0.clone();
                if valueOrError3.IsFailure() {
                    output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Object<MultiKeyring>>());
                    return output.read();
                };
                let mut client: Object<dyn IKMSClient> = valueOrError3.Extract();
                let mut g: Object<AwsKmsMrkKeyring>;
                let mut _nw0: Object<AwsKmsMrkKeyring> = AwsKmsMrkKeyring::_allocate_object();
                AwsKmsMrkKeyring::_ctor(&_nw0, &client, &generatorIdentifier, &grantTokens.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>)));
                g = _nw0.clone();
                generatorKeyring = Arc::new(Option::<Object<AwsKmsMrkKeyring>>::Some {
                            value: g.clone()
                        });
            };
            let mut children: Sequence<Object<AwsKmsMrkKeyring>> = seq![] as Sequence<Object<AwsKmsMrkKeyring>>;
            let mut _source2: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> = awsKmsKeys.clone();
            if matches!((&_source2).as_ref(), None{ .. }) {
                children = seq![] as Sequence<Object<AwsKmsMrkKeyring>>;
            } else {
                let mut ___mcc_h2: Sequence<Sequence<DafnyCharUTF16>> = _source2.value().clone();
                let mut childIdentifiers: Sequence<Sequence<DafnyCharUTF16>> = ___mcc_h2.clone();
                let mut _hi0: u64 = truncate!(childIdentifiers.cardinality(), u64);
                for index in integer_range(0, _hi0).map(Into::<u64>::into) {
                    let mut childIdentifier: Sequence<DafnyCharUTF16> = childIdentifiers.get(&int!((&index).clone()));
                    let mut valueOrError4: Arc<Result<Arc<AwsKmsIdentifier>, Arc<Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsAwsKmsIdentifierString(&childIdentifier).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
                    if valueOrError4.IsFailure() {
                        output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Object<MultiKeyring>>());
                        return output.read();
                    };
                    let mut info: Arc<AwsKmsIdentifier> = valueOrError4.Extract();
                    let mut region: Arc<Option<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::GetRegion(&info);
                    let mut valueOrError5: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>>;
                    let mut _out1: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput {
                                    region: region.UnwrapOr(&string_utf16_of(""))
                                }));
                    valueOrError5 = _out1.clone();
                    if valueOrError5.IsFailure() {
                        output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Object<MultiKeyring>>());
                        return output.read();
                    };
                    let mut client: Object<dyn IKMSClient> = valueOrError5.Extract();
                    let mut keyring: Object<AwsKmsMrkKeyring>;
                    let mut _nw1: Object<AwsKmsMrkKeyring> = AwsKmsMrkKeyring::_allocate_object();
                    AwsKmsMrkKeyring::_ctor(&_nw1, &client, &childIdentifier, &grantTokens.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>)));
                    keyring = _nw1.clone();
                    children = children.concat(&seq![keyring.clone()]);
                }
            };
            let mut valueOrError6: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!((&generatorKeyring).as_ref(), Some{ .. }) || 0 < truncate!(children.cardinality(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("generatorKeyring or child Keyrings needed to create a multi keyring")
                        }));
            if valueOrError6.IsFailure() {
                output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Object<MultiKeyring>>());
                return output.read();
            };
            let mut keyring: Object<MultiKeyring>;
            let mut _nw2: Object<MultiKeyring> = MultiKeyring::_allocate_object();
            MultiKeyring::_ctor(&_nw2, &rc_coerce(Option::<Object<AwsKmsMrkKeyring>>::coerce(upcast_object::<AwsKmsMrkKeyring, dyn IKeyring>()))(generatorKeyring.clone()), &Sequence::<Object<AwsKmsMrkKeyring>>::coerce(upcast_object::<AwsKmsMrkKeyring, dyn IKeyring>())(children.clone()));
            keyring = _nw2.clone();
            output = MaybePlacebo::from(Arc::new(Result::<Object<MultiKeyring>, Arc<Error>>::Success {
                            value: keyring.clone()
                        }));
            return output.read();
        }
    }
}
/// ../mpl/libraries/src/NonlinearArithmetic/Mul.dfy(18,1)
pub mod _Mul_Compile {

}
/// ../mpl/libraries/src/NonlinearArithmetic/Internals/MulInternals.dfy(16,1)
pub mod _MulInternals_Compile {
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::int;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/NonlinearArithmetic/Internals/MulInternals.dfy(22,3)
        pub fn MulPos(x: &DafnyInt, y: &DafnyInt) -> DafnyInt {
            let mut _accumulator: DafnyInt = int!(0);
            let mut _r0 = x.clone();
            let mut _r1 = y.clone();
            'TAIL_CALL_START: loop {
                let x = _r0;
                let y = _r1;
                if x.clone() == int!(0) {
                    return int!(0) + _accumulator.clone();
                } else {
                    _accumulator = _accumulator.clone() + y.clone();
                    let mut _in0: DafnyInt = x.clone() - int!(1);
                    let mut _in1: DafnyInt = y.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/libraries/src/NonlinearArithmetic/Internals/MulInternals.dfy(30,3)
        pub fn MulRecursive(x: &DafnyInt, y: &DafnyInt) -> DafnyInt {
            if x.clone() >= int!(0) {
                _default::MulPos(x, y)
            } else {
                int!(-1) * _default::MulPos(&(int!(-1) * x.clone()), y)
            }
        }
    }
}
/// *****************************************************************************
///  Original: Copyright (c) Microsoft Corporation
///  SPDX-License-Identifier: MIT
///
///  Modifications and Extensions: Copyright by the contributors to the Dafny Project
///  SPDX-License-Identifier: MIT
/// *****************************************************************************
/// ../mpl/libraries/src/NonlinearArithmetic/Internals/MulInternalsNonlinear.dfy(11,1)
pub mod _MulInternalsNonlinear_Compile {

}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(19,1)
pub mod _MultiKeyring_Compile {
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::_RawAESKeyring_Compile::RawAESKeyring;
    pub use crate::implementation_from_dafny::_RawECDHKeyring_Compile::RawEcdhKeyring;
    pub use crate::implementation_from_dafny::_RawRSAKeyring_Compile::RawRSAKeyring;
    pub use crate::implementation_from_dafny::_AwsKmsDiscoveryKeyring_Compile::AwsKmsDiscoveryKeyring;
    pub use crate::implementation_from_dafny::_AwsKmsEcdhKeyring_Compile::AwsKmsEcdhKeyring;
    pub use crate::implementation_from_dafny::_AwsKmsHierarchicalKeyring_Compile::AwsKmsHierarchicalKeyring;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::AwsKmsKeyring;
    pub use crate::implementation_from_dafny::_AwsKmsMrkDiscoveryKeyring_Compile::AwsKmsMrkDiscoveryKeyring;
    pub use crate::implementation_from_dafny::_AwsKmsMrkKeyring_Compile::AwsKmsMrkKeyring;
    pub use crate::implementation_from_dafny::_AwsKmsRsaKeyring_Compile::AwsKmsRsaKeyring;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use ::dafny_runtime::seq;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(52,3)
        pub fn _Verified_q(keyring: &Object<dyn IKeyring>) -> bool {
            ({
                    let __is_20: Object<dyn IKeyring> = keyring.clone();
                    __is_20.clone().is_instance_of::<RawAESKeyring>()
                }) || ({
                    let __is_21: Object<dyn IKeyring> = keyring.clone();
                    __is_21.clone().is_instance_of::<RawEcdhKeyring>()
                }) || ({
                    let __is_22: Object<dyn IKeyring> = keyring.clone();
                    __is_22.clone().is_instance_of::<RawRSAKeyring>()
                }) || ({
                    let __is_23: Object<dyn IKeyring> = keyring.clone();
                    __is_23.clone().is_instance_of::<AwsKmsDiscoveryKeyring>()
                }) || ({
                    let __is_24: Object<dyn IKeyring> = keyring.clone();
                    __is_24.clone().is_instance_of::<AwsKmsEcdhKeyring>()
                }) || ({
                    let __is_25: Object<dyn IKeyring> = keyring.clone();
                    __is_25.clone().is_instance_of::<AwsKmsHierarchicalKeyring>()
                }) || ({
                    let __is_26: Object<dyn IKeyring> = keyring.clone();
                    __is_26.clone().is_instance_of::<AwsKmsKeyring>()
                }) || ({
                    let __is_27: Object<dyn IKeyring> = keyring.clone();
                    __is_27.clone().is_instance_of::<AwsKmsMrkDiscoveryKeyring>()
                }) || ({
                    let __is_28: Object<dyn IKeyring> = keyring.clone();
                    __is_28.clone().is_instance_of::<AwsKmsMrkKeyring>()
                }) || ({
                    let __is_29: Object<dyn IKeyring> = keyring.clone();
                    __is_29.clone().is_instance_of::<AwsKmsRsaKeyring>()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(461,3)
        pub fn AttemptDecryptDataKey(keyring: &Object<dyn IKeyring>, input: &Arc<OnDecryptInput>) -> Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>>;
            let mut _out0: Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>> = IKeyring::OnDecrypt(rd!(keyring.clone()), input);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut output: Arc<OnDecryptOutput> = valueOrError0.Extract();
            if !(_default::_Verified_q(keyring) || ({
                        let __is_30: Object<dyn IKeyring> = keyring.clone();
                        __is_30.clone().is_instance_of::<MultiKeyring>()
                    })) {
                let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsTransitionIsValid(input.materials(), output.materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Keyring performed invalid material transition")
                            }));
                if valueOrError1.IsFailure() {
                    res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                    return res.read();
                }
            };
            res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(69,3)
    pub struct MultiKeyring {
        pub __i_generatorKeyring: Arc<Option<Object<dyn IKeyring>>>,
        pub __i_childKeyrings: Sequence<Object<dyn IKeyring>>
    }

    impl MultiKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// = aws-encryption-sdk-specification/framework/multi-keyring.md#inputs
        /// = type=implication
        /// # On keyring initialization, a keyring MUST define at least one of the
        /// # following:
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(95,5)
        pub fn _ctor(this: &Object<MultiKeyring>, generatorKeyring: &Arc<Option<Object<dyn IKeyring>>>, childKeyrings: &Sequence<Object<dyn IKeyring>>) -> () {
            let mut _set___i_generatorKeyring: bool = false;
            let mut _set___i_childKeyrings: bool = false;
            update_field_uninit_object!(this.clone(), __i_generatorKeyring, _set___i_generatorKeyring, generatorKeyring.clone());
            update_field_uninit_object!(this.clone(), __i_childKeyrings, _set___i_childKeyrings, childKeyrings.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(92,5)
        pub fn generatorKeyring(&self) -> Arc<Option<Object<dyn IKeyring>>> {
            self.__i_generatorKeyring.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(93,5)
        pub fn childKeyrings(&self) -> Sequence<Object<dyn IKeyring>> {
            self.__i_childKeyrings.clone()
        }
    }

    impl UpcastObject<DynAny>
        for MultiKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for MultiKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for MultiKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for MultiKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(176,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>>>::new();
            if matches!((&self.generatorKeyring().clone()).as_ref(), None{ .. }) && matches!(input.materials().plaintextDataKey().as_ref(), None{ .. }) {
                let mut exception: Sequence<DafnyCharUTF16> = string_utf16_of("Need either a generator keyring or input encryption materials which contain a plaintext data key");
                res = MaybePlacebo::from(Arc::new(Result::<Arc<OnEncryptOutput>, Arc<Error>>::Failure {
                                error: Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                            message: exception.clone()
                                        })
                            }));
                return res.read();
            };
            let mut returnMaterials: Arc<EncryptionMaterials> = input.materials().clone();
            if matches!((&self.generatorKeyring().clone()).as_ref(), Some{ .. }) {
                let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(input.materials().plaintextDataKey().as_ref(), None{ .. }), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("This multi keyring has a generator but provided Encryption Materials already contain plaintext data key")
                            }));
                if valueOrError0.IsFailure() {
                    res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return res.read();
                };
                let mut onEncryptOutput: Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>>;
                let mut _out0: Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>> = IKeyring::OnEncrypt(rd!(self.generatorKeyring().clone().value().clone()), input);
                onEncryptOutput = _out0.clone();
                let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!((&onEncryptOutput).as_ref(), Success{ .. }), &(if matches!((&onEncryptOutput).as_ref(), Failure{ .. }) {
                            onEncryptOutput.error().clone()
                        } else {
                            Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Unexpected failure. Input to Need is !Success.")
                                })
                        }));
                if valueOrError1.IsFailure() {
                    res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return res.read();
                };
                if !(_default::_Verified_q(self.generatorKeyring().clone().value()) || ({
                            let __is_31: Object<dyn IKeyring> = self.generatorKeyring().clone().value().clone();
                            __is_31.clone().is_instance_of::<MultiKeyring>()
                        })) {
                    let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(onEncryptOutput.value().materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Could not retrieve materials required for encryption")
                                }));
                    if valueOrError2.IsFailure() {
                        res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return res.read();
                    };
                    let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(input.materials(), onEncryptOutput.value().materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Generator keyring returned invalid encryption materials")
                                }));
                    if valueOrError3.IsFailure() {
                        res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return res.read();
                    }
                };
                returnMaterials = onEncryptOutput.value().materials().clone();
            };
            let mut _hi0: u64 = truncate!(self.childKeyrings().clone().cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut onEncryptInput: Arc<OnEncryptInput> = Arc::new(OnEncryptInput::OnEncryptInput {
                            materials: returnMaterials.clone()
                        });
                let mut child: Object<dyn IKeyring> = self.childKeyrings().clone().get(&int!((&i).clone()));
                let mut onEncryptOutput: Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>>;
                let mut _out1: Arc<Result<Arc<OnEncryptOutput>, Arc<Error>>> = IKeyring::OnEncrypt(rd!(child.clone()), &onEncryptInput);
                onEncryptOutput = _out1.clone();
                let mut valueOrError4: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!((&onEncryptOutput).as_ref(), Success{ .. }), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Child keyring failed to encrypt plaintext data key")
                            }));
                if valueOrError4.IsFailure() {
                    res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return res.read();
                };
                if !(_default::_Verified_q(&child) || ({
                            let __is_32: Object<dyn IKeyring> = child.clone();
                            __is_32.clone().is_instance_of::<MultiKeyring>()
                        })) {
                    let mut valueOrError5: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(onEncryptOutput.value().materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Could not retrieve materials required for encryption")
                                }));
                    if valueOrError5.IsFailure() {
                        res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return res.read();
                    };
                    let mut valueOrError6: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::ValidEncryptionMaterialsTransition(&returnMaterials, onEncryptOutput.value().materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: string_utf16_of("Child keyring performed invalid transition on encryption materials")
                                }));
                    if valueOrError6.IsFailure() {
                        res = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return res.read();
                    }
                };
                returnMaterials = onEncryptOutput.value().materials().clone();
            }
            res = MaybePlacebo::from(Arc::new(Result::<Arc<OnEncryptOutput>, Arc<Error>>::Success {
                            value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                        materials: returnMaterials.clone()
                                    })
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/MultiKeyring.dfy(353,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>>>::new();
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(input.materials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")
                        }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut failures: Sequence<Arc<Error>> = seq![] as Sequence<Arc<Error>>;
            if matches!((&self.generatorKeyring().clone()).as_ref(), Some{ .. }) {
                let mut result: Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>>;
                let mut _out0: Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>> = _default::AttemptDecryptDataKey(self.generatorKeyring().clone().value(), input);
                result = _out0.clone();
                if matches!((&result).as_ref(), Success{ .. }) {
                    if matches!(result.value().materials().plaintextDataKey().as_ref(), Some{ .. }) {
                        res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Success {
                                        value: result.value().clone()
                                    }));
                        return res.read();
                    }
                } else {
                    failures = failures.concat(&seq![result.error().clone()]);
                }
            };
            let mut _hi0: u64 = truncate!(self.childKeyrings().clone().cardinality(), u64);
            for j in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut result: Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>>;
                let mut _out1: Arc<Result<Arc<OnDecryptOutput>, Arc<Error>>> = _default::AttemptDecryptDataKey(&self.childKeyrings().clone().get(&int!((&j).clone())), input);
                result = _out1.clone();
                if matches!((&result).as_ref(), Success{ .. }) {
                    res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Success {
                                    value: result.value().clone()
                                }));
                    return res.read();
                } else {
                    failures = failures.concat(&seq![result.error().clone()]);
                }
            }
            let mut combinedResult: Arc<Error> = Arc::new(Error::CollectionOfErrors {
                        list: failures.clone(),
                        message: string_utf16_of("No Configured Keyring was able to decrypt the Data Key. The list of encountered Exceptions is available via `list`.")
                    });
            res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<Error>>::Failure {
                            error: combinedResult.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for MultiKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }
}
/// ../mpl/StandardLibrary/src/OsLang.dfy(4,1)
pub mod OsLang {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::string_utf16_of;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/OsLang.dfy(18,3)
        pub fn GetPlatformShort() -> Sequence<DafnyCharUTF16> {
            _default::GetLanguageShort().concat(&string_utf16_of(" ")).concat(&_default::GetOsShort())
        }
        /// ../mpl/StandardLibrary/src/OsLang.dfy(23,3)
        pub fn GetPlatformLong() -> Sequence<DafnyCharUTF16> {
            _default::GetLanguageLong().concat(&string_utf16_of(" ")).concat(&_default::GetOsLong())
        }
    }
}
/// ../mpl/libraries/src/NonlinearArithmetic/Power.dfy(20,1)
pub mod _Power_Compile {
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::_System::nat;
    pub use ::dafny_runtime::int;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/NonlinearArithmetic/Power.dfy(26,3)
        pub fn Pow(b: &DafnyInt, e: &nat) -> DafnyInt {
            let mut _accumulator: DafnyInt = int!(1);
            let mut _r0 = b.clone();
            let mut _r1 = e.clone();
            'TAIL_CALL_START: loop {
                let b = _r0;
                let e = _r1;
                if e.clone() == int!(0) {
                    return int!(1) * _accumulator.clone();
                } else {
                    _accumulator = _accumulator.clone() * b.clone();
                    let mut _in0: DafnyInt = b.clone();
                    let mut _in1: DafnyInt = e.clone() - int!(1);
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(6,1)
pub mod RSAEncryption {
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBitsToGenerate;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPublicKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPrivateKey;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::_dafny_externs::RSAEncryption::RSA;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAModulusLengthBits;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSADecryptInput;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAEncryptInput;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(12,3)
        pub fn GenerateKeyPair(lengthBits: RSAModulusLengthBitsToGenerate) -> (Arc<RSAPublicKey>, Arc<RSAPrivateKey>) {
            let mut publicKey: Arc<RSAPublicKey>;
            let mut privateKey: Arc<RSAPrivateKey>;
            let mut pemPublic: Sequence<u8>;
            let mut pemPrivate: Sequence<u8>;
            let mut _out0: Sequence<u8>;
            let mut _out1: Sequence<u8>;
            let _x = RSA::GenerateKeyPairExtern(lengthBits);
            _out0 = _x.0;
            _out1 = _x.1;
            pemPublic = _out0.clone();
            pemPrivate = _out1.clone();
            privateKey = Arc::new(RSAPrivateKey::RSAPrivateKey {
                        lengthBits: lengthBits,
                        pem: pemPrivate.clone()
                    });
            publicKey = Arc::new(RSAPublicKey::RSAPublicKey {
                        lengthBits: lengthBits,
                        pem: pemPublic.clone()
                    });
            return (
                    publicKey.clone(),
                    privateKey.clone()
                );
        }
        /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(20,3)
        pub fn GetRSAKeyModulusLength(publicKey: &Sequence<u8>) -> Arc<Result<RSAModulusLengthBits, Arc<Error>>> {
            let mut valueOrError0: Arc<Result<u32, Arc<Error>>> = RSA::GetRSAKeyModulusLengthExtern(publicKey);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<i32>()
            } else {
                let mut length: u32 = valueOrError0.Extract();
                let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(81 <= length as u64 && (length as u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                                message: string_utf16_of("Unsupported length for RSA modulus.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<i32>()
                } else {
                    Arc::new(Result::<i32, Arc<Error>>::Success {
                            value: length as i32
                        })
                }
            }
        }
        /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(29,3)
        pub fn Decrypt(input: &Arc<RSADecryptInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(0 < truncate!(input.privateKey().cardinality(), u64) && 0 < truncate!(input.cipherText().cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>> = RSA::DecryptExtern(input.padding(), input.privateKey(), input.cipherText());
            output = MaybePlacebo::from(_out0.clone());
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(38,3)
        pub fn Encrypt(input: &Arc<RSAEncryptInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(0 < truncate!(input.publicKey().cardinality(), u64) && 0 < truncate!(input.plaintext().cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut _out0: Arc<Result<Sequence<u8>, Arc<Error>>> = RSA::EncryptExtern(input.padding(), input.publicKey(), input.plaintext());
            output = MaybePlacebo::from(_out0.clone());
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(72,3)
        pub fn CreateGetRSAKeyModulusLengthExternSuccess(output: u32) -> Arc<Result<u32, Arc<Error>>> {
            Arc::new(Result::<u32, Arc<Error>>::Success {
                    value: output
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(76,3)
        pub fn CreateGetRSAKeyModulusLengthExternFailure(error: &Arc<Error>) -> Arc<Result<u32, Arc<Error>>> {
            Arc::new(Result::<u32, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(80,3)
        pub fn CreateBytesSuccess(bytes: &Sequence<u8>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: bytes.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/RSAEncryption.dfy(84,3)
        pub fn CreateBytesFailure(error: &Arc<Error>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(6,1)
pub mod _Random_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::OpaqueError;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/Random.dfy(13,3)
        pub fn GenerateBytes(i: i32) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Result<Sequence<u8>, OpaqueError>>;
            let mut _out0: Arc<Result<Sequence<u8>, OpaqueError>> = crate::implementation_from_dafny::ExternRandom::_default::GenerateBytes(i);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut value: Sequence<u8> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(value.cardinality(), u64) == i as u64, &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("Incorrect length from ExternRandom.")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: value.clone()
                        }));
            return res.read();
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(14,1)
pub mod _RawAESKeyring_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptOutput;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapOutput;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESEncryptInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AESDecryptInput;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(442,3)
        pub fn DeserializeEDKCiphertext(ciphertext: &Sequence<u8>, tagLen: u64) -> Arc<AESEncryptOutput> {
            let mut encryptedKeyLength: u64 = truncate!(ciphertext.cardinality(), u64) - tagLen;
            Arc::new(AESEncryptOutput::AESEncryptOutput {
                    cipherText: ciphertext.take(&int!((&encryptedKeyLength).clone())),
                    authTag: ciphertext.drop(&int!((&encryptedKeyLength).clone()))
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(457,3)
        pub fn SerializeEDKCiphertext(encOutput: &Arc<AESEncryptOutput>) -> Sequence<u8> {
            encOutput.cipherText().concat(encOutput.authTag())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(35,3)
        pub fn AUTH_TAG_LEN_LEN() -> u64 {
            4
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(36,3)
        pub fn IV_LEN_LEN() -> u64 {
            4
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(38,3)
    pub struct RawAESKeyring {
        pub __i_wrappingKey: Sequence<u8>,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_wrappingAlgorithm: Arc<AES_GCM>,
        pub __i_keyNamespace: ValidUTF8Bytes,
        pub __i_keyName: ValidUTF8Bytes
    }

    impl RawAESKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(81,5)
        pub fn _ctor(this: &Object<RawAESKeyring>, namespace: &ValidUTF8Bytes, name: &ValidUTF8Bytes, key: &Sequence<u8>, wrappingAlgorithm: &Arc<AES_GCM>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_wrappingKey: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_wrappingAlgorithm: bool = false;
            let mut _set___i_keyNamespace: bool = false;
            let mut _set___i_keyName: bool = false;
            update_field_uninit_object!(this.clone(), __i_keyNamespace, _set___i_keyNamespace, namespace.clone());
            update_field_uninit_object!(this.clone(), __i_keyName, _set___i_keyName, name.clone());
            update_field_uninit_object!(this.clone(), __i_wrappingKey, _set___i_wrappingKey, key.clone());
            update_field_uninit_object!(this.clone(), __i_wrappingAlgorithm, _set___i_wrappingAlgorithm, wrappingAlgorithm.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(396,5)
        pub fn SerializeProviderInfo(&self, iv: &Sequence<u8>) -> Sequence<u8> {
            self.keyName().clone().concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq((self.wrappingAlgorithm().clone().tagLength().clone() * 8) as u32)).concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(self.wrappingAlgorithm().clone().ivLength().clone() as u32)).concat(iv)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(405,5)
        pub fn ShouldDecryptEDK(&self, edk: &Arc<EncryptedDataKey>) -> bool {
            edk.keyProviderId().clone() == self.keyNamespace().clone() && self.ValidProviderInfo(edk.keyProviderInfo())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(411,5)
        pub fn ValidProviderInfo(&self, info: &Sequence<u8>) -> bool {
            let mut keyname_size: u64 = truncate!(self.keyName().clone().cardinality(), u64);
            truncate!(info.cardinality(), u64) == crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add4(keyname_size, _default::AUTH_TAG_LEN_LEN(), _default::IV_LEN_LEN(), self.wrappingAlgorithm().clone().ivLength().clone() as u64) && info.take(&int!((&keyname_size).clone())) == self.keyName().clone() && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&info.slice(&int!((&keyname_size).clone()), &int!((&(keyname_size + _default::AUTH_TAG_LEN_LEN())).clone()))) == 128 && 128 == self.wrappingAlgorithm().clone().tagLength().clone() as u32 * 8 && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&info.slice(&int!((&(keyname_size + _default::AUTH_TAG_LEN_LEN())).clone()), &int!((&(keyname_size + _default::AUTH_TAG_LEN_LEN() + _default::IV_LEN_LEN())).clone()))) == self.wrappingAlgorithm().clone().ivLength().clone() as u32 && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&info.slice(&int!((&(keyname_size + _default::AUTH_TAG_LEN_LEN())).clone()), &int!((&(keyname_size + _default::AUTH_TAG_LEN_LEN() + _default::IV_LEN_LEN())).clone()))) == 12
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(434,5)
        pub fn GetIvFromProvInfo(&self, info: &Sequence<u8>) -> Sequence<u8> {
            info.drop(&int!((&(truncate!(self.keyName().clone().cardinality(), u64) + _default::AUTH_TAG_LEN_LEN() + _default::IV_LEN_LEN())).clone()))
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(75,5)
        pub fn wrappingKey(&self) -> Sequence<u8> {
            self.__i_wrappingKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(43,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(76,5)
        pub fn wrappingAlgorithm(&self) -> Arc<AES_GCM> {
            self.__i_wrappingAlgorithm.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(56,5)
        pub fn keyNamespace(&self) -> ValidUTF8Bytes {
            self.__i_keyNamespace.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(57,5)
        pub fn keyName(&self) -> ValidUTF8Bytes {
            self.__i_keyName.clone()
        }
    }

    impl UpcastObject<DynAny>
        for RawAESKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for RawAESKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for RawAESKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for RawAESKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(143,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut materials: Arc<EncryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = materials.algorithmSuite().clone();
            let mut wrap: Object<AesWrapKeyMaterial>;
            let mut _nw0: Object<AesWrapKeyMaterial> = AesWrapKeyMaterial::_allocate_object();
            AesWrapKeyMaterial::_ctor(&_nw0, &self.wrappingKey().clone(), &self.wrappingAlgorithm().clone(), &self.cryptoPrimitives().clone());
            wrap = _nw0.clone();
            let mut generateAndWrap: Object<AesGenerateAndWrapKeyMaterial>;
            let mut _nw1: Object<AesGenerateAndWrapKeyMaterial> = AesGenerateAndWrapKeyMaterial::_allocate_object();
            AesGenerateAndWrapKeyMaterial::_ctor(&_nw1, &wrap);
            generateAndWrap = _nw1.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::WrapEdkMaterial::<Arc<AesWrapInfo>>(&materials, &upcast_object::<AesWrapKeyMaterial, dyn WrapMaterial<Arc<AesWrapInfo>>>()(wrap.clone()), &upcast_object::<AesGenerateAndWrapKeyMaterial, dyn GenerateAndWrapMaterial<Arc<AesWrapInfo>>>()(generateAndWrap.clone()));
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnEncryptOutput>>());
                return output.read();
            };
            let mut wrapOutput: Arc<WrapEdkMaterialOutput<Arc<AesWrapInfo>>> = valueOrError0.Extract();
            let mut symmetricSigningKeyList: Arc<Option<Sequence<Sequence<u8>>>>;
            if matches!(wrapOutput.symmetricSigningKey().as_ref(), Some{ .. }) {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                            value: seq![wrapOutput.symmetricSigningKey().value().clone()]
                        });
            } else {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::None {});
            };
            let mut edk: Arc<EncryptedDataKey> = Arc::new(EncryptedDataKey::EncryptedDataKey {
                        keyProviderId: self.keyNamespace().clone(),
                        keyProviderInfo: self.SerializeProviderInfo(wrapOutput.wrapInfo().iv()),
                        ciphertext: wrapOutput.wrappedMaterial().clone()
                    });
            if matches!((&wrapOutput).as_ref(), GenerateAndWrapEdkMaterialOutput{ .. }) {
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddDataKey(&materials, wrapOutput.plaintextDataKey(), &seq![edk.clone()], &symmetricSigningKeyList);
                if valueOrError1.IsFailure() {
                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return output.read();
                };
                let mut result: Arc<EncryptionMaterials> = valueOrError1.Extract();
                output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                            materials: result.clone()
                                        })
                            }));
                return output.read();
            } else {
                if matches!((&wrapOutput).as_ref(), WrapOnlyEdkMaterialOutput{ .. }) {
                    let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddEncryptedDataKeys(&materials, &seq![edk.clone()], &symmetricSigningKeyList);
                    if valueOrError2.IsFailure() {
                        output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return output.read();
                    };
                    let mut result: Arc<EncryptionMaterials> = valueOrError2.Extract();
                    output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                    value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                                materials: result.clone()
                                            })
                                }));
                    return output.read();
                }
            };
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(275,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(&materials), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.materials().encryptionContext());
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut aad: Sequence<u8> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(self.wrappingKey().clone().cardinality(), u64) == self.wrappingAlgorithm().clone().keyLength().clone() as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("The wrapping key does not match the wrapping algorithm")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut errors: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>> = seq![] as Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>;
            let mut _hi0: u64 = truncate!(input.encryptedDataKeys().cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                if self.ShouldDecryptEDK(&input.encryptedDataKeys().get(&int!((&i).clone()))) {
                    let mut edk: Arc<EncryptedDataKey> = input.encryptedDataKeys().get(&int!((&i).clone()));
                    let mut iv: Sequence<u8> = self.GetIvFromProvInfo(edk.keyProviderInfo());
                    let mut unwrap: Object<AesUnwrapKeyMaterial>;
                    let mut _nw0: Object<AesUnwrapKeyMaterial> = AesUnwrapKeyMaterial::_allocate_object();
                    AesUnwrapKeyMaterial::_ctor(&_nw0, &self.wrappingKey().clone(), &self.wrappingAlgorithm().clone(), &iv, &self.cryptoPrimitives().clone());
                    unwrap = _nw0.clone();
                    let mut unwrapOutput: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                    let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::<Arc<AesUnwrapInfo>>(edk.ciphertext(), &materials, &upcast_object::<AesUnwrapKeyMaterial, dyn UnwrapMaterial<Arc<AesUnwrapInfo>>>()(unwrap.clone()));
                    unwrapOutput = _out0.clone();
                    if matches!((&unwrapOutput).as_ref(), Success{ .. }) {
                        let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&materials, unwrapOutput.value().plaintextDataKey(), unwrapOutput.value().symmetricSigningKey());
                        if valueOrError3.IsFailure() {
                            output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnDecryptOutput>>());
                            return output.read();
                        };
                        let mut result: Arc<DecryptionMaterials> = valueOrError3.Extract();
                        let mut value: Arc<OnDecryptOutput> = Arc::new(OnDecryptOutput::OnDecryptOutput {
                                    materials: result.clone()
                                });
                        output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                        value: value.clone()
                                    }));
                        return output.read();
                    } else {
                        errors = errors.concat(&seq![unwrapOutput.error().clone()]);
                    }
                } else {
                    let mut valueOrError4: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(input.encryptedDataKeys().get(&int!((&i).clone())).keyProviderId()).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                                Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                        Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                                message: e.clone()
                                            })
                                    })
                            }));
                    if valueOrError4.IsFailure() {
                        output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnDecryptOutput>>());
                        return output.read();
                    };
                    let mut extractedKeyProviderId: Sequence<DafnyCharUTF16> = valueOrError4.Extract();
                    errors = errors.concat(&seq![Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                        message: crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectRawDataKeys(&crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&i).clone())), &string_utf16_of("AESKeyring"), &extractedKeyProviderId)
                                    })]);
                }
            }
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                            error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::CollectionOfErrors {
                                        list: errors.clone(),
                                        message: string_utf16_of("Raw AES Keyring was unable to decrypt any encrypted data key. The list of encountered Exceptions is avaible via `list`.")
                                    })
                        }));
            return output.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for RawAESKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(474,3)
    #[derive(PartialEq, Clone)]
    pub enum AesUnwrapInfo {
        AesUnwrapInfo {}
    }

    impl AesUnwrapInfo {}

    impl Debug
        for AesUnwrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for AesUnwrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                AesUnwrapInfo::AesUnwrapInfo{} => {
                    write!(_formatter, "RawAESKeyring_Compile.AesUnwrapInfo.AesUnwrapInfo")?;
                    Ok(())
                },
            }
        }
    }

    impl AesUnwrapInfo {
        /// Enumerates all possible values of AesUnwrapInfo
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<AesUnwrapInfo>> {
            seq![Arc::new(AesUnwrapInfo::AesUnwrapInfo {})].iter()
        }
    }

    impl Eq
        for AesUnwrapInfo {}

    impl Hash
        for AesUnwrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                AesUnwrapInfo::AesUnwrapInfo{} => {

                },
            }
        }
    }

    impl Default
        for AesUnwrapInfo {
        fn default() -> AesUnwrapInfo {
            AesUnwrapInfo::AesUnwrapInfo {}
        }
    }

    impl AsRef<AesUnwrapInfo>
        for AesUnwrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(475,3)
    #[derive(PartialEq, Clone)]
    pub enum AesWrapInfo {
        AesWrapInfo {
            iv: Sequence<u8>
        }
    }

    impl AesWrapInfo {
        /// Returns a borrow of the field iv
        pub fn iv(&self) -> &Sequence<u8> {
            match self {
                AesWrapInfo::AesWrapInfo{iv, } => iv,
            }
        }
    }

    impl Debug
        for AesWrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for AesWrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                AesWrapInfo::AesWrapInfo{iv, } => {
                    write!(_formatter, "RawAESKeyring_Compile.AesWrapInfo.AesWrapInfo(")?;
                    DafnyPrint::fmt_print(iv, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for AesWrapInfo {}

    impl Hash
        for AesWrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                AesWrapInfo::AesWrapInfo{iv, } => {
                    Hash::hash(iv, _state)
                },
            }
        }
    }

    impl Default
        for AesWrapInfo {
        fn default() -> AesWrapInfo {
            AesWrapInfo::AesWrapInfo {
                iv: Default::default()
            }
        }
    }

    impl AsRef<AesWrapInfo>
        for AesWrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(477,3)
    pub struct AesGenerateAndWrapKeyMaterial {
        pub __i_wrap: Object<AesWrapKeyMaterial>
    }

    impl AesGenerateAndWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(482,5)
        pub fn _ctor(this: &Object<AesGenerateAndWrapKeyMaterial>, wrap: &Object<AesWrapKeyMaterial>) -> () {
            let mut _set___i_wrap: bool = false;
            update_field_uninit_object!(this.clone(), __i_wrap, _set___i_wrap, wrap.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(480,5)
        pub fn wrap(&self) -> Object<AesWrapKeyMaterial> {
            self.__i_wrap.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AesGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl GenerateAndWrapMaterial<Arc<AesWrapInfo>>
        for AesGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn GenerateAndWrapMaterial<Arc<AesWrapInfo>>>
        for AesGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn GenerateAndWrapMaterial<Arc<AesWrapInfo>>);
    }

    impl ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for AesGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for AesGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for AesGenerateAndWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(532,5)
        fn Invoke(&self, input: &Arc<GenerateAndWrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut generateBytesResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(rd!(self.wrap().clone().clone()).cryptoPrimitives().clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                            length: crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite())
                        }));
            generateBytesResult = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = generateBytesResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>>());
                return res.read();
            };
            let mut plaintextMaterial: Sequence<u8> = valueOrError0.Extract();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = Action::<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::Invoke(rd!(self.wrap().clone()), &Arc::new(WrapInput::WrapInput {
                            plaintextMaterial: plaintextMaterial.clone(),
                            algorithmSuite: input.algorithmSuite().clone(),
                            encryptionContext: input.encryptionContext().clone(),
                            serializedEC: input.serializedEC().clone()
                        }));
            valueOrError1 = _out1.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>>());
                return res.read();
            };
            let mut wrapOutput: Arc<WrapOutput<Arc<AesWrapInfo>>> = valueOrError1.Extract();
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(GenerateAndWrapOutput::<Arc<AesWrapInfo>>::GenerateAndWrapOutput {
                                        plaintextMaterial: plaintextMaterial.clone(),
                                        wrappedMaterial: wrapOutput.wrappedMaterial().clone(),
                                        wrapInfo: wrapOutput.wrapInfo().clone()
                                    })
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for AesGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(576,3)
    pub struct AesWrapKeyMaterial {
        pub __i_wrappingKey: Sequence<u8>,
        pub __i_wrappingAlgorithm: Arc<AES_GCM>,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>
    }

    impl AesWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(583,5)
        pub fn _ctor(this: &Object<AesWrapKeyMaterial>, wrappingKey: &Sequence<u8>, wrappingAlgorithm: &Arc<AES_GCM>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_wrappingKey: bool = false;
            let mut _set___i_wrappingAlgorithm: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            update_field_uninit_object!(this.clone(), __i_wrappingKey, _set___i_wrappingKey, wrappingKey.clone());
            update_field_uninit_object!(this.clone(), __i_wrappingAlgorithm, _set___i_wrappingAlgorithm, wrappingAlgorithm.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(579,5)
        pub fn wrappingKey(&self) -> Sequence<u8> {
            self.__i_wrappingKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(580,5)
        pub fn wrappingAlgorithm(&self) -> Arc<AES_GCM> {
            self.__i_wrappingAlgorithm.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(581,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AesWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl WrapMaterial<Arc<AesWrapInfo>>
        for AesWrapKeyMaterial {}

    impl UpcastObject<dyn WrapMaterial<Arc<AesWrapInfo>>>
        for AesWrapKeyMaterial {
        UpcastObjectFn!(dyn WrapMaterial<Arc<AesWrapInfo>>);
    }

    impl ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for AesWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for AesWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for AesWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(638,5)
        fn Invoke(&self, input: &Arc<WrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.encryptionContext());
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<WrapOutput<Arc<AesWrapInfo>>>>());
                return res.read();
            };
            let mut aad: Sequence<u8> = valueOrError0.Extract();
            let mut randomIvResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(self.cryptoPrimitives().clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                            length: self.wrappingAlgorithm().clone().ivLength().clone()
                        }));
            randomIvResult = _out0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = randomIvResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<WrapOutput<Arc<AesWrapInfo>>>>());
                return res.read();
            };
            let mut iv: Sequence<u8> = valueOrError1.Extract();
            let mut aesEncryptResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESEncrypt(rd!(self.cryptoPrimitives().clone()), &Arc::new(AESEncryptInput::AESEncryptInput {
                            encAlg: self.wrappingAlgorithm().clone(),
                            iv: iv.clone(),
                            key: self.wrappingKey().clone(),
                            msg: input.plaintextMaterial().clone(),
                            aad: aad.clone()
                        }));
            aesEncryptResult = _out1.clone();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<AESEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = aesEncryptResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<WrapOutput<Arc<AesWrapInfo>>>>());
                return res.read();
            };
            let mut wrappedMaterialResult: Arc<AESEncryptOutput> = valueOrError2.Extract();
            let mut wrappedMaterial: Sequence<u8> = _default::SerializeEDKCiphertext(&wrappedMaterialResult);
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(WrapOutput::<Arc<AesWrapInfo>>::WrapOutput {
                                        wrappedMaterial: wrappedMaterial.clone(),
                                        wrapInfo: Arc::new(AesWrapInfo::AesWrapInfo {
                                                    iv: iv.clone()
                                                })
                                    })
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for AesWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<AesWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(676,3)
    pub struct AesUnwrapKeyMaterial {
        pub __i_wrappingKey: Sequence<u8>,
        pub __i_iv: Sequence<u8>,
        pub __i_wrappingAlgorithm: Arc<AES_GCM>,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>
    }

    impl AesUnwrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(684,5)
        pub fn _ctor(this: &Object<AesUnwrapKeyMaterial>, wrappingKey: &Sequence<u8>, wrappingAlgorithm: &Arc<AES_GCM>, iv: &Sequence<u8>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_wrappingKey: bool = false;
            let mut _set___i_iv: bool = false;
            let mut _set___i_wrappingAlgorithm: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            update_field_uninit_object!(this.clone(), __i_wrappingKey, _set___i_wrappingKey, wrappingKey.clone());
            update_field_uninit_object!(this.clone(), __i_iv, _set___i_iv, iv.clone());
            update_field_uninit_object!(this.clone(), __i_wrappingAlgorithm, _set___i_wrappingAlgorithm, wrappingAlgorithm.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(679,5)
        pub fn wrappingKey(&self) -> Sequence<u8> {
            self.__i_wrappingKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(681,5)
        pub fn iv(&self) -> Sequence<u8> {
            self.__i_iv.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(680,5)
        pub fn wrappingAlgorithm(&self) -> Arc<AES_GCM> {
            self.__i_wrappingAlgorithm.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(682,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
    }

    impl UpcastObject<DynAny>
        for AesUnwrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl UnwrapMaterial<Arc<AesUnwrapInfo>>
        for AesUnwrapKeyMaterial {}

    impl UpcastObject<dyn UnwrapMaterial<Arc<AesUnwrapInfo>>>
        for AesUnwrapKeyMaterial {
        UpcastObjectFn!(dyn UnwrapMaterial<Arc<AesUnwrapInfo>>);
    }

    impl ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for AesUnwrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for AesUnwrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for AesUnwrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawAESKeyring.dfy(746,5)
        fn Invoke(&self, input: &Arc<UnwrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.encryptionContext());
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>>());
                return res.read();
            };
            let mut aad: Sequence<u8> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>((self.wrappingAlgorithm().clone().tagLength().clone() as u64) <= truncate!(input.wrappedMaterial().cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Insufficient data to decrypt.")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>>());
                return res.read();
            };
            let mut encryptionOutput: Arc<AESEncryptOutput> = _default::DeserializeEDKCiphertext(input.wrappedMaterial(), self.wrappingAlgorithm().clone().tagLength().clone() as u64);
            let mut maybePtKey: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::AESDecrypt(rd!(self.cryptoPrimitives().clone()), &Arc::new(AESDecryptInput::AESDecryptInput {
                            encAlg: self.wrappingAlgorithm().clone(),
                            key: self.wrappingKey().clone(),
                            cipherTxt: encryptionOutput.cipherText().clone(),
                            authTag: encryptionOutput.authTag().clone(),
                            iv: self.iv().clone(),
                            aad: aad.clone()
                        }));
            maybePtKey = _out0.clone();
            let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybePtKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>>());
                return res.read();
            };
            let mut ptKey: Sequence<u8> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite()) as u64 == truncate!(ptKey.cardinality(), u64), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Plaintext Data Key is not the expected length")
                        }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(UnwrapOutput::<Arc<AesUnwrapInfo>>::UnwrapOutput {
                                        unwrappedMaterial: ptKey.clone(),
                                        unwrapInfo: Arc::new(AesUnwrapInfo::AesUnwrapInfo {})
                                    })
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for AesUnwrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<AesUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(16,1)
pub mod _RawECDHKeyring_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::truncate;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPublicKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DeriveSharedSecretOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DeriveSharedSecretInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::CompressPublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DecompressPublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECCKeyPairInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ValidatePublicKeyInput;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec::ECC_NIST_P256;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec::ECC_NIST_P384;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec::ECC_NIST_P521;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::update_field_if_uninit_object;
    pub use ::std::default::Default;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations::PublicKeyDiscovery;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations::EphemeralPrivateKeyToStaticPublicKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhGenerateAndWrapKeyMaterial;
    pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhWrapKeyMaterial;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhWrapInfo;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicActionWithResult;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_Materials_Compile::SealedDecryptionMaterials;
    pub use crate::implementation_from_dafny::_Actions_Compile::DeterministicAction;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::_Materials_Compile::DecryptionMaterialsPendingPlaintextDataKey;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PublicKeyDiscoveryInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawEcdhStaticConfigurations::RawPrivateKeyToStaticPublicKey;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::RawPrivateKeyToStaticPublicKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EphemeralPrivateKeyToStaticPublicKeyInput;
    pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhUnwrap;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::EcdhUnwrapInfo;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(42,3)
        pub fn ValidPublicKeyLength(p: &Sequence<u8>) -> bool {
            let mut len: u64 = truncate!(p.cardinality(), u64);
            true && (len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_LEN_ECC_NIST_256() || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_LEN_ECC_NIST_384() || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_LEN_ECC_NIST_521())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(51,3)
        pub fn ValidCompressedPublicKeyLength(p: &Sequence<u8>) -> bool {
            let mut len: u64 = truncate!(p.cardinality(), u64);
            true && (len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_256() || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_384() || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PUBLIC_KEY_COMPRESSED_LEN_ECC_NIST_521())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(60,3)
        pub fn ValidProviderInfoLength(p: &Sequence<u8>) -> bool {
            let mut len: u64 = truncate!(p.cardinality(), u64);
            len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_256_LEN() as u64 || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_384_LEN() as u64 || len == crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN() as u64
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(719,3)
        pub fn LocalDeriveSharedSecret(senderPrivateKey: &Arc<ECCPrivateKey>, recipientPublicKey: &Arc<ECCPublicKey>, curveSpec: &Arc<ECDHCurveSpec>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybeSharedSecret: Arc<Result<Arc<DeriveSharedSecretOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<DeriveSharedSecretOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::DeriveSharedSecret(rd!(crypto.clone()), &Arc::new(DeriveSharedSecretInput::DeriveSharedSecretInput {
                            eccCurve: curveSpec.clone(),
                            privateKey: senderPrivateKey.clone(),
                            publicKey: recipientPublicKey.clone()
                        }));
            maybeSharedSecret = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<DeriveSharedSecretOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeSharedSecret.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut sharedSecretOutput: Arc<DeriveSharedSecretOutput> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: sharedSecretOutput.sharedSecret().clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(753,3)
        pub fn CompressPublicKey(publicKey: &Arc<ECCPublicKey>, curveSpec: &Arc<ECDHCurveSpec>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybeCompressedPublicKey: Arc<Result<Arc<CompressPublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<CompressPublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::CompressPublicKey(rd!(crypto.clone()), &Arc::new(CompressPublicKeyInput::CompressPublicKeyInput {
                            publicKey: publicKey.clone(),
                            eccCurve: curveSpec.clone()
                        }));
            maybeCompressedPublicKey = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<CompressPublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeCompressedPublicKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut compressedPublicKey: Arc<CompressPublicKeyOutput> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: compressedPublicKey.compressedPublicKey().clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(784,3)
        pub fn DecompressPublicKey(publicKey: &Sequence<u8>, curveSpec: &Arc<ECDHCurveSpec>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybePublicKey: Arc<Result<Arc<DecompressPublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<DecompressPublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::DecompressPublicKey(rd!(crypto.clone()), &Arc::new(DecompressPublicKeyInput::DecompressPublicKeyInput {
                            compressedPublicKey: publicKey.clone(),
                            eccCurve: curveSpec.clone()
                        }));
            maybePublicKey = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<DecompressPublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybePublicKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut publicKey: Arc<DecompressPublicKeyOutput> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: publicKey.publicKey().der().clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(815,3)
        pub fn SerializeProviderInfo(senderPublicKey: &Sequence<u8>, recipientPublicKey: &Sequence<u8>) -> Sequence<u8> {
            _default::RAW_ECDH_KEYRING_VERSION().concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(truncate!(recipientPublicKey.cardinality(), u32))).concat(recipientPublicKey).concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(truncate!(senderPublicKey.cardinality(), u32))).concat(senderPublicKey)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(835,3)
        pub fn GenerateEphemeralEccKeyPair(curveSpec: &Arc<ECDHCurveSpec>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<Arc<GenerateECCKeyPairOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<GenerateECCKeyPairOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybeKeyPair: Arc<Result<Arc<GenerateECCKeyPairOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<GenerateECCKeyPairOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateECCKeyPair(rd!(crypto.clone()), &Arc::new(GenerateECCKeyPairInput::GenerateECCKeyPairInput {
                            eccCurve: curveSpec.clone()
                        }));
            maybeKeyPair = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<GenerateECCKeyPairOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeKeyPair.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GenerateECCKeyPairOutput>>());
                return res.read();
            };
            let mut keyPair: Arc<GenerateECCKeyPairOutput> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Arc<GenerateECCKeyPairOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: keyPair.clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(860,3)
        pub fn ValidatePublicKey(crypto: &Object<AtomicPrimitivesClient>, curveSpec: &Arc<ECDHCurveSpec>, publicKey: &Sequence<u8>) -> Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybeValidate: Arc<Result<Arc<ValidatePublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<ValidatePublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::ValidatePublicKey(rd!(crypto.clone()), &Arc::new(ValidatePublicKeyInput::ValidatePublicKeyInput {
                            eccCurve: curveSpec.clone(),
                            publicKey: publicKey.clone()
                        }));
            maybeValidate = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<ValidatePublicKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeValidate.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<bool>());
                return res.read();
            };
            let mut validate: Arc<ValidatePublicKeyOutput> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: validate.success().clone()
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(888,3)
        pub fn CurveSpecTypeToString(c: &Arc<ECDHCurveSpec>) -> Sequence<DafnyCharUTF16> {
            let mut _source0: Arc<ECDHCurveSpec> = c.clone();
            if matches!((&_source0).as_ref(), ECC_NIST_P256{ .. }) {
                string_utf16_of("p256")
            } else {
                if matches!((&_source0).as_ref(), ECC_NIST_P384{ .. }) {
                    string_utf16_of("p384")
                } else {
                    if matches!((&_source0).as_ref(), ECC_NIST_P521{ .. }) {
                        string_utf16_of("p521")
                    } else {
                        string_utf16_of("sm2")
                    }
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(898,3)
        pub fn E(s: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error> {
            Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                    message: s.clone()
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(40,3)
        pub fn RAW_ECDH_KEYRING_VERSION() -> Sequence<u8> {
            seq![1]
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(73,3)
    pub struct RawEcdhKeyring {
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_keyAgreementScheme: Arc<RawEcdhStaticConfigurations>,
        pub __i_curveSpec: Arc<ECDHCurveSpec>,
        pub __i_recipientPublicKey: Arc<ECCPublicKey>,
        pub __i_compressedRecipientPublicKey: Sequence<u8>,
        pub __i_senderPublicKey: Arc<ECCPublicKey>,
        pub __i_senderPrivateKey: Arc<ECCPrivateKey>,
        pub __i_compressedSenderPublicKey: Sequence<u8>
    }

    impl RawEcdhKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(94,5)
        pub fn _ctor(this: &Object<RawEcdhKeyring>, keyAgreementScheme: &Arc<RawEcdhStaticConfigurations>, curveSpec: &Arc<ECDHCurveSpec>, senderPrivateKey: &Arc<Option<Sequence<u8>>>, senderPublicKey: &Arc<Option<Sequence<u8>>>, recipientPublicKey: &Sequence<u8>, compressedSenderPublicKey: &Arc<Option<Sequence<u8>>>, compressedRecipientPublicKey: &Sequence<u8>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_keyAgreementScheme: bool = false;
            let mut _set___i_curveSpec: bool = false;
            let mut _set___i_recipientPublicKey: bool = false;
            let mut _set___i_compressedRecipientPublicKey: bool = false;
            let mut _set___i_senderPublicKey: bool = false;
            let mut _set___i_senderPrivateKey: bool = false;
            let mut _set___i_compressedSenderPublicKey: bool = false;
            update_field_uninit_object!(this.clone(), __i_keyAgreementScheme, _set___i_keyAgreementScheme, keyAgreementScheme.clone());
            update_field_uninit_object!(this.clone(), __i_curveSpec, _set___i_curveSpec, curveSpec.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            update_field_uninit_object!(this.clone(), __i_recipientPublicKey, _set___i_recipientPublicKey, Arc::new(ECCPublicKey::ECCPublicKey {
                        der: recipientPublicKey.clone()
                    }));
            update_field_uninit_object!(this.clone(), __i_compressedRecipientPublicKey, _set___i_compressedRecipientPublicKey, compressedRecipientPublicKey.clone());
            if matches!(senderPublicKey.as_ref(), Some{ .. }) && matches!(senderPrivateKey.as_ref(), Some{ .. }) && matches!(compressedSenderPublicKey.as_ref(), Some{ .. }) {
                update_field_uninit_object!(this.clone(), __i_senderPublicKey, _set___i_senderPublicKey, Arc::new(ECCPublicKey::ECCPublicKey {
                            der: senderPublicKey.value().clone()
                        }));
                update_field_uninit_object!(this.clone(), __i_senderPrivateKey, _set___i_senderPrivateKey, Arc::new(ECCPrivateKey::ECCPrivateKey {
                            pem: senderPrivateKey.value().clone()
                        }));
                update_field_uninit_object!(this.clone(), __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, compressedSenderPublicKey.value().clone())
            } else {
                update_field_uninit_object!(this.clone(), __i_senderPublicKey, _set___i_senderPublicKey, Arc::new(ECCPublicKey::ECCPublicKey {
                            der: seq![] as Sequence<u8>
                        }));
                update_field_uninit_object!(this.clone(), __i_senderPrivateKey, _set___i_senderPrivateKey, Arc::new(ECCPrivateKey::ECCPrivateKey {
                            pem: seq![] as Sequence<u8>
                        }));
                update_field_uninit_object!(this.clone(), __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, seq![] as Sequence<u8>)
            };
            update_field_if_uninit_object!(this, __i_senderPublicKey, _set___i_senderPublicKey, <Arc<ECCPublicKey> as Default>::default());
            update_field_if_uninit_object!(this, __i_senderPrivateKey, _set___i_senderPrivateKey, <Arc<ECCPrivateKey> as Default>::default());
            update_field_if_uninit_object!(this, __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, <Sequence<u8> as Default>::default());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(83,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(81,5)
        pub fn keyAgreementScheme(&self) -> Arc<RawEcdhStaticConfigurations> {
            self.__i_keyAgreementScheme.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(82,5)
        pub fn curveSpec(&self) -> Arc<ECDHCurveSpec> {
            self.__i_curveSpec.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(78,5)
        pub fn recipientPublicKey(&self) -> Arc<ECCPublicKey> {
            self.__i_recipientPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(80,5)
        pub fn compressedRecipientPublicKey(&self) -> Sequence<u8> {
            self.__i_compressedRecipientPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(77,5)
        pub fn senderPublicKey(&self) -> Arc<ECCPublicKey> {
            self.__i_senderPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(76,5)
        pub fn senderPrivateKey(&self) -> Arc<ECCPrivateKey> {
            self.__i_senderPrivateKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(79,5)
        pub fn compressedSenderPublicKey(&self) -> Sequence<u8> {
            self.__i_compressedSenderPublicKey.clone()
        }
    }

    impl UpcastObject<DynAny>
        for RawEcdhKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for RawEcdhKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for RawEcdhKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for RawEcdhKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(169,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            if matches!((&self.keyAgreementScheme().clone()).as_ref(), PublicKeyDiscovery{ .. }) {
                res = MaybePlacebo::from(Arc::new(Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: string_utf16_of("PublicKeyDiscovery Key Agreement Scheme is forbidden on encrypt.")
                                        })
                            }));
                return res.read();
            };
            let mut operationSenderPrivateKey: Arc<ECCPrivateKey>;
            let mut operationSenderPublicKey: Arc<ECCPublicKey>;
            let mut operationCompressedSenderPublicKey: Sequence<u8>;
            if matches!((&self.keyAgreementScheme().clone()).as_ref(), EphemeralPrivateKeyToStaticPublicKey{ .. }) {
                let mut valueOrError0: Arc<Result<Arc<GenerateECCKeyPairOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out0: Arc<Result<Arc<GenerateECCKeyPairOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::GenerateEphemeralEccKeyPair(&self.curveSpec().clone(), &self.cryptoPrimitives().clone());
                valueOrError0 = _out0.clone();
                if valueOrError0.IsFailure() {
                    res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return res.read();
                };
                let mut ephemeralKeyPair: Arc<GenerateECCKeyPairOutput> = valueOrError0.Extract();
                operationSenderPrivateKey = ephemeralKeyPair.privateKey().clone();
                operationSenderPublicKey = ephemeralKeyPair.publicKey().clone();
                let mut valueOrError1: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                let mut _out1: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::CompressPublicKey(&Arc::new(ECCPublicKey::ECCPublicKey {
                                der: operationSenderPublicKey.der().clone()
                            }), &self.curveSpec().clone(), &self.cryptoPrimitives().clone());
                valueOrError1 = _out1.clone();
                if valueOrError1.IsFailure() {
                    res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return res.read();
                };
                let mut _operationCompressedSenderPublicKey_q: Sequence<u8> = valueOrError1.Extract();
                operationCompressedSenderPublicKey = _operationCompressedSenderPublicKey_q.clone();
            } else {
                operationSenderPrivateKey = self.senderPrivateKey().clone();
                operationSenderPublicKey = self.senderPublicKey().clone();
                operationCompressedSenderPublicKey = self.compressedSenderPublicKey().clone();
            };
            let mut materials: Arc<EncryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError2: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::LocalDeriveSharedSecret(&operationSenderPrivateKey, &self.recipientPublicKey().clone(), &self.curveSpec().clone(), &self.cryptoPrimitives().clone());
            valueOrError2 = _out2.clone();
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut sharedSecret: Sequence<u8> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Result<ValidUTF8Bytes, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&_default::CurveSpecTypeToString(&self.curveSpec().clone())).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| _default::E(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut curveSpecUtf8: ValidUTF8Bytes = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_CanonicalEncryptionContext_Compile::_default::EncryptionContextToAAD(input.materials().encryptionContext());
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut canonicalizedEC: Sequence<u8> = valueOrError4.Extract();
            let mut fixedInfo: Sequence<u8> = crate::implementation_from_dafny::_EcdhEdkWrapping_Compile::_default::SerializeFixedInfo(&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_KDF_UTF8(), &curveSpecUtf8, &operationCompressedSenderPublicKey, &self.compressedRecipientPublicKey().clone(), &canonicalizedEC, &_default::RAW_ECDH_KEYRING_VERSION());
            let mut ecdhGenerateAndWrap: Object<EcdhGenerateAndWrapKeyMaterial>;
            let mut _nw0: Object<EcdhGenerateAndWrapKeyMaterial> = EcdhGenerateAndWrapKeyMaterial::_allocate_object();
            EcdhGenerateAndWrapKeyMaterial::_ctor(&_nw0, &sharedSecret, &fixedInfo, &self.cryptoPrimitives().clone());
            ecdhGenerateAndWrap = _nw0.clone();
            let mut ecdhWrap: Object<EcdhWrapKeyMaterial>;
            let mut _nw1: Object<EcdhWrapKeyMaterial> = EcdhWrapKeyMaterial::_allocate_object();
            EcdhWrapKeyMaterial::_ctor(&_nw1, &sharedSecret, &fixedInfo, &self.cryptoPrimitives().clone());
            ecdhWrap = _nw1.clone();
            let mut valueOrError5: Arc<Result<Arc<WrapEdkMaterialOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<Arc<WrapEdkMaterialOutput<Arc<EcdhWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::WrapEdkMaterial::<Arc<EcdhWrapInfo>>(&materials, &upcast_object::<EcdhWrapKeyMaterial, dyn WrapMaterial<Arc<EcdhWrapInfo>>>()(ecdhWrap.clone()), &upcast_object::<EcdhGenerateAndWrapKeyMaterial, dyn GenerateAndWrapMaterial<Arc<EcdhWrapInfo>>>()(ecdhGenerateAndWrap.clone()));
            valueOrError5 = _out3.clone();
            if valueOrError5.IsFailure() {
                res = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut wrapOutput: Arc<WrapEdkMaterialOutput<Arc<EcdhWrapInfo>>> = valueOrError5.Extract();
            let mut symmetricSigningKeyList: Arc<Option<Sequence<Sequence<u8>>>>;
            if matches!(wrapOutput.symmetricSigningKey().as_ref(), Some{ .. }) {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                            value: seq![wrapOutput.symmetricSigningKey().value().clone()]
                        });
            } else {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::None {});
            };
            let mut valueOrError6: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(_default::ValidCompressedPublicKeyLength(&operationCompressedSenderPublicKey) && _default::ValidCompressedPublicKeyLength(&self.compressedRecipientPublicKey().clone()), &_default::E(&string_utf16_of("Invalid compressed public key length.")));
            if valueOrError6.IsFailure() {
                res = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<OnEncryptOutput>>());
                return res.read();
            };
            let mut edk: Arc<EncryptedDataKey> = Arc::new(EncryptedDataKey::EncryptedDataKey {
                        keyProviderId: crate::implementation_from_dafny::_Constants_Compile::_default::RAW_ECDH_PROVIDER_ID(),
                        keyProviderInfo: _default::SerializeProviderInfo(&operationCompressedSenderPublicKey, &self.compressedRecipientPublicKey().clone()),
                        ciphertext: wrapOutput.wrappedMaterial().clone()
                    });
            if matches!((&wrapOutput).as_ref(), GenerateAndWrapEdkMaterialOutput{ .. }) {
                let mut valueOrError7: Arc<Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddDataKey(&materials, wrapOutput.plaintextDataKey(), &seq![edk.clone()], &symmetricSigningKeyList);
                if valueOrError7.IsFailure() {
                    res = MaybePlacebo::from(valueOrError7.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return res.read();
                };
                let mut result: Arc<EncryptionMaterials> = valueOrError7.Extract();
                res = MaybePlacebo::from(Arc::new(Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                            materials: result.clone()
                                        })
                            }));
                return res.read();
            } else {
                if matches!((&wrapOutput).as_ref(), WrapOnlyEdkMaterialOutput{ .. }) {
                    let mut valueOrError8: Arc<Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddEncryptedDataKeys(&materials, &seq![edk.clone()], &symmetricSigningKeyList);
                    if valueOrError8.IsFailure() {
                        res = MaybePlacebo::from(valueOrError8.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return res.read();
                    };
                    let mut result: Arc<EncryptionMaterials> = valueOrError8.Extract();
                    res = MaybePlacebo::from(Arc::new(Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                    value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                                materials: result.clone()
                                            })
                                }));
                    return res.read();
                }
            };
            return res.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(332,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            if matches!((&self.keyAgreementScheme().clone()).as_ref(), EphemeralPrivateKeyToStaticPublicKey{ .. }) {
                res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                            message: string_utf16_of("EphemeralPrivateKeyToStaticPublicKey Key Agreement Scheme is forbidden on decrypt.")
                                        })
                            }));
                return res.read();
            };
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.materials().algorithmSuite().clone();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(&materials), &_default::E(&string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut operationCompressedSenderPublicKey: Arc<Option<Sequence<u8>>>;
            if self.compressedSenderPublicKey().clone().to_array().len() == 0 {
                operationCompressedSenderPublicKey = Arc::new(Option::<Sequence<u8>>::None {});
            } else {
                operationCompressedSenderPublicKey = Arc::new(Option::<Sequence<u8>>::Some {
                            value: self.compressedSenderPublicKey().clone()
                        });
            };
            let mut filter: Object<OnDecryptEcdhDataKeyFilter>;
            let mut _nw0: Object<OnDecryptEcdhDataKeyFilter> = OnDecryptEcdhDataKeyFilter::_allocate_object();
            OnDecryptEcdhDataKeyFilter::_ctor(&_nw0, &self.keyAgreementScheme().clone(), &self.compressedRecipientPublicKey().clone(), &operationCompressedSenderPublicKey);
            filter = _nw0.clone();
            let mut valueOrError1: Arc<Result<Sequence<Arc<EncryptedDataKey>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Sequence<Arc<EncryptedDataKey>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Actions_Compile::_default::FilterWithResult::<Arc<EncryptedDataKey>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&upcast_object::<OnDecryptEcdhDataKeyFilter, dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>()(filter.clone()), input.encryptedDataKeys());
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut edksToAttempt: Sequence<Arc<EncryptedDataKey>> = valueOrError1.Extract();
            if 0 == truncate!(edksToAttempt.cardinality(), u64) {
                let mut valueOrError2: Arc<Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectDataKeys(input.encryptedDataKeys(), input.materials().algorithmSuite(), &string_utf16_of(""));
                if valueOrError2.IsFailure() {
                    res = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnDecryptOutput>>());
                    return res.read();
                };
                let mut errorMessage: Sequence<DafnyCharUTF16> = valueOrError2.Extract();
                res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                error: _default::E(&errorMessage)
                            }));
                return res.read();
            };
            let mut decryptClosure: Object<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _nw1: Object<DecryptSingleEncryptedDataKey> = DecryptSingleEncryptedDataKey::_allocate_object();
            DecryptSingleEncryptedDataKey::_ctor(&_nw1, &materials, &self.cryptoPrimitives().clone(), &self.compressedSenderPublicKey().clone(), &self.compressedRecipientPublicKey().clone(), &self.keyAgreementScheme().clone(), &self.curveSpec().clone());
            decryptClosure = upcast_object::<DecryptSingleEncryptedDataKey, dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>()(_nw1.clone());
            let mut outcome: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>;
            let mut _out1: Arc<Result<SealedDecryptionMaterials, Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>> = crate::implementation_from_dafny::_Actions_Compile::_default::ReduceToSuccess::<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&decryptClosure, &edksToAttempt);
            outcome = _out1.clone();
            let mut valueOrError3: Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = outcome.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |errors: &Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::CollectionOfErrors {
                                        list: errors.clone(),
                                        message: string_utf16_of("No Configured Key was able to decrypt the Data Key. The list of encountered Exceptions is available via `list`.")
                                    })
                            })
                    }));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnDecryptOutput>>());
                return res.read();
            };
            let mut SealedDecryptionMaterials: SealedDecryptionMaterials = valueOrError3.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: Arc::new(OnDecryptOutput::OnDecryptOutput {
                                        materials: SealedDecryptionMaterials.clone()
                                    })
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for RawEcdhKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(424,3)
    pub struct OnDecryptEcdhDataKeyFilter {
        pub __i_keyAgreementScheme: Arc<RawEcdhStaticConfigurations>,
        pub __i_compressedRecipientPublicKey: Sequence<u8>,
        pub __i_compressedSenderPublicKey: Sequence<u8>
    }

    impl OnDecryptEcdhDataKeyFilter {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(431,5)
        pub fn _ctor(this: &Object<OnDecryptEcdhDataKeyFilter>, keyAgreementScheme: &Arc<RawEcdhStaticConfigurations>, compressedRecipientPublicKey: &Sequence<u8>, compressedSenderPublicKey: &Arc<Option<Sequence<u8>>>) -> () {
            let mut _set___i_keyAgreementScheme: bool = false;
            let mut _set___i_compressedRecipientPublicKey: bool = false;
            let mut _set___i_compressedSenderPublicKey: bool = false;
            update_field_uninit_object!(this.clone(), __i_keyAgreementScheme, _set___i_keyAgreementScheme, keyAgreementScheme.clone());
            update_field_uninit_object!(this.clone(), __i_compressedRecipientPublicKey, _set___i_compressedRecipientPublicKey, compressedRecipientPublicKey.clone());
            if matches!(compressedSenderPublicKey.as_ref(), Some{ .. }) {
                update_field_uninit_object!(this.clone(), __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, compressedSenderPublicKey.value().clone())
            } else {
                update_field_uninit_object!(this.clone(), __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, seq![] as Sequence<u8>)
            };
            update_field_if_uninit_object!(this, __i_compressedSenderPublicKey, _set___i_compressedSenderPublicKey, <Sequence<u8> as Default>::default());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(427,5)
        pub fn keyAgreementScheme(&self) -> Arc<RawEcdhStaticConfigurations> {
            self.__i_keyAgreementScheme.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(428,5)
        pub fn compressedRecipientPublicKey(&self) -> Sequence<u8> {
            self.__i_compressedRecipientPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(429,5)
        pub fn compressedSenderPublicKey(&self) -> Sequence<u8> {
            self.__i_compressedSenderPublicKey.clone()
        }
    }

    impl UpcastObject<DynAny>
        for OnDecryptEcdhDataKeyFilter {
        UpcastObjectFn!(DynAny);
    }

    impl DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for OnDecryptEcdhDataKeyFilter {}

    impl UpcastObject<dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for OnDecryptEcdhDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicActionWithResult<Arc<EncryptedDataKey>, bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for OnDecryptEcdhDataKeyFilter {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(460,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut providerInfo: Sequence<u8> = edk.keyProviderInfo().clone();
            let mut providerId: ValidUTF8Bytes = edk.keyProviderId().clone();
            if providerId.clone() != crate::implementation_from_dafny::_Constants_Compile::_default::RAW_ECDH_PROVIDER_ID() && providerId.clone() != crate::implementation_from_dafny::_Constants_Compile::_default::KMS_ECDH_PROVIDER_ID() {
                res = MaybePlacebo::from(Arc::new(Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: false
                            }));
                return res.read();
            };
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(providerInfo.cardinality(), u64) <= crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN() as u64 && _default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected")));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<bool>());
                return res.read();
            };
            let mut keyringVersion: u8 = providerInfo.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()));
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(seq![keyringVersion] == _default::RAW_ECDH_KEYRING_VERSION(), &_default::E(&string_utf16_of("Incorrect Keyring version found in provider info.")));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<bool>());
                return res.read();
            };
            let mut recipientPublicKeyLength: u32 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone())));
            let mut recipientPublicKeyLengthIndex: u64 = crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX() as u64 + recipientPublicKeyLength as u64;
            let mut senderPublicKeyIndex: u64 = recipientPublicKeyLengthIndex + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN();
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(recipientPublicKeyLengthIndex + 4 < truncate!(providerInfo.cardinality(), u64), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected.")));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<bool>());
                return res.read();
            };
            let mut providerInfoRecipientPublicKey: Sequence<u8> = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &int!((&recipientPublicKeyLengthIndex).clone()));
            let mut providerInfoSenderPublicKey: Sequence<u8> = providerInfo.drop(&int!((&senderPublicKeyIndex).clone()));
            if matches!((&self.keyAgreementScheme().clone()).as_ref(), PublicKeyDiscovery{ .. }) {
                res = MaybePlacebo::from(Arc::new(Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: self.compressedRecipientPublicKey().clone() == providerInfoRecipientPublicKey.clone()
                            }));
                return res.read();
            } else {
                res = MaybePlacebo::from(Arc::new(Result::<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: self.compressedSenderPublicKey().clone() == providerInfoSenderPublicKey.clone() && self.compressedRecipientPublicKey().clone() == providerInfoRecipientPublicKey.clone() || self.compressedSenderPublicKey().clone() == providerInfoRecipientPublicKey.clone() && self.compressedRecipientPublicKey().clone() == providerInfoSenderPublicKey.clone()
                            }));
                return res.read();
            };
            return res.read();
        }
    }

    impl UpcastObject<dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for OnDecryptEcdhDataKeyFilter {
        UpcastObjectFn!(dyn DeterministicAction<Arc<EncryptedDataKey>, Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(520,3)
    pub struct DecryptSingleEncryptedDataKey {
        pub __i_materials: DecryptionMaterialsPendingPlaintextDataKey,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_recipientPublicKey: Sequence<u8>,
        pub __i_senderPublicKey: Sequence<u8>,
        pub __i_keyAgreementScheme: Arc<RawEcdhStaticConfigurations>,
        pub __i_curveSpec: Arc<ECDHCurveSpec>
    }

    impl DecryptSingleEncryptedDataKey {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(533,5)
        pub fn _ctor(this: &Object<DecryptSingleEncryptedDataKey>, materials: &DecryptionMaterialsPendingPlaintextDataKey, cryptoPrimitives: &Object<AtomicPrimitivesClient>, senderPublicKey: &Sequence<u8>, recipientPublicKey: &Sequence<u8>, keyAgreementScheme: &Arc<RawEcdhStaticConfigurations>, curveSpec: &Arc<ECDHCurveSpec>) -> () {
            let mut _set___i_materials: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_recipientPublicKey: bool = false;
            let mut _set___i_senderPublicKey: bool = false;
            let mut _set___i_keyAgreementScheme: bool = false;
            let mut _set___i_curveSpec: bool = false;
            update_field_uninit_object!(this.clone(), __i_materials, _set___i_materials, materials.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            update_field_uninit_object!(this.clone(), __i_recipientPublicKey, _set___i_recipientPublicKey, recipientPublicKey.clone());
            update_field_uninit_object!(this.clone(), __i_senderPublicKey, _set___i_senderPublicKey, senderPublicKey.clone());
            update_field_uninit_object!(this.clone(), __i_keyAgreementScheme, _set___i_keyAgreementScheme, keyAgreementScheme.clone());
            update_field_uninit_object!(this.clone(), __i_curveSpec, _set___i_curveSpec, curveSpec.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(526,5)
        pub fn materials(&self) -> DecryptionMaterialsPendingPlaintextDataKey {
            self.__i_materials.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(527,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(529,5)
        pub fn recipientPublicKey(&self) -> Sequence<u8> {
            self.__i_recipientPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(528,5)
        pub fn senderPublicKey(&self) -> Sequence<u8> {
            self.__i_senderPublicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(530,5)
        pub fn keyAgreementScheme(&self) -> Arc<RawEcdhStaticConfigurations> {
            self.__i_keyAgreementScheme.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(531,5)
        pub fn curveSpec(&self) -> Arc<ECDHCurveSpec> {
            self.__i_curveSpec.clone()
        }
    }

    impl UpcastObject<DynAny>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(DynAny);
    }

    impl ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for DecryptSingleEncryptedDataKey {}

    impl UpcastObject<dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(dyn ActionWithResult<Arc<EncryptedDataKey>, SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<EncryptedDataKey>, Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for DecryptSingleEncryptedDataKey {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawECDHKeyring.dfy(590,5)
        fn Invoke(&self, edk: &Arc<EncryptedDataKey>) -> Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = self.materials().clone().algorithmSuite().clone();
            let mut keyProviderId: ValidUTF8Bytes = edk.keyProviderId().clone();
            let mut providerInfo: Sequence<u8> = edk.keyProviderInfo().clone();
            let mut ciphertext: Sequence<u8> = edk.ciphertext().clone();
            let mut valueOrError0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::GetProviderWrappedMaterial(&ciphertext, &suite);
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut providerWrappedMaterial: Sequence<u8> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(providerInfo.cardinality(), u64) <= crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_521_LEN() as u64 && _default::ValidProviderInfoLength(&providerInfo), &_default::E(&string_utf16_of("EDK ProviderInfo longer than expected")));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut keyringVersion: u8 = providerInfo.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()));
            let mut valueOrError2: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(seq![keyringVersion] == _default::RAW_ECDH_KEYRING_VERSION(), &_default::E(&string_utf16_of("Incorrect Keyring version found in provider info.")));
            if valueOrError2.IsFailure() {
                res = MaybePlacebo::from(valueOrError2.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut recipientPublicKeyLength: u32 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPL_INDEX()).clone()), &int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone())));
            let mut recipientPublicKeyLengthIndex: u64 = crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX() as u64 + recipientPublicKeyLength as u64;
            let mut senderPublicKeyIndex: u64 = recipientPublicKeyLengthIndex + crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_PUBLIC_KEY_LEN();
            let mut valueOrError3: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(recipientPublicKeyLengthIndex + 4 < truncate!(providerInfo.cardinality(), u64), &_default::E(&string_utf16_of("Key Provider Info Serialization Error. Serialized length less than expected.")));
            if valueOrError3.IsFailure() {
                res = MaybePlacebo::from(valueOrError3.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut providerInfoRecipientPublicKey: Sequence<u8> = providerInfo.slice(&int!((&crate::implementation_from_dafny::_Constants_Compile::_default::ECDH_PROVIDER_INFO_RPK_INDEX()).clone()), &int!((&recipientPublicKeyLengthIndex).clone()));
            let mut providerInfoSenderPublicKey: Sequence<u8> = providerInfo.drop(&int!((&senderPublicKeyIndex).clone()));
            let mut valueOrError4: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DecompressPublicKey(&providerInfoSenderPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone());
            valueOrError4 = _out0.clone();
            if valueOrError4.IsFailure() {
                res = MaybePlacebo::from(valueOrError4.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut senderPublicKey: Sequence<u8> = valueOrError4.Extract();
            let mut valueOrError5: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::DecompressPublicKey(&providerInfoRecipientPublicKey, &self.curveSpec().clone(), &self.cryptoPrimitives().clone());
            valueOrError5 = _out1.clone();
            if valueOrError5.IsFailure() {
                res = MaybePlacebo::from(valueOrError5.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut recipientPublicKey: Sequence<u8> = valueOrError5.Extract();
            let mut valueOrError6: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &senderPublicKey);
            valueOrError6 = _out2.clone();
            if valueOrError6.IsFailure() {
                res = MaybePlacebo::from(valueOrError6.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut _v0: bool = valueOrError6.Extract();
            let mut valueOrError7: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &recipientPublicKey);
            valueOrError7 = _out3.clone();
            if valueOrError7.IsFailure() {
                res = MaybePlacebo::from(valueOrError7.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut _v1: bool = valueOrError7.Extract();
            let mut sharedSecretPublicKey = MaybePlacebo::<Sequence<u8>>::new();
            let mut sharedSecretPrivateKey = MaybePlacebo::<Sequence<u8>>::new();
            let mut _source0: Arc<RawEcdhStaticConfigurations> = self.keyAgreementScheme().clone();
            if matches!((&_source0).as_ref(), PublicKeyDiscovery{ .. }) {
                let mut ___mcc_h0: Arc<PublicKeyDiscoveryInput> = _source0.PublicKeyDiscovery().clone();
                let mut publicKeyDiscovery: Arc<PublicKeyDiscoveryInput> = ___mcc_h0.clone();
                sharedSecretPublicKey = MaybePlacebo::from(senderPublicKey.clone());
                sharedSecretPrivateKey = MaybePlacebo::from(publicKeyDiscovery.recipientStaticPrivateKey().clone());
            } else {
                if matches!((&_source0).as_ref(), RawPrivateKeyToStaticPublicKey{ .. }) {
                    let mut ___mcc_h1: Arc<RawPrivateKeyToStaticPublicKeyInput> = _source0.RawPrivateKeyToStaticPublicKey().clone();
                    let mut rawPrivateKeyToStaticPublicKey: Arc<RawPrivateKeyToStaticPublicKeyInput> = ___mcc_h1.clone();
                    sharedSecretPrivateKey = MaybePlacebo::from(rawPrivateKeyToStaticPublicKey.senderStaticPrivateKey().clone());
                    if rawPrivateKeyToStaticPublicKey.recipientPublicKey().clone() == recipientPublicKey.clone() {
                        sharedSecretPublicKey = MaybePlacebo::from(recipientPublicKey.clone());
                    } else {
                        sharedSecretPublicKey = MaybePlacebo::from(senderPublicKey.clone());
                    }
                } else {
                    let mut ___mcc_h2: Arc<EphemeralPrivateKeyToStaticPublicKeyInput> = _source0.EphemeralPrivateKeyToStaticPublicKey().clone();
                    res = MaybePlacebo::from(Arc::new(Result::<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                                    error: _default::E(&string_utf16_of("EphemeralPrivateKeyToStaticPublicKey Not allowed on decrypt"))
                                }));
                    return res.read();
                }
            };
            let mut valueOrError8: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<bool, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::ValidatePublicKey(&self.cryptoPrimitives().clone(), &self.curveSpec().clone(), &sharedSecretPublicKey.read());
            valueOrError8 = _out4.clone();
            if valueOrError8.IsFailure() {
                res = MaybePlacebo::from(valueOrError8.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut _v3: bool = valueOrError8.Extract();
            let mut valueOrError9: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out5: Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = _default::LocalDeriveSharedSecret(&Arc::new(ECCPrivateKey::ECCPrivateKey {
                            pem: sharedSecretPrivateKey.read()
                        }), &Arc::new(ECCPublicKey::ECCPublicKey {
                            der: sharedSecretPublicKey.read()
                        }), &self.curveSpec().clone(), &self.cryptoPrimitives().clone());
            valueOrError9 = _out5.clone();
            if valueOrError9.IsFailure() {
                res = MaybePlacebo::from(valueOrError9.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut sharedSecret: Sequence<u8> = valueOrError9.Extract();
            let mut ecdhUnwrap: Object<EcdhUnwrap>;
            let mut _nw0: Object<EcdhUnwrap> = EcdhUnwrap::_allocate_object();
            EcdhUnwrap::_ctor(&_nw0, &providerInfoSenderPublicKey, &providerInfoRecipientPublicKey, &sharedSecret, &_default::RAW_ECDH_KEYRING_VERSION(), &self.curveSpec().clone(), &self.cryptoPrimitives().clone());
            ecdhUnwrap = _nw0.clone();
            let mut unwrapOutputRes: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::<Arc<EcdhUnwrapInfo>>(edk.ciphertext(), &self.materials().clone(), &upcast_object::<EcdhUnwrap, dyn UnwrapMaterial<Arc<EcdhUnwrapInfo>>>()(ecdhUnwrap.clone()));
            unwrapOutputRes = _out6.clone();
            let mut valueOrError10: Arc<Result<Arc<UnwrapEdkMaterialOutput<Arc<EcdhUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = unwrapOutputRes.clone();
            if valueOrError10.IsFailure() {
                res = MaybePlacebo::from(valueOrError10.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut unwrapOutput: Arc<UnwrapEdkMaterialOutput<Arc<EcdhUnwrapInfo>>> = valueOrError10.Extract();
            let mut valueOrError11: Arc<Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&self.materials().clone(), unwrapOutput.plaintextDataKey(), unwrapOutput.symmetricSigningKey());
            if valueOrError11.IsFailure() {
                res = MaybePlacebo::from(valueOrError11.PropagateFailure::<SealedDecryptionMaterials>());
                return res.read();
            };
            let mut result: Arc<DecryptionMaterials> = valueOrError11.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: result.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<EncryptedDataKey>, Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for DecryptSingleEncryptedDataKey {
        UpcastObjectFn!(dyn Action<Arc<EncryptedDataKey>, Arc<Result<SealedDecryptionMaterials, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(13,1)
pub mod _RawRSAKeyring_Compile {
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAPaddingMode;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_Keyring_Compile::VerifiableInterface;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnEncryptOutput;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptionMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapMaterial;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapMaterial;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::GenerateAndWrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::WrapEdkMaterialOutput::WrapOnlyEdkMaterialOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::OnDecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptionMaterials;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::_EdkWrapping_Compile::UnwrapEdkMaterialOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapMaterial;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::dafny_runtime::SequenceIter;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use crate::implementation_from_dafny::_Actions_Compile::ActionWithResult;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::GenerateAndWrapOutput;
    pub use crate::implementation_from_dafny::_Actions_Compile::Action;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRandomBytesInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapOutput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::WrapInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSAEncryptInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapInput;
    pub use crate::implementation_from_dafny::_MaterialWrapping_Compile::UnwrapOutput;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::RSADecryptInput;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(41,3)
    pub struct RawRSAKeyring {
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_privateKeyMaterial: Arc<Option<Object<RsaUnwrapKeyMaterial>>>,
        pub __i_publicKeyMaterial: Arc<Option<Object<RsaWrapKeyMaterial>>>,
        pub __i_publicKey: Arc<Option<Sequence<u8>>>,
        pub __i_privateKey: Arc<Option<Sequence<u8>>>,
        pub __i_keyNamespace: ValidUTF8Bytes,
        pub __i_keyName: ValidUTF8Bytes,
        pub __i_paddingScheme: Arc<RSAPaddingMode>
    }

    impl RawRSAKeyring {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(76,5)
        pub fn _ctor(this: &Object<RawRSAKeyring>, namespace: &ValidUTF8Bytes, name: &ValidUTF8Bytes, publicKey: &Arc<Option<Sequence<u8>>>, privateKey: &Arc<Option<Sequence<u8>>>, paddingScheme: &Arc<RSAPaddingMode>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_privateKeyMaterial: bool = false;
            let mut _set___i_publicKeyMaterial: bool = false;
            let mut _set___i_publicKey: bool = false;
            let mut _set___i_privateKey: bool = false;
            let mut _set___i_keyNamespace: bool = false;
            let mut _set___i_keyName: bool = false;
            let mut _set___i_paddingScheme: bool = false;
            update_field_uninit_object!(this.clone(), __i_keyNamespace, _set___i_keyNamespace, namespace.clone());
            update_field_uninit_object!(this.clone(), __i_keyName, _set___i_keyName, name.clone());
            update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone());
            update_field_uninit_object!(this.clone(), __i_publicKey, _set___i_publicKey, publicKey.clone());
            update_field_uninit_object!(this.clone(), __i_privateKey, _set___i_privateKey, privateKey.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            let mut localPrivateKeyMaterial: Arc<Option<Object<RsaUnwrapKeyMaterial>>> = Arc::new(Option::<Object<RsaUnwrapKeyMaterial>>::None {});
            if matches!(privateKey.as_ref(), Some{ .. }) {
                let mut extract: Sequence<u8> = privateKey.Extract();
                if 0 < truncate!(extract.cardinality(), u64) {
                    let mut unwrap: Object<RsaUnwrapKeyMaterial>;
                    let mut _nw0: Object<RsaUnwrapKeyMaterial> = RsaUnwrapKeyMaterial::_allocate_object();
                    RsaUnwrapKeyMaterial::_ctor(&_nw0, &extract, paddingScheme, cryptoPrimitives);
                    unwrap = _nw0.clone();
                    localPrivateKeyMaterial = Arc::new(Option::<Object<RsaUnwrapKeyMaterial>>::Some {
                                value: unwrap.clone()
                            });
                }
            };
            let mut localPublicKeyMaterial: Arc<Option<Object<RsaWrapKeyMaterial>>> = Arc::new(Option::<Object<RsaWrapKeyMaterial>>::None {});
            if matches!(publicKey.as_ref(), Some{ .. }) {
                let mut extract: Sequence<u8> = publicKey.Extract();
                if 0 < truncate!(extract.cardinality(), u64) {
                    let mut wrap: Object<RsaWrapKeyMaterial>;
                    let mut _nw1: Object<RsaWrapKeyMaterial> = RsaWrapKeyMaterial::_allocate_object();
                    RsaWrapKeyMaterial::_ctor(&_nw1, &extract, paddingScheme, cryptoPrimitives);
                    wrap = _nw1.clone();
                    localPublicKeyMaterial = Arc::new(Option::<Object<RsaWrapKeyMaterial>>::Some {
                                value: wrap.clone()
                            });
                }
            };
            update_field_uninit_object!(this.clone(), __i_publicKeyMaterial, _set___i_publicKeyMaterial, localPublicKeyMaterial.clone());
            update_field_uninit_object!(this.clone(), __i_privateKeyMaterial, _set___i_privateKeyMaterial, localPrivateKeyMaterial.clone());
            return ();
        }
        /// = aws-encryption-sdk-specification/framework/raw-rsa-keyring.md#ondecrypt
        /// = type=implication
        /// # For each encrypted data key, the keyring MUST attempt to decrypt the
        /// # encrypted data key into plaintext using RSA if and only if the
        /// # following is true:
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(437,5)
        pub fn ShouldDecryptEDK(&self, edk: &Arc<EncryptedDataKey>) -> bool {
            crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderInfo()) && edk.keyProviderInfo().clone() == self.keyName().clone() && edk.keyProviderId().clone() == self.keyNamespace().clone() && 0 < truncate!(edk.ciphertext().cardinality(), u64)
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(60,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(65,5)
        pub fn privateKeyMaterial(&self) -> Arc<Option<Object<RsaUnwrapKeyMaterial>>> {
            self.__i_privateKeyMaterial.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(66,5)
        pub fn publicKeyMaterial(&self) -> Arc<Option<Object<RsaWrapKeyMaterial>>> {
            self.__i_publicKeyMaterial.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(63,5)
        pub fn publicKey(&self) -> Arc<Option<Sequence<u8>>> {
            self.__i_publicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(64,5)
        pub fn privateKey(&self) -> Arc<Option<Sequence<u8>>> {
            self.__i_privateKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(61,5)
        pub fn keyNamespace(&self) -> ValidUTF8Bytes {
            self.__i_keyNamespace.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(62,5)
        pub fn keyName(&self) -> ValidUTF8Bytes {
            self.__i_keyName.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(67,5)
        pub fn paddingScheme(&self) -> Arc<RSAPaddingMode> {
            self.__i_paddingScheme.clone()
        }
    }

    impl UpcastObject<DynAny>
        for RawRSAKeyring {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for RawRSAKeyring {}

    impl UpcastObject<dyn VerifiableInterface>
        for RawRSAKeyring {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl IKeyring
        for RawRSAKeyring {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(192,5)
        fn _OnEncrypt_k(&self, input: &Arc<OnEncryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!((&self.publicKeyMaterial().clone()).as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("A RawRSAKeyring without a public key cannot provide OnEncrypt")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnEncryptOutput>>());
                return output.read();
            };
            let mut materials: Arc<EncryptionMaterials> = input.materials().clone();
            let mut suite: Arc<AlgorithmSuiteInfo> = materials.algorithmSuite().clone();
            let mut generateAndWrap: Object<RsaGenerateAndWrapKeyMaterial>;
            let mut _nw0: Object<RsaGenerateAndWrapKeyMaterial> = RsaGenerateAndWrapKeyMaterial::_allocate_object();
            RsaGenerateAndWrapKeyMaterial::_ctor(&_nw0, self.publicKey().clone().value(), &self.paddingScheme().clone(), &self.cryptoPrimitives().clone());
            generateAndWrap = _nw0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapEdkMaterialOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::WrapEdkMaterial::<Arc<RsaWrapInfo>>(&materials, &upcast_object::<RsaWrapKeyMaterial, dyn WrapMaterial<Arc<RsaWrapInfo>>>()(self.publicKeyMaterial().clone().value().clone()), &upcast_object::<RsaGenerateAndWrapKeyMaterial, dyn GenerateAndWrapMaterial<Arc<RsaWrapInfo>>>()(generateAndWrap.clone()));
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnEncryptOutput>>());
                return output.read();
            };
            let mut wrapOutput: Arc<WrapEdkMaterialOutput<Arc<RsaWrapInfo>>> = valueOrError1.Extract();
            let mut symmetricSigningKeyList: Arc<Option<Sequence<Sequence<u8>>>>;
            if matches!(wrapOutput.symmetricSigningKey().as_ref(), Some{ .. }) {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::Some {
                            value: seq![wrapOutput.symmetricSigningKey().value().clone()]
                        });
            } else {
                symmetricSigningKeyList = Arc::new(Option::<Sequence<Sequence<u8>>>::None {});
            };
            let mut edk: Arc<EncryptedDataKey> = Arc::new(EncryptedDataKey::EncryptedDataKey {
                        keyProviderId: self.keyNamespace().clone(),
                        keyProviderInfo: self.keyName().clone(),
                        ciphertext: wrapOutput.wrappedMaterial().clone()
                    });
            if matches!((&wrapOutput).as_ref(), GenerateAndWrapEdkMaterialOutput{ .. }) {
                let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddDataKey(&materials, wrapOutput.plaintextDataKey(), &seq![edk.clone()], &symmetricSigningKeyList);
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnEncryptOutput>>());
                    return output.read();
                };
                let mut result: Arc<EncryptionMaterials> = valueOrError2.Extract();
                output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                            materials: result.clone()
                                        })
                            }));
                return output.read();
            } else {
                if matches!((&wrapOutput).as_ref(), WrapOnlyEdkMaterialOutput{ .. }) {
                    let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<EncryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialAddEncryptedDataKeys(&materials, &seq![edk.clone()], &symmetricSigningKeyList);
                    if valueOrError3.IsFailure() {
                        output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnEncryptOutput>>());
                        return output.read();
                    };
                    let mut result: Arc<EncryptionMaterials> = valueOrError3.Extract();
                    output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnEncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                    value: Arc::new(OnEncryptOutput::OnEncryptOutput {
                                                materials: result.clone()
                                            })
                                }));
                    return output.read();
                }
            };
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(339,5)
        fn _OnDecrypt_k(&self, input: &Arc<OnDecryptInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut output = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(matches!((&self.privateKeyMaterial().clone()).as_ref(), Some{ .. }), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("A RawRSAKeyring without a private key cannot provide OnEncrypt")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut materials: Arc<DecryptionMaterials> = input.materials().clone();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithoutPlaintextDataKey(&materials), &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Keyring received decryption materials that already contain a plaintext data key.")
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<OnDecryptOutput>>());
                return output.read();
            };
            let mut errors: Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>> = seq![] as Sequence<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>;
            let mut _hi0: u64 = truncate!(input.encryptedDataKeys().cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                if self.ShouldDecryptEDK(&input.encryptedDataKeys().get(&int!((&i).clone()))) {
                    let mut edk: Arc<EncryptedDataKey> = input.encryptedDataKeys().get(&int!((&i).clone()));
                    let mut unwrapOutput: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
                    let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapEdkMaterialOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_EdkWrapping_Compile::_default::UnwrapEdkMaterial::<Arc<RsaUnwrapInfo>>(edk.ciphertext(), &materials, &upcast_object::<RsaUnwrapKeyMaterial, dyn UnwrapMaterial<Arc<RsaUnwrapInfo>>>()(self.privateKeyMaterial().clone().value().clone()));
                    unwrapOutput = _out0.clone();
                    if matches!((&unwrapOutput).as_ref(), Success{ .. }) {
                        let mut valueOrError2: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<DecryptionMaterials>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsAddDataKey(&materials, unwrapOutput.value().plaintextDataKey(), unwrapOutput.value().symmetricSigningKey());
                        if valueOrError2.IsFailure() {
                            output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<OnDecryptOutput>>());
                            return output.read();
                        };
                        let mut returnMaterials: Arc<DecryptionMaterials> = valueOrError2.Extract();
                        output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                                        value: Arc::new(OnDecryptOutput::OnDecryptOutput {
                                                    materials: returnMaterials.clone()
                                                })
                                    }));
                        return output.read();
                    } else {
                        errors = errors.concat(&seq![unwrapOutput.error().clone()]);
                    }
                } else {
                    let mut valueOrError3: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::UTF8::_default::Decode(input.encryptedDataKeys().get(&int!((&i).clone())).keyProviderId()).MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                                Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                        Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                                message: e.clone()
                                            })
                                    })
                            }));
                    if valueOrError3.IsFailure() {
                        output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<OnDecryptOutput>>());
                        return output.read();
                    };
                    let mut extractedKeyProviderId: Sequence<DafnyCharUTF16> = valueOrError3.Extract();
                    errors = errors.concat(&seq![Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                                        message: crate::implementation_from_dafny::_ErrorMessages_Compile::_default::IncorrectRawDataKeys(&crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&i).clone())), &string_utf16_of("RSAKeyring"), &extractedKeyProviderId)
                                    })]);
                }
            }
            output = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<OnDecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Failure {
                            error: Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::CollectionOfErrors {
                                        list: errors.clone(),
                                        message: string_utf16_of("Raw RSA Key was unable to decrypt any encrypted data key. The list of encountered Exceptions is available via `list`.")
                                    })
                        }));
            return output.read();
        }
    }

    impl UpcastObject<dyn IKeyring>
        for RawRSAKeyring {
        UpcastObjectFn!(dyn IKeyring);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(470,3)
    #[derive(PartialEq, Clone)]
    pub enum RsaUnwrapInfo {
        RsaUnwrapInfo {}
    }

    impl RsaUnwrapInfo {}

    impl Debug
        for RsaUnwrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for RsaUnwrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                RsaUnwrapInfo::RsaUnwrapInfo{} => {
                    write!(_formatter, "RawRSAKeyring_Compile.RsaUnwrapInfo.RsaUnwrapInfo")?;
                    Ok(())
                },
            }
        }
    }

    impl RsaUnwrapInfo {
        /// Enumerates all possible values of RsaUnwrapInfo
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<RsaUnwrapInfo>> {
            seq![Arc::new(RsaUnwrapInfo::RsaUnwrapInfo {})].iter()
        }
    }

    impl Eq
        for RsaUnwrapInfo {}

    impl Hash
        for RsaUnwrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                RsaUnwrapInfo::RsaUnwrapInfo{} => {

                },
            }
        }
    }

    impl Default
        for RsaUnwrapInfo {
        fn default() -> RsaUnwrapInfo {
            RsaUnwrapInfo::RsaUnwrapInfo {}
        }
    }

    impl AsRef<RsaUnwrapInfo>
        for RsaUnwrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(472,3)
    #[derive(PartialEq, Clone)]
    pub enum RsaWrapInfo {
        RsaWrapInfo {}
    }

    impl RsaWrapInfo {}

    impl Debug
        for RsaWrapInfo {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for RsaWrapInfo {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                RsaWrapInfo::RsaWrapInfo{} => {
                    write!(_formatter, "RawRSAKeyring_Compile.RsaWrapInfo.RsaWrapInfo")?;
                    Ok(())
                },
            }
        }
    }

    impl RsaWrapInfo {
        /// Enumerates all possible values of RsaWrapInfo
        pub fn _AllSingletonConstructors() -> SequenceIter<Arc<RsaWrapInfo>> {
            seq![Arc::new(RsaWrapInfo::RsaWrapInfo {})].iter()
        }
    }

    impl Eq
        for RsaWrapInfo {}

    impl Hash
        for RsaWrapInfo {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                RsaWrapInfo::RsaWrapInfo{} => {

                },
            }
        }
    }

    impl Default
        for RsaWrapInfo {
        fn default() -> RsaWrapInfo {
            RsaWrapInfo::RsaWrapInfo {}
        }
    }

    impl AsRef<RsaWrapInfo>
        for RsaWrapInfo {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(474,3)
    pub struct RsaGenerateAndWrapKeyMaterial {
        pub __i_publicKey: Sequence<u8>,
        pub __i_paddingScheme: Arc<RSAPaddingMode>,
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>
    }

    impl RsaGenerateAndWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(481,5)
        pub fn _ctor(this: &Object<RsaGenerateAndWrapKeyMaterial>, publicKey: &Sequence<u8>, paddingScheme: &Arc<RSAPaddingMode>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_publicKey: bool = false;
            let mut _set___i_paddingScheme: bool = false;
            let mut _set___i_cryptoPrimitives: bool = false;
            update_field_uninit_object!(this.clone(), __i_publicKey, _set___i_publicKey, publicKey.clone());
            update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(477,5)
        pub fn publicKey(&self) -> Sequence<u8> {
            self.__i_publicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(478,5)
        pub fn paddingScheme(&self) -> Arc<RSAPaddingMode> {
            self.__i_paddingScheme.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(479,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
    }

    impl UpcastObject<DynAny>
        for RsaGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl GenerateAndWrapMaterial<Arc<RsaWrapInfo>>
        for RsaGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn GenerateAndWrapMaterial<Arc<RsaWrapInfo>>>
        for RsaGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn GenerateAndWrapMaterial<Arc<RsaWrapInfo>>);
    }

    impl ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for RsaGenerateAndWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for RsaGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<GenerateAndWrapInput>, Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for RsaGenerateAndWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(520,5)
        fn Invoke(&self, input: &Arc<GenerateAndWrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut generateBytesResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GenerateRandomBytes(rd!(self.cryptoPrimitives().clone()), &Arc::new(GenerateRandomBytesInput::GenerateRandomBytesInput {
                            length: crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(input.algorithmSuite())
                        }));
            generateBytesResult = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = generateBytesResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>>());
                return res.read();
            };
            let mut plaintextMaterial: Sequence<u8> = valueOrError0.Extract();
            let mut wrap: Object<RsaWrapKeyMaterial>;
            let mut _nw0: Object<RsaWrapKeyMaterial> = RsaWrapKeyMaterial::_allocate_object();
            RsaWrapKeyMaterial::_ctor(&_nw0, &self.publicKey().clone(), &self.paddingScheme().clone(), &self.cryptoPrimitives().clone());
            wrap = _nw0.clone();
            let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = Action::<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::Invoke(rd!(wrap.clone()), &Arc::new(WrapInput::WrapInput {
                            plaintextMaterial: plaintextMaterial.clone(),
                            algorithmSuite: input.algorithmSuite().clone(),
                            encryptionContext: input.encryptionContext().clone(),
                            serializedEC: input.serializedEC().clone()
                        }));
            valueOrError1 = _out1.clone();
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>>());
                return res.read();
            };
            let mut wrapOutput: Arc<WrapOutput<Arc<RsaWrapInfo>>> = valueOrError1.Extract();
            let mut output: Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>> = Arc::new(GenerateAndWrapOutput::<Arc<RsaWrapInfo>>::GenerateAndWrapOutput {
                        plaintextMaterial: plaintextMaterial.clone(),
                        wrappedMaterial: wrapOutput.wrappedMaterial().clone(),
                        wrapInfo: Arc::new(RsaWrapInfo::RsaWrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for RsaGenerateAndWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<GenerateAndWrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateAndWrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(569,3)
    pub struct RsaWrapKeyMaterial {
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_publicKey: Sequence<u8>,
        pub __i_paddingScheme: Arc<RSAPaddingMode>
    }

    impl RsaWrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(576,5)
        pub fn _ctor(this: &Object<RsaWrapKeyMaterial>, publicKey: &Sequence<u8>, paddingScheme: &Arc<RSAPaddingMode>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_publicKey: bool = false;
            let mut _set___i_paddingScheme: bool = false;
            update_field_uninit_object!(this.clone(), __i_publicKey, _set___i_publicKey, publicKey.clone());
            update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(574,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(572,5)
        pub fn publicKey(&self) -> Sequence<u8> {
            self.__i_publicKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(573,5)
        pub fn paddingScheme(&self) -> Arc<RSAPaddingMode> {
            self.__i_paddingScheme.clone()
        }
    }

    impl UpcastObject<DynAny>
        for RsaWrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl WrapMaterial<Arc<RsaWrapInfo>>
        for RsaWrapKeyMaterial {}

    impl UpcastObject<dyn WrapMaterial<Arc<RsaWrapInfo>>>
        for RsaWrapKeyMaterial {
        UpcastObjectFn!(dyn WrapMaterial<Arc<RsaWrapInfo>>);
    }

    impl ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for RsaWrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for RsaWrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<WrapInput>, Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for RsaWrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(623,5)
        fn Invoke(&self, input: &Arc<WrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut RSAEncryptOutput: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::RSAEncrypt(rd!(self.cryptoPrimitives().clone()), &Arc::new(RSAEncryptInput::RSAEncryptInput {
                            padding: self.paddingScheme().clone(),
                            publicKey: self.publicKey().clone(),
                            plaintext: input.plaintextMaterial().clone()
                        }));
            RSAEncryptOutput = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = RSAEncryptOutput.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<WrapOutput<Arc<RsaWrapInfo>>>>());
                return res.read();
            };
            let mut ciphertext: Sequence<u8> = valueOrError0.Extract();
            let mut output: Arc<WrapOutput<Arc<RsaWrapInfo>>> = Arc::new(WrapOutput::<Arc<RsaWrapInfo>>::WrapOutput {
                        wrappedMaterial: ciphertext.clone(),
                        wrapInfo: Arc::new(RsaWrapInfo::RsaWrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for RsaWrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<WrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<WrapOutput<Arc<RsaWrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(664,3)
    pub struct RsaUnwrapKeyMaterial {
        pub __i_cryptoPrimitives: Object<AtomicPrimitivesClient>,
        pub __i_privateKey: Sequence<u8>,
        pub __i_paddingScheme: Arc<RSAPaddingMode>
    }

    impl RsaUnwrapKeyMaterial {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(671,5)
        pub fn _ctor(this: &Object<RsaUnwrapKeyMaterial>, privateKey: &Sequence<u8>, paddingScheme: &Arc<RSAPaddingMode>, cryptoPrimitives: &Object<AtomicPrimitivesClient>) -> () {
            let mut _set___i_cryptoPrimitives: bool = false;
            let mut _set___i_privateKey: bool = false;
            let mut _set___i_paddingScheme: bool = false;
            update_field_uninit_object!(this.clone(), __i_privateKey, _set___i_privateKey, privateKey.clone());
            update_field_uninit_object!(this.clone(), __i_paddingScheme, _set___i_paddingScheme, paddingScheme.clone());
            update_field_uninit_object!(this.clone(), __i_cryptoPrimitives, _set___i_cryptoPrimitives, cryptoPrimitives.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(669,5)
        pub fn cryptoPrimitives(&self) -> Object<AtomicPrimitivesClient> {
            self.__i_cryptoPrimitives.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(667,5)
        pub fn privateKey(&self) -> Sequence<u8> {
            self.__i_privateKey.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(668,5)
        pub fn paddingScheme(&self) -> Arc<RSAPaddingMode> {
            self.__i_paddingScheme.clone()
        }
    }

    impl UpcastObject<DynAny>
        for RsaUnwrapKeyMaterial {
        UpcastObjectFn!(DynAny);
    }

    impl UnwrapMaterial<Arc<RsaUnwrapInfo>>
        for RsaUnwrapKeyMaterial {}

    impl UpcastObject<dyn UnwrapMaterial<Arc<RsaUnwrapInfo>>>
        for RsaUnwrapKeyMaterial {
        UpcastObjectFn!(dyn UnwrapMaterial<Arc<RsaUnwrapInfo>>);
    }

    impl ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>
        for RsaUnwrapKeyMaterial {}

    impl UpcastObject<dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>
        for RsaUnwrapKeyMaterial {
        UpcastObjectFn!(dyn ActionWithResult<Arc<UnwrapInput>, Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>);
    }

    impl Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>
        for RsaUnwrapKeyMaterial {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/RawRSAKeyring.dfy(717,5)
        fn Invoke(&self, input: &Arc<UnwrapInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut suite: Arc<AlgorithmSuiteInfo> = input.algorithmSuite().clone();
            let mut wrappedMaterial: Sequence<u8> = input.wrappedMaterial().clone();
            let mut aad: Map<ValidUTF8Bytes, ValidUTF8Bytes> = input.encryptionContext().clone();
            let mut maybeDecryptResult: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::RSADecrypt(rd!(self.cryptoPrimitives().clone()), &Arc::new(RSADecryptInput::RSADecryptInput {
                            padding: self.paddingScheme().clone(),
                            privateKey: self.privateKey().clone(),
                            cipherText: wrappedMaterial.clone()
                        }));
            maybeDecryptResult = _out0.clone();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybeDecryptResult.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>>());
                return res.read();
            };
            let mut decryptResult: Sequence<u8> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(truncate!(decryptResult.cardinality(), u64) == crate::implementation_from_dafny::_AlgorithmSuites_Compile::_default::GetEncryptKeyLength(&suite) as u64, &Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Invalid plaintext length.")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>>());
                return res.read();
            };
            let mut output: Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>> = Arc::new(UnwrapOutput::<Arc<RsaUnwrapInfo>>::UnwrapOutput {
                        unwrappedMaterial: decryptResult.clone(),
                        unwrapInfo: Arc::new(RsaUnwrapInfo::RsaUnwrapInfo {})
                    });
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: output.clone()
                        }));
            return res.read();
        }
    }

    impl UpcastObject<dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>>
        for RsaUnwrapKeyMaterial {
        UpcastObjectFn!(dyn Action<Arc<UnwrapInput>, Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<UnwrapOutput<Arc<RsaUnwrapInfo>>>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>);
    }
}
/// *****************************************************************************
///  Copyright by the contributors to the Dafny Project
///  SPDX-License-Identifier: MIT
/// *****************************************************************************
/// ../mpl/libraries/src/Relations.dfy(8,1)
pub mod _Relations_Compile {

}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(12,1)
pub mod _RequiredEncryptionContextCMM_Compile {
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
    pub use ::dafny_runtime::Set;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use crate::implementation_from_dafny::_CMM_Compile::VerifiableInterface;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetEncryptionMaterialsOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::itertools::Itertools;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::_DefaultCMM_Compile::DefaultCMM;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DecryptMaterialsOutput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(24,3)
    pub struct RequiredEncryptionContextCMM {
        pub __i_underlyingCMM: Object<dyn ICryptographicMaterialsManager>,
        pub __i_requiredEncryptionContextKeys: Sequence<ValidUTF8Bytes>
    }

    impl RequiredEncryptionContextCMM {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(39,5)
        pub fn _ctor(this: &Object<RequiredEncryptionContextCMM>, inputCMM: &Object<dyn ICryptographicMaterialsManager>, inputKeys: &Set<ValidUTF8Bytes>) -> () {
            let mut _set___i_underlyingCMM: bool = false;
            let mut _set___i_requiredEncryptionContextKeys: bool = false;
            let mut keySet: Set<ValidUTF8Bytes> = inputKeys.clone();
            let mut keySeq: Sequence<ValidUTF8Bytes>;
            let mut _out0: Sequence<ValidUTF8Bytes> = crate::implementation_from_dafny::SortedSets::_default::SetToSequence::<ValidUTF8Bytes>(&keySet);
            keySeq = _out0.clone();
            update_field_uninit_object!(this.clone(), __i_underlyingCMM, _set___i_underlyingCMM, inputCMM.clone());
            update_field_uninit_object!(this.clone(), __i_requiredEncryptionContextKeys, _set___i_requiredEncryptionContextKeys, keySeq.clone());
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(27,5)
        pub fn underlyingCMM(&self) -> Object<dyn ICryptographicMaterialsManager> {
            self.__i_underlyingCMM.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(28,5)
        pub fn requiredEncryptionContextKeys(&self) -> Sequence<ValidUTF8Bytes> {
            self.__i_requiredEncryptionContextKeys.clone()
        }
    }

    impl UpcastObject<DynAny>
        for RequiredEncryptionContextCMM {
        UpcastObjectFn!(DynAny);
    }

    impl VerifiableInterface
        for RequiredEncryptionContextCMM {}

    impl UpcastObject<dyn VerifiableInterface>
        for RequiredEncryptionContextCMM {
        UpcastObjectFn!(dyn VerifiableInterface);
    }

    impl ICryptographicMaterialsManager
        for RequiredEncryptionContextCMM {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(85,5)
        fn _GetEncryptionMaterials_k(&self, input: &Arc<GetEncryptionMaterialsInput>) -> Arc<Result<Arc<GetEncryptionMaterialsOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<GetEncryptionMaterialsOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(Itertools::unique((&self.requiredEncryptionContextKeys().clone()).iter()).all(({
                            let mut _this = Object::<_>::from_ref(self);
                            let mut input = input.clone();
                            Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{
                                    let mut k: ValidUTF8Bytes = __forall_var_0.clone();
                                    if {
                                            let i: Sequence<u8> = k.clone();
                                            crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                        } {
                                        !rd!(_this.clone()).requiredEncryptionContextKeys().clone().contains(&k) || input.encryptionContext().contains(&k)
                                    } else {
                                        true
                                    }
                                })
                        }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Encryption context does not contain required keys.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                return output.read();
            };
            let mut valueOrError1: Arc<Result<Arc<GetEncryptionMaterialsOutput>, Arc<Error>>>;
            let mut _out0: Arc<Result<Arc<GetEncryptionMaterialsOutput>, Arc<Error>>> = ICryptographicMaterialsManager::GetEncryptionMaterials(rd!(self.underlyingCMM().clone()), &({
                        let __pat_let33_0: Arc<GetEncryptionMaterialsInput> = input.clone();
                        {
                            let _dt__update__tmp_h0: Arc<GetEncryptionMaterialsInput> = __pat_let33_0.clone();
                            {
                                let __pat_let34_0: Arc<Option<Sequence<ValidUTF8Bytes>>> = Arc::new(Option::<Sequence<ValidUTF8Bytes>>::Some {
                                            value: input.requiredEncryptionContextKeys().UnwrapOr(&(seq![] as Sequence<ValidUTF8Bytes>)).concat(&self.requiredEncryptionContextKeys().clone())
                                        });
                                {
                                    let _dt__update_hrequiredEncryptionContextKeys_h0: Arc<Option<Sequence<ValidUTF8Bytes>>> = __pat_let34_0.clone();
                                    Arc::new(GetEncryptionMaterialsInput::GetEncryptionMaterialsInput {
                                            encryptionContext: _dt__update__tmp_h0.encryptionContext().clone(),
                                            commitmentPolicy: _dt__update__tmp_h0.commitmentPolicy().clone(),
                                            algorithmSuiteId: _dt__update__tmp_h0.algorithmSuiteId().clone(),
                                            maxPlaintextLength: _dt__update__tmp_h0.maxPlaintextLength().clone(),
                                            requiredEncryptionContextKeys: _dt__update_hrequiredEncryptionContextKeys_h0.clone()
                                        })
                                }
                            }
                        }
                    }));
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                return output.read();
            };
            let mut result: Arc<GetEncryptionMaterialsOutput> = valueOrError1.Extract();
            if !(({
                        let __is_35: Object<dyn ICryptographicMaterialsManager> = self.underlyingCMM().clone();
                        __is_35.clone().is_instance_of::<DefaultCMM>()
                    }) || ({
                        let __is_36: Object<dyn ICryptographicMaterialsManager> = self.underlyingCMM().clone();
                        __is_36.clone().is_instance_of::<RequiredEncryptionContextCMM>()
                    })) {
                let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(Itertools::unique((&self.requiredEncryptionContextKeys().clone()).iter()).all(({
                                let mut _this = Object::<_>::from_ref(self);
                                let mut result = result.clone();
                                Arc::new(move |__forall_var_1: ValidUTF8Bytes| -> bool{
                                        let mut k: ValidUTF8Bytes = __forall_var_1.clone();
                                        if {
                                                let i: Sequence<u8> = k.clone();
                                                crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                            } {
                                            !rd!(_this.clone()).requiredEncryptionContextKeys().clone().contains(&k) || result.encryptionMaterials().requiredEncryptionContextKeys().contains(&k)
                                        } else {
                                            true
                                        }
                                    })
                            }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Expected encryption context keys do not exist in keys to only authenticate.")
                            }));
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                    return output.read();
                };
                let mut valueOrError3: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::EncryptionMaterialsHasPlaintextDataKey(result.encryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Could not retrieve materials required for encryption")
                            }));
                if valueOrError3.IsFailure() {
                    output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                    return output.read();
                };
                let mut valueOrError4: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_CMM_Compile::_default::_RequiredEncryptionContextKeys_q(input.requiredEncryptionContextKeys(), result.encryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Keyring returned an invalid response")
                            }));
                if valueOrError4.IsFailure() {
                    output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<GetEncryptionMaterialsOutput>>());
                    return output.read();
                }
            };
            output = MaybePlacebo::from(Arc::new(Result::<Arc<GetEncryptionMaterialsOutput>, Arc<Error>>::Success {
                            value: result.clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMMs/RequiredEncryptionContextCMM.dfy(241,5)
        fn _DecryptMaterials_k(&self, input: &Arc<DecryptMaterialsInput>) -> Arc<Result<Arc<DecryptMaterialsOutput>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Arc<DecryptMaterialsOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!(input.reproducedEncryptionContext().as_ref(), Some{ .. }), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("No reproduced encryption context on decrypt.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                return output.read();
            };
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_CMM_Compile::_default::_ReproducedEncryptionContext_q(input), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Encryption context does not match reproduced encryption context.")
                        }));
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                return output.read();
            };
            let mut valueOrError2: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(Itertools::unique((&self.requiredEncryptionContextKeys().clone()).iter()).all(({
                            let mut _this = Object::<_>::from_ref(self);
                            let mut input = input.clone();
                            Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{
                                    let mut k: ValidUTF8Bytes = __forall_var_0.clone();
                                    if {
                                            let i: Sequence<u8> = k.clone();
                                            crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                        } {
                                        !rd!(_this.clone()).requiredEncryptionContextKeys().clone().contains(&k) || input.reproducedEncryptionContext().value().contains(&k)
                                    } else {
                                        true
                                    }
                                })
                        }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("Reproduced encryption context missing required keys.")
                        }));
            if valueOrError2.IsFailure() {
                output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                return output.read();
            };
            let mut valueOrError3: Arc<Result<Arc<DecryptMaterialsOutput>, Arc<Error>>>;
            let mut _out0: Arc<Result<Arc<DecryptMaterialsOutput>, Arc<Error>>> = ICryptographicMaterialsManager::DecryptMaterials(rd!(self.underlyingCMM().clone()), input);
            valueOrError3 = _out0.clone();
            if valueOrError3.IsFailure() {
                output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                return output.read();
            };
            let mut result: Arc<DecryptMaterialsOutput> = valueOrError3.Extract();
            if !(({
                        let __is_37: Object<dyn ICryptographicMaterialsManager> = self.underlyingCMM().clone();
                        __is_37.clone().is_instance_of::<DefaultCMM>()
                    }) || ({
                        let __is_38: Object<dyn ICryptographicMaterialsManager> = self.underlyingCMM().clone();
                        __is_38.clone().is_instance_of::<RequiredEncryptionContextCMM>()
                    })) {
                let mut valueOrError4: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(Itertools::unique((&self.requiredEncryptionContextKeys().clone()).iter()).all(({
                                let mut _this = Object::<_>::from_ref(self);
                                let mut result = result.clone();
                                Arc::new(move |__forall_var_1: ValidUTF8Bytes| -> bool{
                                        let mut k: ValidUTF8Bytes = __forall_var_1.clone();
                                        if {
                                                let i: Sequence<u8> = k.clone();
                                                crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                            } {
                                            !rd!(_this.clone()).requiredEncryptionContextKeys().clone().contains(&k) || result.decryptionMaterials().encryptionContext().contains(&k)
                                        } else {
                                            true
                                        }
                                    })
                            }).as_ref()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Final encryption context missing required keys.")
                            }));
                if valueOrError4.IsFailure() {
                    output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                    return output.read();
                };
                let mut valueOrError5: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_CMM_Compile::_default::EncryptionContextComplete(input, result.decryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Reproduced encryption context missing from encryption context.")
                            }));
                if valueOrError5.IsFailure() {
                    output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                    return output.read();
                };
                let mut valueOrError6: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(crate::implementation_from_dafny::_Materials_Compile::_default::DecryptionMaterialsWithPlaintextDataKey(result.decryptionMaterials()), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                message: string_utf16_of("Keyring.OnDecrypt failed to decrypt the plaintext data key.")
                            }));
                if valueOrError6.IsFailure() {
                    output = MaybePlacebo::from(valueOrError6.PropagateFailure::<Arc<DecryptMaterialsOutput>>());
                    return output.read();
                }
            };
            output = MaybePlacebo::from(Arc::new(Result::<Arc<DecryptMaterialsOutput>, Arc<Error>>::Success {
                            value: result.clone()
                        }));
            return output.read();
        }
    }

    impl UpcastObject<dyn ICryptographicMaterialsManager>
        for RequiredEncryptionContextCMM {
        UpcastObjectFn!(dyn ICryptographicMaterialsManager);
    }
}
/// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(21,1)
pub mod _Seq_Compile {
    pub use ::dafny_runtime::DafnyType;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::std::mem::MaybeUninit;
    pub use ::dafny_runtime::array;
    pub use ::dafny_runtime::DafnyUsize;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::DafnyTypeEq;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::SetBuilder;
    pub use ::dafny_runtime::_System::nat;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::Zero;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::integer_range_down;

    pub struct _default {}

    impl _default {
        /// ********************************************************
        ///
        ///  Manipulating the End of a Sequence
        ///
        /// *********************************************************
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(35,3)
        pub fn First<_T: DafnyType>(xs: &Sequence<_T>) -> _T {
            xs.get(&int!(0))
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(43,3)
        pub fn DropFirst<_T: DafnyType>(xs: &Sequence<_T>) -> Sequence<_T> {
            xs.drop(&int!(1))
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(50,3)
        pub fn Last<_T: DafnyType>(xs: &Sequence<_T>) -> _T {
            xs.get(&(xs.cardinality() - int!(1)))
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(58,3)
        pub fn DropLast<_T: DafnyType>(xs: &Sequence<_T>) -> Sequence<_T> {
            xs.take(&(xs.cardinality() - int!(1)))
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(163,3)
        pub fn ToArray<_T: DafnyType>(xs: &Sequence<_T>) -> Object<[_T]> {
            let mut a = MaybePlacebo::<Object<[_T]>>::new();
            let mut _init0: Arc<dyn ::std::ops::Fn(&DafnyInt) -> _T + Sync + Send> = {
                    let xs: Sequence<_T> = xs.clone();
                    {
                        let mut xs = xs.clone();
                        Arc::new(move |i: &DafnyInt| -> _T{
                                xs.get(i)
                            })
                    }
                };
            let mut _nw0: Object<[MaybeUninit<_T>]> = array::placebos_usize_object::<_T>(DafnyUsize::into_usize(xs.cardinality()));
            for __i0_0 in integer_range(0, rd!(_nw0.clone()).len()) {
                {
                    let __idx0 = DafnyUsize::into_usize(__i0_0.clone());
                    ::dafny_runtime::md!(_nw0)[__idx0] = MaybeUninit::new((&_init0)(&int!(__i0_0.clone())));
                }
            }
            a = MaybePlacebo::from(array::construct_object(_nw0.clone()));
            return a.read();
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(172,3)
        pub fn ToSet<_T: DafnyTypeEq>(xs: &Sequence<_T>) -> Set<_T> {
            (&({
                let mut xs = xs.clone();
                Arc::new(move || -> Set<_T>{
                        let mut _coll0: SetBuilder<_T> = SetBuilder::<_T>::new();
                        for __compr_0 in (&xs).iter() {
                            let mut x: _T = __compr_0.clone();
                            if xs.contains(&x) {
                                _coll0.add(&x)
                            }
                        }
                        _coll0.build()
                    })
            }))()
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(284,3)
        pub fn IndexOf<_T: DafnyTypeEq>(xs: &Sequence<_T>, v: &_T) -> nat {
            let mut _accumulator: nat = int!(0);
            let mut _r0 = xs.clone();
            let mut _r1 = v.clone();
            'TAIL_CALL_START: loop {
                let xs = _r0;
                let v = _r1;
                if xs.get(&int!(0)) == v.clone() {
                    return int!(0) + _accumulator.clone();
                } else {
                    _accumulator = _accumulator.clone() + int!(1);
                    let mut _in0: Sequence<_T> = xs.drop(&int!(1));
                    let mut _in1: _T = v.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(294,3)
        pub fn IndexOfOption<_T: DafnyTypeEq>(xs: &Sequence<_T>, v: &_T) -> Arc<Option<nat>> {
            if xs.cardinality() == int!(0) {
                Arc::new(Option::<DafnyInt>::None {})
            } else {
                if xs.get(&int!(0)) == v.clone() {
                    Arc::new(Option::<DafnyInt>::Some {
                            value: int!(0)
                        })
                } else {
                    let mut _o_k: Arc<Option<nat>> = _default::IndexOfOption::<_T>(&xs.drop(&int!(1)), v);
                    if matches!((&_o_k).as_ref(), Some{ .. }) {
                        Arc::new(Option::<DafnyInt>::Some {
                                value: _o_k.value().clone() + int!(1)
                            })
                    } else {
                        Arc::new(Option::<DafnyInt>::None {})
                    }
                }
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(309,3)
        pub fn LastIndexOf<_T: DafnyTypeEq>(xs: &Sequence<_T>, v: &_T) -> nat {
            let mut _r0 = xs.clone();
            let mut _r1 = v.clone();
            'TAIL_CALL_START: loop {
                let xs = _r0;
                let v = _r1;
                if xs.get(&(xs.cardinality() - int!(1))) == v.clone() {
                    return xs.cardinality() - int!(1);
                } else {
                    let mut _in0: Sequence<_T> = xs.take(&(xs.cardinality() - int!(1)));
                    let mut _in1: _T = v.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(319,3)
        pub fn LastIndexOfOption<_T: DafnyTypeEq>(xs: &Sequence<_T>, v: &_T) -> Arc<Option<nat>> {
            let mut _r0 = xs.clone();
            let mut _r1 = v.clone();
            'TAIL_CALL_START: loop {
                let xs = _r0;
                let v = _r1;
                if xs.cardinality() == int!(0) {
                    return Arc::new(Option::<DafnyInt>::None {});
                } else {
                    if xs.get(&(xs.cardinality() - int!(1))) == v.clone() {
                        return Arc::new(Option::<DafnyInt>::Some {
                                    value: xs.cardinality() - int!(1)
                                });
                    } else {
                        let mut _in0: Sequence<_T> = xs.take(&(xs.cardinality() - int!(1)));
                        let mut _in1: _T = v.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(329,3)
        pub fn Remove<_T: DafnyType>(xs: &Sequence<_T>, pos: &nat) -> Sequence<_T> {
            xs.take(pos).concat(&xs.drop(&(pos.clone() + int!(1))))
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(340,3)
        pub fn RemoveValue<_T: DafnyTypeEq>(xs: &Sequence<_T>, v: &_T) -> Sequence<_T> {
            if !xs.contains(v) {
                xs.clone()
            } else {
                let mut i: nat = _default::IndexOf::<_T>(xs, v);
                xs.take(&i).concat(&xs.drop(&(i.clone() + int!(1))))
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(356,3)
        pub fn Insert<_T: DafnyType>(xs: &Sequence<_T>, a: &_T, pos: &nat) -> Sequence<_T> {
            xs.take(pos).concat(&seq![a.clone()]).concat(&xs.drop(pos))
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(369,3)
        pub fn Reverse<_T: DafnyType>(xs: &Sequence<_T>) -> Sequence<_T> {
            let mut _accumulator: Sequence<_T> = seq![] as Sequence<_T>;
            let mut _r0 = xs.clone();
            'TAIL_CALL_START: loop {
                let xs = _r0;
                if xs.clone().to_array().len() == 0 {
                    return _accumulator.concat(&(seq![] as Sequence<_T>));
                } else {
                    _accumulator = _accumulator.concat(&seq![xs.get(&(xs.cardinality() - int!(1)))]);
                    let mut _in0: Sequence<_T> = xs.slice(&int!(0), &(xs.cardinality() - int!(1)));
                    _r0 = _in0.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(377,3)
        pub fn Repeat<_T: DafnyType>(v: &_T, length: &nat) -> Sequence<_T> {
            let mut _accumulator: Sequence<_T> = seq![] as Sequence<_T>;
            let mut _r0 = v.clone();
            let mut _r1 = length.clone();
            'TAIL_CALL_START: loop {
                let v = _r0;
                let length = _r1;
                if length.clone() == int!(0) {
                    return _accumulator.concat(&(seq![] as Sequence<_T>));
                } else {
                    _accumulator = _accumulator.concat(&seq![v.clone()]);
                    let mut _in0: _T = v.clone();
                    let mut _in1: DafnyInt = length.clone() - int!(1);
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(388,3)
        pub fn Unzip<_A: DafnyType, _B: DafnyType>(xs: &Sequence<(_A, _B)>) -> (Sequence<_A>, Sequence<_B>) {
            if xs.cardinality() == int!(0) {
                (
                    seq![] as Sequence<_A>,
                    seq![] as Sequence<_B>
                )
            } else {
                let mut __let_tmp_rhs0: (Sequence<_A>, Sequence<_B>) = _default::Unzip::<_A, _B>(&_default::DropLast::<(_A, _B)>(xs));
                let mut a: Sequence<_A> = __let_tmp_rhs0.0.clone();
                let mut b: Sequence<_B> = __let_tmp_rhs0.1.clone();
                (
                    a.concat(&seq![_default::Last::<(_A, _B)>(xs).0.clone()]),
                    b.concat(&seq![_default::Last::<(_A, _B)>(xs).1.clone()])
                )
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(400,3)
        pub fn Zip<_A: DafnyType, _B: DafnyType>(xs: &Sequence<_A>, ys: &Sequence<_B>) -> Sequence<(_A, _B)> {
            let mut _accumulator: Sequence<(_A, _B)> = seq![] as Sequence<(_A, _B)>;
            let mut _r0 = xs.clone();
            let mut _r1 = ys.clone();
            'TAIL_CALL_START: loop {
                let xs = _r0;
                let ys = _r1;
                if xs.cardinality() == int!(0) {
                    return (seq![] as Sequence<(_A, _B)>).concat(&_accumulator);
                } else {
                    _accumulator = seq![(
                                _default::Last::<_A>(&xs),
                                _default::Last::<_B>(&ys)
                            )].concat(&_accumulator);
                    let mut _in0: Sequence<_A> = _default::DropLast::<_A>(&xs);
                    let mut _in1: Sequence<_B> = _default::DropLast::<_B>(&ys);
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ********************************************************
        ///
        ///  Extrema in Sequences
        ///
        /// *********************************************************
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(424,3)
        pub fn Max(xs: &Sequence<DafnyInt>) -> DafnyInt {
            if xs.cardinality() == int!(1) {
                xs.get(&int!(0))
            } else {
                crate::implementation_from_dafny::_Math_Compile::_default::Max(&xs.get(&int!(0)), &_default::Max(&xs.drop(&int!(1))))
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(450,3)
        pub fn Min(xs: &Sequence<DafnyInt>) -> DafnyInt {
            if xs.cardinality() == int!(1) {
                xs.get(&int!(0))
            } else {
                crate::implementation_from_dafny::_Math_Compile::_default::Min(&xs.get(&int!(0)), &_default::Min(&xs.drop(&int!(1))))
            }
        }
        /// ********************************************************
        ///
        ///  Sequences of Sequences
        ///
        /// *********************************************************
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(510,3)
        pub fn Flatten<_T: DafnyType>(xs: &Sequence<Sequence<_T>>) -> Sequence<_T> {
            let mut _accumulator: Sequence<_T> = seq![] as Sequence<_T>;
            let mut _r0 = xs.clone();
            'TAIL_CALL_START: loop {
                let xs = _r0;
                if xs.cardinality() == int!(0) {
                    return _accumulator.concat(&(seq![] as Sequence<_T>));
                } else {
                    _accumulator = _accumulator.concat(&xs.get(&int!(0)));
                    let mut _in0: Sequence<Sequence<_T>> = xs.drop(&int!(1));
                    _r0 = _in0.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(538,3)
        pub fn FlattenReverse<_T: DafnyType>(xs: &Sequence<Sequence<_T>>) -> Sequence<_T> {
            let mut _accumulator: Sequence<_T> = seq![] as Sequence<_T>;
            let mut _r0 = xs.clone();
            'TAIL_CALL_START: loop {
                let xs = _r0;
                if xs.cardinality() == int!(0) {
                    return (seq![] as Sequence<_T>).concat(&_accumulator);
                } else {
                    _accumulator = _default::Last::<Sequence<_T>>(&xs).concat(&_accumulator);
                    let mut _in0: Sequence<Sequence<_T>> = _default::DropLast::<Sequence<_T>>(&xs);
                    _r0 = _in0.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ********************************************************
        ///
        ///  Higher-Order Sequence Functions
        ///
        /// *********************************************************
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(620,3)
        pub fn Map<_T: DafnyType, _R: DafnyType>(f: &Arc<dyn ::std::ops::Fn(&_T) -> _R + Sync + Send>, xs: &Sequence<_T>) -> Sequence<_R> {
            {
                let _initializer = {
                        let f: Arc<dyn ::std::ops::Fn(&_T) -> _R + Sync + Send> = f.clone();
                        let xs: Sequence<_T> = xs.clone();
                        {
                            let mut f = f.clone();
                            let mut xs = xs.clone();
                            Arc::new(move |i: &DafnyInt| -> _R{
                                    (&f)(&xs.get(i))
                                })
                        }
                    };
                integer_range(Zero::zero(), xs.cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(637,3)
        pub fn MapWithResult<_T: DafnyType, _R: DafnyType, _E: DafnyType>(f: &Arc<dyn ::std::ops::Fn(&_T) -> Arc<Result<_R, _E>> + Sync + Send>, xs: &Sequence<_T>) -> Arc<Result<Sequence<_R>, _E>> {
            if xs.cardinality() == int!(0) {
                Arc::new(Result::<Sequence<_R>, _E>::Success {
                        value: seq![] as Sequence<_R>
                    })
            } else {
                let mut valueOrError0: Arc<Result<_R, _E>> = f(&xs.get(&int!(0)));
                if valueOrError0.IsFailure() {
                    valueOrError0.PropagateFailure::<Sequence<_R>>()
                } else {
                    let mut head: _R = valueOrError0.Extract();
                    let mut valueOrError1: Arc<Result<Sequence<_R>, _E>> = _default::MapWithResult::<_T, _R, _E>(f, &xs.drop(&int!(1)));
                    if valueOrError1.IsFailure() {
                        valueOrError1.PropagateFailure::<Sequence<_R>>()
                    } else {
                        let mut tail: Sequence<_R> = valueOrError1.Extract();
                        Arc::new(Result::<Sequence<_R>, _E>::Success {
                                value: seq![head.clone()].concat(&tail)
                            })
                    }
                }
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(678,3)
        pub fn Filter<_T: DafnyType>(f: &Arc<dyn ::std::ops::Fn(&_T) -> bool + Sync + Send>, xs: &Sequence<_T>) -> Sequence<_T> {
            let mut _accumulator: Sequence<_T> = seq![] as Sequence<_T>;
            let mut _r0 = f.clone();
            let mut _r1 = xs.clone();
            'TAIL_CALL_START: loop {
                let f = _r0;
                let xs = _r1;
                if xs.cardinality() == int!(0) {
                    return _accumulator.concat(&(seq![] as Sequence<_T>));
                } else {
                    _accumulator = _accumulator.concat(&(if (&f)(&xs.get(&int!(0))) {
                                seq![xs.get(&int!(0))]
                            } else {
                                seq![] as Sequence<_T>
                            }));
                    let mut _in0: Arc<dyn ::std::ops::Fn(&_T) -> bool + Sync + Send> = f.clone();
                    let mut _in1: Sequence<_T> = xs.drop(&int!(1));
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(714,3)
        pub fn FoldLeft<_A: DafnyType, _T: DafnyType>(f: &Arc<dyn ::std::ops::Fn(&_A, &_T) -> _A + Sync + Send>, init: &_A, xs: &Sequence<_T>) -> _A {
            let mut _r0 = f.clone();
            let mut _r1 = init.clone();
            let mut _r2 = xs.clone();
            'TAIL_CALL_START: loop {
                let f = _r0;
                let init = _r1;
                let xs = _r2;
                if xs.cardinality() == int!(0) {
                    return init.clone();
                } else {
                    let mut _in0: Arc<dyn ::std::ops::Fn(&_A, &_T) -> _A + Sync + Send> = f.clone();
                    let mut _in1: _A = (&f)(&init, &xs.get(&int!(0)));
                    let mut _in2: Sequence<_T> = xs.drop(&int!(1));
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    _r2 = _in2.clone();
                    continue 'TAIL_CALL_START;
                }
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(775,3)
        pub fn FoldRight<_A: DafnyType, _T: DafnyType>(f: &Arc<dyn ::std::ops::Fn(&_T, &_A) -> _A + Sync + Send>, xs: &Sequence<_T>, init: &_A) -> _A {
            if xs.cardinality() == int!(0) {
                init.clone()
            } else {
                f(&xs.get(&int!(0)), &_default::FoldRight::<_A, _T>(f, &xs.drop(&int!(1)), init))
            }
        }
        /// ../mpl/libraries/src/Collections/Sequences/Seq.dfy(831,3)
        pub fn FlatMap<_T: DafnyType, _R: DafnyType>(f: &Arc<dyn ::std::ops::Fn(&_T) -> Sequence<_R> + Sync + Send>, xs: &Sequence<_T>) -> Sequence<_R> {
            let mut result: Sequence<_R> = seq![] as Sequence<_R>;
            let mut _lo0: DafnyInt = int!(0);
            for i in integer_range_down(xs.cardinality(), _lo0.clone()) {
                let mut next: Sequence<_R> = f(&xs.get(&i));
                result = next.concat(&result);
            }
            return result.clone();
        }
    }

    /// ../mpl/libraries/src/Collections/Sequences/MergeSort.dfy(10,1)
    pub mod _MergeSort_Compile {
        pub use ::dafny_runtime::DafnyType;
        pub use ::dafny_runtime::Sequence;
        pub use ::std::sync::Arc;
        pub use ::std::marker::Sync;
        pub use ::std::marker::Send;
        pub use ::dafny_runtime::int;
        pub use ::dafny_runtime::DafnyInt;
        pub use ::dafny_runtime::euclidian_division;
        pub use ::dafny_runtime::seq;

        pub struct _default {}

        impl _default {
            /// ../mpl/libraries/src/Collections/Sequences/MergeSort.dfy(15,3)
            pub fn MergeSortBy<_T: DafnyType>(a: &Sequence<_T>, lessThanOrEq: &Arc<dyn ::std::ops::Fn(&_T, &_T) -> bool + Sync + Send>) -> Sequence<_T> {
                if !(int!(1) < a.cardinality()) {
                    a.clone()
                } else {
                    let mut splitIndex: DafnyInt = euclidian_division(a.cardinality(), int!(2));
                    let mut left: Sequence<_T> = a.take(&splitIndex);
                    let mut right: Sequence<_T> = a.drop(&splitIndex);
                    let mut leftSorted: Sequence<_T> = crate::implementation_from_dafny::_Seq_Compile::_MergeSort_Compile::_default::MergeSortBy::<_T>(&left, lessThanOrEq);
                    let mut rightSorted: Sequence<_T> = crate::implementation_from_dafny::_Seq_Compile::_MergeSort_Compile::_default::MergeSortBy::<_T>(&right, lessThanOrEq);
                    crate::implementation_from_dafny::_Seq_Compile::_MergeSort_Compile::_default::MergeSortedWith::<_T>(&leftSorted, &rightSorted, lessThanOrEq)
                }
            }
            /// ../mpl/libraries/src/Collections/Sequences/MergeSort.dfy(34,3)
            pub fn MergeSortedWith<_T: DafnyType>(left: &Sequence<_T>, right: &Sequence<_T>, lessThanOrEq: &Arc<dyn ::std::ops::Fn(&_T, &_T) -> bool + Sync + Send>) -> Sequence<_T> {
                let mut _accumulator: Sequence<_T> = seq![] as Sequence<_T>;
                let mut _r0 = left.clone();
                let mut _r1 = right.clone();
                let mut _r2 = lessThanOrEq.clone();
                'TAIL_CALL_START: loop {
                    let left = _r0;
                    let right = _r1;
                    let lessThanOrEq = _r2;
                    if left.cardinality() == int!(0) {
                        return _accumulator.concat(&right);
                    } else {
                        if right.cardinality() == int!(0) {
                            return _accumulator.concat(&left);
                        } else {
                            if (&lessThanOrEq)(&left.get(&int!(0)), &right.get(&int!(0))) {
                                _accumulator = _accumulator.concat(&seq![left.get(&int!(0))]);
                                let mut _in0: Sequence<_T> = left.drop(&int!(1));
                                let mut _in1: Sequence<_T> = right.clone();
                                let mut _in2: Arc<dyn ::std::ops::Fn(&_T, &_T) -> bool + Sync + Send> = lessThanOrEq.clone();
                                _r0 = _in0.clone();
                                _r1 = _in1.clone();
                                _r2 = _in2.clone();
                                continue 'TAIL_CALL_START;
                            } else {
                                _accumulator = _accumulator.concat(&seq![right.get(&int!(0))]);
                                let mut _in3: Sequence<_T> = left.clone();
                                let mut _in4: Sequence<_T> = right.drop(&int!(1));
                                let mut _in5: Arc<dyn ::std::ops::Fn(&_T, &_T) -> bool + Sync + Send> = lessThanOrEq.clone();
                                _r0 = _in3.clone();
                                _r1 = _in4.clone();
                                _r2 = _in5.clone();
                                continue 'TAIL_CALL_START;
                            }
                        }
                    }
                }
            }
        }
    }
}
/// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(6,1)
pub mod _SerializableTypes_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::EncryptedDataKey;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::itertools::Itertools;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Encrypt;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::AES_GCM;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::Zero;
    pub use ::dafny_runtime::int;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::std::default::Default;
    pub use ::std::convert::Into;
    pub use ::dafny_runtime::DafnyType;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::std::fmt::Result;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(22,3)
        pub fn IsESDKEncryptedDataKey(edk: &Arc<EncryptedDataKey>) -> bool {
            crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint16Len::<u8>(edk.keyProviderId()) && crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(edk.keyProviderId()) && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint16Len::<u8>(edk.keyProviderInfo()) && crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint16Len::<u8>(edk.ciphertext())
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(36,3)
        pub fn IsESDKEncryptionContext(ec: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> bool {
            truncate!(ec.cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64) && _default::Length(ec) < _default::ESDK_CANONICAL_ENCRYPTION_CONTEXT_MAX_LENGTH() && Itertools::unique((&ec.keys().as_dafny_multiset().merge(&ec.values().as_dafny_multiset())).iter()).all(({
                    let mut ec = ec.clone();
                    Arc::new(move |__forall_var_0: ValidUTF8Bytes| -> bool{
                            let mut element: ValidUTF8Bytes = __forall_var_0.clone();
                            if {
                                    let i: Sequence<u8> = element.clone();
                                    crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&i)
                                } {
                                !ec.keys().as_dafny_multiset().merge(&ec.values().as_dafny_multiset()).contains(&element) || crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint16Len::<u8>(&element) && crate::implementation_from_dafny::UTF8::_default::ValidUTF8Seq(&element)
                            } else {
                                true
                            }
                        })
                }).as_ref())
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(51,3)
        pub fn GetIvLength(a: &Arc<AlgorithmSuiteInfo>) -> u8 {
            let mut _source0: Arc<Encrypt> = a.encrypt().clone();
            let mut ___mcc_h0: Arc<AES_GCM> = _source0.AES_GCM().clone();
            let mut e: Arc<AES_GCM> = ___mcc_h0.clone();
            e.ivLength().clone() as u8
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(58,3)
        pub fn GetIvLengthZeros(a: &Arc<AlgorithmSuiteInfo>) -> Sequence<u8> {
            let mut len: u8 = _default::GetIvLength(a);
            if len == 12 {
                seq![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
            } else {
                {
                    let _initializer = {
                            Arc::new(move |_v0: &DafnyInt| -> u8{
                                    0
                                })
                        };
                    integer_range(Zero::zero(), int!(len)).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(70,3)
        pub fn GetTagLength(a: &Arc<AlgorithmSuiteInfo>) -> u8 {
            let mut _source0: Arc<Encrypt> = a.encrypt().clone();
            let mut ___mcc_h0: Arc<AES_GCM> = _source0.AES_GCM().clone();
            let mut e: Arc<AES_GCM> = ___mcc_h0.clone();
            e.tagLength().clone() as u8
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(77,3)
        pub fn GetEncryptKeyLength(a: &Arc<AlgorithmSuiteInfo>) -> i32 {
            let mut _source0: Arc<Encrypt> = a.encrypt().clone();
            let mut ___mcc_h0: Arc<AES_GCM> = _source0.AES_GCM().clone();
            let mut e: Arc<AES_GCM> = ___mcc_h0.clone();
            e.keyLength().clone()
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(100,3)
        pub fn Length(encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> u64 {
            if truncate!(encryptionContext.cardinality(), u64) == 0 {
                0
            } else {
                let mut pairs: Sequence<Arc<Pair<ValidUTF8Bytes, ValidUTF8Bytes>>> = _default::GetCanonicalLinearPairs(encryptionContext);
                _default::LinearLength(&pairs)
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(117,3)
        pub fn GetCanonicalLinearPairs(encryptionContext: &Map<ValidUTF8Bytes, ValidUTF8Bytes>) -> Sequence<Arc<Pair<ValidUTF8Bytes, ValidUTF8Bytes>>> {
            let mut keys: Sequence<ValidUTF8Bytes> = crate::implementation_from_dafny::SortedSets::_default::SetToOrderedSequence2::<u8>(&encryptionContext.keys(), &(Arc::new(move |x0: &u8,x1: &u8| crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt8Less(x0.clone(), x1.clone())) as Arc<dyn ::std::ops::Fn(&_, &_) -> _ + Sync + Send>));
            {
                let _initializer = {
                        let keys: Sequence<ValidUTF8Bytes> = keys.clone();
                        let encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = encryptionContext.clone();
                        {
                            let mut encryptionContext = encryptionContext.clone();
                            let mut keys = keys.clone();
                            Arc::new(move |i: &DafnyInt| -> Arc<Pair<ValidUTF8Bytes, ValidUTF8Bytes>>{
                                    Arc::new(Pair::<ValidUTF8Bytes, ValidUTF8Bytes>::Pair {
                                            key: keys.get(i),
                                            value: encryptionContext.get(&keys.get(i))
                                        })
                                })
                        }
                    };
                integer_range(Zero::zero(), keys.cardinality()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(167,3)
        pub fn LinearLength(pairs: &Sequence<Arc<Pair<ValidUTF8Bytes, ValidUTF8Bytes>>>) -> u64 {
            let mut ret: u64 = <u64 as Default>::default();
            let mut result: u64 = 0;
            let mut _hi0: u64 = truncate!(pairs.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                result = crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(result, _default::PairLength(&pairs.get(&int!((&i).clone()))));
            }
            ret = result;
            return ret;
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(200,3)
        pub fn PairLength(pair: &Arc<Pair<ValidUTF8Bytes, ValidUTF8Bytes>>) -> u64 {
            crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add4(2, truncate!(pair.key().cardinality(), u64), 2, truncate!(pair.value().cardinality(), u64))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(34,3)
        pub fn ESDK_CANONICAL_ENCRYPTION_CONTEXT_MAX_LENGTH() -> u64 {
            truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT(), u64) - 2
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(16,3)
    pub type ShortUTF8Seq = Sequence<u8>;

    /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(19,3)
    #[derive(PartialEq, Clone)]
    pub enum Pair<K: DafnyType, V: DafnyType> {
        Pair {
            key: K,
            value: V
        }
    }

    impl<K: DafnyType, V: DafnyType> Pair<K, V> {
        /// Returns a borrow of the field key
        pub fn key(&self) -> &K {
            match self {
                Pair::Pair{key, value, } => key,
            }
        }
        /// Returns a borrow of the field value
        pub fn value(&self) -> &V {
            match self {
                Pair::Pair{key, value, } => value,
            }
        }
    }

    impl<K: DafnyType, V: DafnyType> Debug
        for Pair<K, V> {
        fn fmt(&self, f: &mut Formatter) -> Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<K: DafnyType, V: DafnyType> DafnyPrint
        for Pair<K, V> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Pair::Pair{key, value, } => {
                    write!(_formatter, "SerializableTypes_Compile.Pair.Pair(")?;
                    DafnyPrint::fmt_print(key, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(value, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<K: DafnyType + Eq, V: DafnyType + Eq> Eq
        for Pair<K, V> {}

    impl<K: DafnyType + Hash, V: DafnyType + Hash> Hash
        for Pair<K, V> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Pair::Pair{key, value, } => {
                    Hash::hash(key, _state);
                    Hash::hash(value, _state)
                },
            }
        }
    }

    impl<K: DafnyType + Default, V: DafnyType + Default> Default
        for Pair<K, V> {
        fn default() -> Pair<K, V> {
            Pair::Pair {
                key: Default::default(),
                value: Default::default()
            }
        }
    }

    impl<K: DafnyType, V: DafnyType> AsRef<Pair<K, V>>
        for Pair<K, V> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(29,3)
    pub type ESDKEncryptedDataKey = Arc<EncryptedDataKey>;

    /// dafny/AwsEncryptionSdk/src/Serialize/SerializableTypes.dfy(47,3)
    pub type ESDKEncryptionContext = Map<ValidUTF8Bytes, ValidUTF8Bytes>;
}
/// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(6,1)
pub mod _SerializeFunctions_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq32;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq64;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use ::dafny_runtime::DafnyType;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(169,3)
        pub fn Write(data: &Sequence<u8>) -> Sequence<u8> {
            data.clone()
        }
        /// Optional elements in a data structure can be represented with a length of 0 bytes.
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(178,3)
        pub fn Read(buffer: &Arc<ReadableBuffer>, length: u64) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> {
            let mut end: u64 = crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(buffer.start().clone(), length);
            let mut valueOrError0: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(truncate!(buffer.bytes().cardinality(), u64) >= end, &Arc::new(ReadProblems::MoreNeeded {
                            pos: end
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<Sequence<u8>>>>()
            } else {
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<Sequence<u8>>>, Arc<ReadProblems>>::Success {
                        value: Arc::new(SuccessfulRead::<Sequence<u8>>::SuccessfulRead {
                                    data: buffer.bytes().slice(&int!(buffer.start().clone()), &int!((&end).clone())),
                                    tail: {
                                            let __pat_let39_0: Arc<ReadableBuffer> = buffer.clone();
                                            {
                                                let _dt__update__tmp_h0: Arc<ReadableBuffer> = __pat_let39_0.clone();
                                                {
                                                    let __pat_let40_0: u64 = end;
                                                    {
                                                        let _dt__update_hstart_h0: u64 = __pat_let40_0;
                                                        Arc::new(ReadableBuffer::ReadableBuffer {
                                                                bytes: _dt__update__tmp_h0.bytes().clone(),
                                                                start: _dt__update_hstart_h0
                                                            })
                                                    }
                                                }
                                            }
                                        }
                                })
                    })
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(208,3)
        pub fn WriteUint16(number: u16) -> Sequence<u8> {
            _default::Write(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt16ToSeq(number))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(216,3)
        pub fn ReadUInt16(buffer: &Arc<ReadableBuffer>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u16>>, MoreNeeded>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = _default::Read(buffer, 2);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<u16>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut uint16Bytes: Sequence<u8> = __let_tmp_rhs0.data().clone();
                let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<u16>>, MoreNeeded>::Success {
                        value: Arc::new(SuccessfulRead::<u16>::SuccessfulRead {
                                    data: crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt16(&uint16Bytes),
                                    tail: tail.clone()
                                })
                    })
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(227,3)
        pub fn WriteUint32(number: u32) -> Sequence<u8> {
            _default::Write(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(number))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(235,3)
        pub fn ReadUInt32(buffer: &Arc<ReadableBuffer>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u32>>, MoreNeeded>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = _default::Read(buffer, 4);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<u32>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut uint32Bytes: Sequence<u8> = __let_tmp_rhs0.data().clone();
                let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<u32>>, MoreNeeded>::Success {
                        value: Arc::new(SuccessfulRead::<u32>::SuccessfulRead {
                                    data: crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&uint32Bytes),
                                    tail: tail.clone()
                                })
                    })
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(246,3)
        pub fn WriteUint64(number: u64) -> Sequence<u8> {
            _default::Write(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt64ToSeq(number))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(254,3)
        pub fn ReadUInt64(buffer: &Arc<ReadableBuffer>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u64>>, MoreNeeded>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = _default::Read(buffer, 8);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<u64>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut uint64Bytes: Sequence<u8> = __let_tmp_rhs0.data().clone();
                let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<u64>>, MoreNeeded>::Success {
                        value: Arc::new(SuccessfulRead::<u64>::SuccessfulRead {
                                    data: crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt64(&uint64Bytes),
                                    tail: tail.clone()
                                })
                    })
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(265,3)
        pub fn WriteShortLengthSeq(d: &seq16<u8>) -> Sequence<u8> {
            _default::WriteUint16(truncate!(d.cardinality(), u16)).concat(&_default::Write(d))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(274,3)
        pub fn ReadShortLengthSeq(buffer: &Arc<ReadableBuffer>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<seq16<u8>>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u16>>, MoreNeeded>> = _default::ReadUInt16(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<seq16<u8>>>>()
            } else {
                let mut length: Arc<SuccessfulRead<u16>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = _default::Read(length.tail(), length.data().clone() as u64);
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<seq16<u8>>>>()
                } else {
                    let mut d: Arc<SuccessfulRead<seq16<u8>>> = valueOrError1.Extract();
                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<seq16<u8>>>, MoreNeeded>::Success {
                            value: d.clone()
                        })
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(292,3)
        pub fn WriteUint32Seq(d: &seq32<u8>) -> Sequence<u8> {
            _default::WriteUint32(truncate!(d.cardinality(), u32)).concat(&_default::Write(d))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(301,3)
        pub fn ReadUint32Seq(buffer: &Arc<ReadableBuffer>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<seq32<u8>>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u32>>, MoreNeeded>> = _default::ReadUInt32(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<seq32<u8>>>>()
            } else {
                let mut length: Arc<SuccessfulRead<u32>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = _default::Read(length.tail(), length.data().clone() as u64);
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<seq32<u8>>>>()
                } else {
                    let mut d: Arc<SuccessfulRead<seq32<u8>>> = valueOrError1.Extract();
                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<seq32<u8>>>, MoreNeeded>::Success {
                            value: d.clone()
                        })
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(320,3)
        pub fn WriteUint64Seq(d: &seq64<u8>) -> Sequence<u8> {
            _default::WriteUint64(truncate!(d.cardinality(), u64)).concat(&_default::Write(d))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(329,3)
        pub fn ReadUint64Seq(buffer: &Arc<ReadableBuffer>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<seq64<u8>>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<u64>>, MoreNeeded>> = _default::ReadUInt64(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<seq64<u8>>>>()
            } else {
                let mut length: Arc<SuccessfulRead<u64>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = _default::Read(length.tail(), length.data().clone());
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<seq64<u8>>>>()
                } else {
                    let mut d: Arc<SuccessfulRead<seq64<u8>>> = valueOrError1.Extract();
                    Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SuccessfulRead<seq64<u8>>>, MoreNeeded>::Success {
                            value: d.clone()
                        })
                }
            }
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(13,3)
    #[derive(PartialEq, Clone)]
    pub enum ReadProblems {
        MoreNeeded {
            pos: u64
        },
        Error {
            message: Sequence<DafnyCharUTF16>
        }
    }

    impl ReadProblems {
        /// Gets the field pos for all enum members which have it
        pub fn pos(&self) -> &u64 {
            match self {
                ReadProblems::MoreNeeded{pos, } => pos,
                ReadProblems::Error{message, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field message for all enum members which have it
        pub fn message(&self) -> &Sequence<DafnyCharUTF16> {
            match self {
                ReadProblems::MoreNeeded{pos, } => panic!("field does not exist on this variant"),
                ReadProblems::Error{message, } => message,
            }
        }
    }

    impl Debug
        for ReadProblems {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for ReadProblems {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                ReadProblems::MoreNeeded{pos, } => {
                    write!(_formatter, "SerializeFunctions_Compile.ReadProblems.MoreNeeded(")?;
                    DafnyPrint::fmt_print(pos, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
                ReadProblems::Error{message, } => {
                    write!(_formatter, "SerializeFunctions_Compile.ReadProblems.Error(")?;
                    DafnyPrint::fmt_print(message, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for ReadProblems {}

    impl Hash
        for ReadProblems {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                ReadProblems::MoreNeeded{pos, } => {
                    Hash::hash(pos, _state)
                },
                ReadProblems::Error{message, } => {
                    Hash::hash(message, _state)
                },
            }
        }
    }

    impl Default
        for ReadProblems {
        fn default() -> ReadProblems {
            ReadProblems::MoreNeeded {
                pos: Default::default()
            }
        }
    }

    impl AsRef<ReadProblems>
        for ReadProblems {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(25,3)
    pub type MoreNeeded = Arc<ReadProblems>;

    /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(31,3)
    #[derive(PartialEq, Clone)]
    pub enum ReadableBuffer {
        ReadableBuffer {
            bytes: Sequence<u8>,
            start: u64
        }
    }

    impl ReadableBuffer {
        /// Returns a borrow of the field bytes
        pub fn bytes(&self) -> &Sequence<u8> {
            match self {
                ReadableBuffer::ReadableBuffer{bytes, start, } => bytes,
            }
        }
        /// Returns a borrow of the field start
        pub fn start(&self) -> &u64 {
            match self {
                ReadableBuffer::ReadableBuffer{bytes, start, } => start,
            }
        }
    }

    impl Debug
        for ReadableBuffer {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for ReadableBuffer {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                ReadableBuffer::ReadableBuffer{bytes, start, } => {
                    write!(_formatter, "SerializeFunctions_Compile.ReadableBuffer.ReadableBuffer(")?;
                    DafnyPrint::fmt_print(bytes, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(start, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for ReadableBuffer {}

    impl Hash
        for ReadableBuffer {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                ReadableBuffer::ReadableBuffer{bytes, start, } => {
                    Hash::hash(bytes, _state);
                    Hash::hash(start, _state)
                },
            }
        }
    }

    impl Default
        for ReadableBuffer {
        fn default() -> ReadableBuffer {
            ReadableBuffer::ReadableBuffer {
                bytes: Default::default(),
                start: Default::default()
            }
        }
    }

    impl AsRef<ReadableBuffer>
        for ReadableBuffer {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/SerializeFunctions.dfy(39,3)
    #[derive(PartialEq, Clone)]
    pub enum SuccessfulRead<T: DafnyType> {
        SuccessfulRead {
            data: T,
            tail: Arc<ReadableBuffer>
        }
    }

    impl<T: DafnyType> SuccessfulRead<T> {
        /// Returns a borrow of the field data
        pub fn data(&self) -> &T {
            match self {
                SuccessfulRead::SuccessfulRead{data, tail, } => data,
            }
        }
        /// Returns a borrow of the field tail
        pub fn tail(&self) -> &Arc<ReadableBuffer> {
            match self {
                SuccessfulRead::SuccessfulRead{data, tail, } => tail,
            }
        }
    }

    impl<T: DafnyType> Debug
        for SuccessfulRead<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for SuccessfulRead<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                SuccessfulRead::SuccessfulRead{data, tail, } => {
                    write!(_formatter, "SerializeFunctions_Compile.SuccessfulRead.SuccessfulRead(")?;
                    DafnyPrint::fmt_print(data, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(tail, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType + Eq> Eq
        for SuccessfulRead<T> {}

    impl<T: DafnyType + Hash> Hash
        for SuccessfulRead<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                SuccessfulRead::SuccessfulRead{data, tail, } => {
                    Hash::hash(data, _state);
                    Hash::hash(tail, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for SuccessfulRead<T> {
        fn default() -> SuccessfulRead<T> {
            SuccessfulRead::SuccessfulRead {
                data: Default::default(),
                tail: Default::default()
            }
        }
    }

    impl<T: DafnyType> AsRef<SuccessfulRead<T>>
        for SuccessfulRead<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(10,1)
pub mod _SharedHeaderFunctions_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageFormatVersion;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ESDKAlgorithmSuite;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IAwsCryptographicMaterialProvidersClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteId::ESDK;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageId;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::truncate;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(23,3)
        pub fn WriteMessageFormatVersion(version: &Arc<MessageFormatVersion>) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(&version.Serialize())
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(31,3)
        pub fn ReadMessageFormatVersion(buffer: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<Arc<MessageFormatVersion>>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, 1);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<Arc<MessageFormatVersion>>>>()
            } else {
                let mut rawVersion: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<Result<Arc<MessageFormatVersion>, Arc<ReadProblems>>> = MessageFormatVersion::Get(rawVersion.data()).MapFailure::<Arc<ReadProblems>>(&({
                            Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<ReadProblems>{
                                    Arc::new(ReadProblems::Error {
                                            message: e.clone()
                                        })
                                })
                        }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<Arc<MessageFormatVersion>>>>()
                } else {
                    let mut version: Arc<MessageFormatVersion> = valueOrError1.Extract();
                    Arc::new(Result::<Arc<SuccessfulRead<Arc<MessageFormatVersion>>>, Arc<ReadProblems>>::Success {
                            value: Arc::new(SuccessfulRead::<Arc<MessageFormatVersion>>::SuccessfulRead {
                                        data: version.clone(),
                                        tail: rawVersion.tail().clone()
                                    })
                        })
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(43,3)
        pub fn WriteESDKSuiteId(suite: &ESDKAlgorithmSuite) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(suite.binaryId())
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(51,3)
        pub fn ReadESDKSuiteId(buffer: &Arc<ReadableBuffer>, mpl: &Object<MaterialProvidersClient>) -> Arc<Result<Arc<SuccessfulRead<ESDKAlgorithmSuite>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, 2);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<ESDKAlgorithmSuite>>>()
            } else {
                let mut esdkSuiteIdBytes: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<Result<Arc<AlgorithmSuiteInfo>, Arc<ReadProblems>>> = IAwsCryptographicMaterialProvidersClient::GetAlgorithmSuiteInfo(rd!(mpl.clone()), esdkSuiteIdBytes.data()).MapFailure::<Arc<ReadProblems>>(&({
                            Arc::new(move |_v0: &Arc<Error>| -> Arc<ReadProblems>{
                                    Arc::new(ReadProblems::Error {
                                            message: string_utf16_of("Algorithm suite ID not supported.")
                                        })
                                })
                        }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<ESDKAlgorithmSuite>>>()
                } else {
                    let mut suite: Arc<AlgorithmSuiteInfo> = valueOrError1.Extract();
                    let mut valueOrError2: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(suite.binaryId().clone() == esdkSuiteIdBytes.data().clone(), &Arc::new(ReadProblems::Error {
                                    message: string_utf16_of("Algorithm suite ID not supported.")
                                }));
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<SuccessfulRead<ESDKAlgorithmSuite>>>()
                    } else {
                        let mut valueOrError3: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(matches!(suite.id().as_ref(), ESDK{ .. }), &Arc::new(ReadProblems::Error {
                                        message: string_utf16_of("Algorithm suite ID not supported.")
                                    }));
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<SuccessfulRead<ESDKAlgorithmSuite>>>()
                        } else {
                            let mut esdkSuite: ESDKAlgorithmSuite = suite.clone();
                            Arc::new(Result::<Arc<SuccessfulRead<ESDKAlgorithmSuite>>, Arc<ReadProblems>>::Success {
                                    value: Arc::new(SuccessfulRead::<ESDKAlgorithmSuite>::SuccessfulRead {
                                                data: esdkSuite.clone(),
                                                tail: esdkSuiteIdBytes.tail().clone()
                                            })
                                })
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(75,3)
        pub fn WriteMessageId(messageId: &MessageId) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(messageId)
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(83,3)
        pub fn ReadMessageIdV1(buffer: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<MessageId>>, MoreNeeded>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V1());
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<MessageId>>>()
            } else {
                let mut messageIdRead: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut messageId: MessageId = messageIdRead.data().clone();
                Arc::new(Result::<Arc<SuccessfulRead<MessageId>>, MoreNeeded>::Success {
                        value: Arc::new(SuccessfulRead::<MessageId>::SuccessfulRead {
                                    data: messageId.clone(),
                                    tail: messageIdRead.tail().clone()
                                })
                    })
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(95,3)
        pub fn ReadMessageIdV2(buffer: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<MessageId>>, MoreNeeded>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, crate::implementation_from_dafny::_HeaderTypes_Compile::_default::MESSAGE_ID_LEN_V2());
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<MessageId>>>()
            } else {
                let mut messageIdRead: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut messageId: MessageId = messageIdRead.data().clone();
                Arc::new(Result::<Arc<SuccessfulRead<MessageId>>, MoreNeeded>::Success {
                        value: Arc::new(SuccessfulRead::<MessageId>::SuccessfulRead {
                                    data: messageId.clone(),
                                    tail: messageIdRead.tail().clone()
                                })
                    })
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(107,3)
        pub fn WriteContentType(contentType: &Arc<ContentType>) -> Sequence<u8> {
            crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(&seq![contentType.Serialize()])
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/SharedHeaderFunctions.dfy(115,3)
        pub fn ReadContentType(buffer: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<Arc<ContentType>>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, 1);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<Arc<ContentType>>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut raw: Sequence<u8> = __let_tmp_rhs0.data().clone();
                let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                let mut valueOrError1: Arc<Result<Arc<ContentType>, Arc<ReadProblems>>> = ContentType::Get(raw.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))).MapFailure::<Arc<ReadProblems>>(&({
                            Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<ReadProblems>{
                                    Arc::new(ReadProblems::Error {
                                            message: e.clone()
                                        })
                                })
                        }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<Arc<ContentType>>>>()
                } else {
                    let mut contentType: Arc<ContentType> = valueOrError1.Extract();
                    Arc::new(Result::<Arc<SuccessfulRead<Arc<ContentType>>>, Arc<ReadProblems>>::Success {
                            value: Arc::new(SuccessfulRead::<Arc<ContentType>>::SuccessfulRead {
                                        data: contentType.clone(),
                                        tail: tail.clone()
                                    })
                        })
                }
            }
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(6,1)
pub mod Signature {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDSASignatureAlgorithm::ECDSA_P384;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateECDSASignatureKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_dafny_externs::Signature::ECDSA;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::Sequence;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(17,3)
        pub fn SignatureLength(signatureAlgorithm: &Arc<ECDSASignatureAlgorithm>) -> u16 {
            let mut _source0: Arc<ECDSASignatureAlgorithm> = signatureAlgorithm.clone();
            if matches!((&_source0).as_ref(), ECDSA_P384{ .. }) {
                103
            } else {
                71
            }
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(23,3)
        pub fn FieldSize(signatureAlgorithm: &Arc<ECDSASignatureAlgorithm>) -> u64 {
            let mut _source0: Arc<ECDSASignatureAlgorithm> = signatureAlgorithm.clone();
            if matches!((&_source0).as_ref(), ECDSA_P384{ .. }) {
                49
            } else {
                33
            }
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(31,3)
        pub fn KeyGen(input: &Arc<GenerateECDSASignatureKeyInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<Error>>> {
            let mut res = MaybePlacebo::<Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GenerateECDSASignatureKeyOutput>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SignatureKeyPair>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SignatureKeyPair>, Arc<Error>>> = ECDSA::ExternKeyGen(input.signatureAlgorithm());
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Arc<GenerateECDSASignatureKeyOutput>>());
                return res.read();
            };
            let mut sigKeyPair: Arc<SignatureKeyPair> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(sigKeyPair.verificationKey().cardinality(), u64) == _default::FieldSize(input.signatureAlgorithm()), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("Incorrect verification-key length from ExternKeyGen.")
                        }));
            if valueOrError1.IsFailure() {
                res = MaybePlacebo::from(valueOrError1.PropagateFailure::<Arc<GenerateECDSASignatureKeyOutput>>());
                return res.read();
            };
            res = MaybePlacebo::from(Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GenerateECDSASignatureKeyOutput>, Arc<Error>>::Success {
                            value: Arc::new(GenerateECDSASignatureKeyOutput::GenerateECDSASignatureKeyOutput {
                                        signatureAlgorithm: input.signatureAlgorithm().clone(),
                                        verificationKey: sigKeyPair.verificationKey().clone(),
                                        signingKey: sigKeyPair.signingKey().clone()
                                    })
                        }));
            return res.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(93,3)
        pub fn CreateExternKeyGenSuccess(output: &Arc<SignatureKeyPair>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SignatureKeyPair>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SignatureKeyPair>, Arc<Error>>::Success {
                    value: output.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(97,3)
        pub fn CreateExternKeyGenFailure(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<SignatureKeyPair>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<SignatureKeyPair>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(101,3)
        pub fn CreateSignSuccess(bytes: &Sequence<u8>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Success {
                    value: bytes.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(105,3)
        pub fn CreateSignFailure(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<u8>, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<u8>, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(109,3)
        pub fn CreateVerifySuccess(b: bool) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Arc<Error>>::Success {
                    value: b
                })
        }
        /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(113,3)
        pub fn CreateVerifyFailure(error: &Arc<Error>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<bool, Arc<Error>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<bool, Arc<Error>>::Failure {
                    error: error.clone()
                })
        }
    }

    /// ../mpl/AwsCryptographyPrimitives/src/Signature.dfy(13,3)
    #[derive(PartialEq, Clone)]
    pub enum SignatureKeyPair {
        SignatureKeyPair {
            verificationKey: Sequence<u8>,
            signingKey: Sequence<u8>
        }
    }

    impl SignatureKeyPair {
        /// Returns a borrow of the field verificationKey
        pub fn verificationKey(&self) -> &Sequence<u8> {
            match self {
                SignatureKeyPair::SignatureKeyPair{verificationKey, signingKey, } => verificationKey,
            }
        }
        /// Returns a borrow of the field signingKey
        pub fn signingKey(&self) -> &Sequence<u8> {
            match self {
                SignatureKeyPair::SignatureKeyPair{verificationKey, signingKey, } => signingKey,
            }
        }
    }

    impl Debug
        for SignatureKeyPair {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for SignatureKeyPair {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                SignatureKeyPair::SignatureKeyPair{verificationKey, signingKey, } => {
                    write!(_formatter, "Signature.SignatureKeyPair.SignatureKeyPair(")?;
                    DafnyPrint::fmt_print(verificationKey, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(signingKey, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for SignatureKeyPair {}

    impl Hash
        for SignatureKeyPair {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                SignatureKeyPair::SignatureKeyPair{verificationKey, signingKey, } => {
                    Hash::hash(verificationKey, _state);
                    Hash::hash(signingKey, _state)
                },
            }
        }
    }

    impl Default
        for SignatureKeyPair {
        fn default() -> SignatureKeyPair {
            SignatureKeyPair::SignatureKeyPair {
                verificationKey: Default::default(),
                signingKey: Default::default()
            }
        }
    }

    impl AsRef<SignatureKeyPair>
        for SignatureKeyPair {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// ../mpl/StandardLibrary/src/Sets.dfy(7,1)
pub mod SortedSets {
    pub use crate::implementation_from_dafny::_dafny_externs::SortedSets::*;
}
/// ../mpl/StandardLibrary/src/Sorting.dfy(7,1)
pub mod _Sorting_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::_System::nat;
    pub use ::dafny_runtime::DafnyType;
    pub use ::dafny_runtime::Object;
    pub use ::std::sync::Arc;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::DafnyUsize;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/Sorting.dfy(46,3)
        pub fn LexicographicByteSeqBelow(x: &Sequence<u8>, y: &Sequence<u8>) -> bool {
            _default::LexicographicByteSeqBelowAux(x, y, &int!(0))
        }
        /// ../mpl/StandardLibrary/src/Sorting.dfy(50,3)
        pub fn LexicographicByteSeqBelowAux(x: &Sequence<u8>, y: &Sequence<u8>, n: &nat) -> bool {
            n.clone() == x.cardinality() || n.clone() != y.cardinality() && x.get(n) < y.get(n) || n.clone() != y.cardinality() && x.get(n) == y.get(n) && _default::LexicographicByteSeqBelowAux(x, y, &(n.clone() + int!(1)))
        }
        /// ../mpl/StandardLibrary/src/Sorting.dfy(125,3)
        pub fn SelectionSort<_Data: DafnyType>(a: &Object<[_Data]>, below: &Arc<dyn ::std::ops::Fn(&_Data, &_Data) -> bool + Sync + Send>) -> () {
            let mut m: DafnyInt = int!(0);
            while m.clone() < int!(rd!(a.clone()).len()) {
                let mut mindex: DafnyInt;
                let mut n: DafnyInt;
                let mut _rhs0: DafnyInt = m.clone();
                let mut _rhs1: DafnyInt = m.clone() + int!(1);
                mindex = _rhs0.clone();
                n = _rhs1.clone();
                while n.clone() < int!(rd!(a.clone()).len()) {
                    if !below(&rd!(a)[DafnyUsize::into_usize(mindex.clone())].clone(), &rd!(a)[DafnyUsize::into_usize(n.clone())].clone()) {
                        mindex = n.clone();
                    };
                    n = n.clone() + int!(1);
                };
                let mut _rhs2: _Data = rd!(a)[DafnyUsize::into_usize(mindex.clone())].clone();
                let mut _rhs3: _Data = rd!(a)[DafnyUsize::into_usize(m.clone())].clone();
                let mut _lhs0: Object<[_Data]> = a.clone();
                let mut _lhs1: DafnyInt = m.clone();
                let mut _lhs2: Object<[_Data]> = a.clone();
                let mut _lhs3: DafnyInt = mindex.clone();
                {
                    let __idx0 = DafnyUsize::into_usize(_lhs1.clone());
                    ::dafny_runtime::md!(_lhs0)[__idx0] = _rhs2.clone();
                };
                {
                    let __idx0 = DafnyUsize::into_usize(_lhs3.clone());
                    ::dafny_runtime::md!(_lhs2)[__idx0] = _rhs3.clone();
                };
                m = m.clone() + int!(1);
            };
            return ();
        }
    }
}
/// ../mpl/StandardLibrary/src/StandardLibrary.dfy(7,1)
pub mod _StandardLibrary_Compile {
    pub use ::dafny_runtime::DafnyType;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::DafnyTypeEq;
    pub use ::dafny_runtime::seq;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::_System::nat;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::Zero;
    pub use ::dafny_runtime::Object;
    pub use ::std::mem::MaybeUninit;
    pub use ::dafny_runtime::array;
    pub use ::dafny_runtime::DafnyUsize;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::Set;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(17,3)
        pub fn Join<_T: DafnyType>(ss: &Sequence<Sequence<_T>>, joiner: &Sequence<_T>) -> Sequence<_T> {
            let mut s = MaybePlacebo::<Sequence<_T>>::new();
            let mut size: u64 = truncate!(ss.cardinality(), u64);
            let mut result: Sequence<_T> = ss.get(&int!((&(size - 1)).clone()));
            let mut i: u64 = size - 1;
            while 0 < i {
                i = i - 1;
                result = ss.get(&int!((&i).clone())).concat(joiner).concat(&result);
            };
            s = MaybePlacebo::from(result.clone());
            return s.read();
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(37,3)
        pub fn Split<_T: DafnyTypeEq>(s: &Sequence<_T>, delim: &_T) -> Sequence<Sequence<_T>> {
            let mut _accumulator: Sequence<Sequence<_T>> = seq![] as Sequence<Sequence<_T>>;
            let mut _r0 = s.clone();
            let mut _r1 = delim.clone();
            'TAIL_CALL_START: loop {
                let s = _r0;
                let delim = _r1;
                let mut i: Arc<Option<u64>> = _default::FindIndexMatching::<_T>(&s, &delim, 0);
                if matches!((&i).as_ref(), Some{ .. }) {
                    _accumulator = _accumulator.concat(&seq![s.take(&int!(i.value().clone()))]);
                    let mut _in0: Sequence<_T> = s.drop(&int!((&crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(i.value().clone(), 1)).clone()));
                    let mut _in1: _T = delim.clone();
                    _r0 = _in0.clone();
                    _r1 = _in1.clone();
                    continue 'TAIL_CALL_START;
                } else {
                    return _accumulator.concat(&seq![s.clone()]);
                }
            }
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(50,3)
        pub fn SplitOnce<_T: DafnyTypeEq>(s: &Sequence<_T>, delim: &_T) -> (Sequence<_T>, Sequence<_T>) {
            let mut i: Arc<Option<u64>> = _default::FindIndexMatching::<_T>(s, delim, 0);
            (
                s.take(&int!(i.value().clone())),
                s.drop(&int!((&crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(i.value().clone(), 1)).clone()))
            )
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(61,3)
        pub fn _SplitOnce_q<_T: DafnyTypeEq>(s: &Sequence<_T>, delim: &_T) -> Arc<Option<(Sequence<_T>, Sequence<_T>)>> {
            let mut valueOrError0: Arc<Option<u64>> = _default::FindIndexMatching::<_T>(s, delim, 0);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<(Sequence<_T>, Sequence<_T>)>()
            } else {
                let mut i: u64 = valueOrError0.Extract();
                Arc::new(Option::<(Sequence<_T>, Sequence<_T>)>::Some {
                        value: (
                                s.take(&int!((&i).clone())),
                                s.drop(&int!((&crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(i, 1)).clone()))
                            )
                    })
            }
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(111,3)
        pub fn FindIndexMatching<_T: DafnyTypeEq>(s: &Sequence<_T>, c: &_T, i: u64) -> Arc<Option<u64>> {
            _default::FindIndex::<_T>(s, {
                    let c: _T = c.clone();
                    &({
                        let mut c = c.clone();
                        Arc::new(move |x: &_T| -> bool{
                                x.clone() == c.clone()
                            })
                    })
                }, i)
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(120,3)
        pub fn FindIndex<_T: DafnyType>(s: &Sequence<_T>, f: &Arc<dyn ::std::ops::Fn(&_T) -> bool + Sync + Send>, i: u64) -> Arc<Option<u64>> {
            let mut _r0 = s.clone();
            let mut _r1 = f.clone();
            let mut _r2 = i;
            'TAIL_CALL_START: loop {
                let s = _r0;
                let f = _r1;
                let i = _r2;
                if i == truncate!(s.cardinality(), u64) {
                    return Arc::new(Option::<u64>::None {});
                } else {
                    if (&f)(&s.get(&int!((&i).clone()))) {
                        return Arc::new(Option::<u64>::Some {
                                    value: i
                                });
                    } else {
                        let mut _in0: Sequence<_T> = s.clone();
                        let mut _in1: Arc<dyn ::std::ops::Fn(&_T) -> bool + Sync + Send> = f.clone();
                        let mut _in2: u64 = i + 1;
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        _r2 = _in2;
                        continue 'TAIL_CALL_START;
                    }
                }
            }
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(132,3)
        pub fn Filter<_T: DafnyType>(s: &Sequence<_T>, f: &Arc<dyn ::std::ops::Fn(&_T) -> bool + Sync + Send>) -> Sequence<_T> {
            let mut res = MaybePlacebo::<Sequence<_T>>::new();
            let mut result: Sequence<_T> = seq![] as Sequence<_T>;
            let mut i: u64 = truncate!(s.cardinality(), u64);
            while 0 < i {
                i = i - 1;
                if f(&s.get(&int!((&i).clone()))) {
                    result = seq![s.get(&int!((&i).clone()))].concat(&result);
                }
            };
            res = MaybePlacebo::from(result.clone());
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(183,3)
        pub fn Min(a: &DafnyInt, b: &DafnyInt) -> DafnyInt {
            if a.clone() < b.clone() {
                a.clone()
            } else {
                b.clone()
            }
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(188,3)
        pub fn Fill<_T: DafnyType>(value: &_T, n: &nat) -> Sequence<_T> {
            {
                let _initializer = {
                        let value: _T = value.clone();
                        {
                            let mut value = value.clone();
                            Arc::new(move |_v0: &DafnyInt| -> _T{
                                    value.clone()
                                })
                        }
                    };
                integer_range(Zero::zero(), n.clone()).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
            }
        }
        /// "Fresh" expressions require editing memory
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(195,3)
        pub fn SeqToArray<_T: DafnyType>(s: &Sequence<_T>) -> Object<[_T]> {
            let mut a = MaybePlacebo::<Object<[_T]>>::new();
            let mut _init0: Arc<dyn ::std::ops::Fn(&DafnyInt) -> _T + Sync + Send> = {
                    let s: Sequence<_T> = s.clone();
                    {
                        let mut s = s.clone();
                        Arc::new(move |i: &DafnyInt| -> _T{
                                s.get(i)
                            })
                    }
                };
            let mut _nw0: Object<[MaybeUninit<_T>]> = array::placebos_usize_object::<_T>(DafnyUsize::into_usize(s.cardinality()));
            for __i0_0 in integer_range(0, rd!(_nw0.clone()).len()) {
                {
                    let __idx0 = DafnyUsize::into_usize(__i0_0.clone());
                    ::dafny_runtime::md!(_nw0)[__idx0] = MaybeUninit::new((&_init0)(&int!(__i0_0.clone())));
                }
            }
            a = MaybePlacebo::from(array::construct_object(_nw0.clone()));
            return a.read();
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(226,3)
        pub fn LexicographicLessOrEqual<_T: DafnyTypeEq>(a: &Sequence<_T>, b: &Sequence<_T>, less: &Arc<dyn ::std::ops::Fn(&_T, &_T) -> bool + Sync + Send>) -> bool {
            integer_range(int!(0), a.cardinality() + int!(1)).any(({
                    let mut a = a.clone();
                    let mut b = b.clone();
                    let mut less = less.clone();
                    Arc::new(move |__exists_var_0: DafnyInt| -> bool{
                            let mut k: DafnyInt = __exists_var_0.clone();
                            int!(0) <= k.clone() && k.clone() <= a.cardinality() && _default::LexicographicLessOrEqualAux::<_T>(&a, &b, &less, &k)
                        })
                }).as_ref())
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(230,3)
        pub fn LexicographicLessOrEqualAux<_T: DafnyTypeEq>(a: &Sequence<_T>, b: &Sequence<_T>, less: &Arc<dyn ::std::ops::Fn(&_T, &_T) -> bool + Sync + Send>, lengthOfCommonPrefix: &nat) -> bool {
            lengthOfCommonPrefix.clone() <= b.cardinality() && integer_range(int!(0), lengthOfCommonPrefix.clone()).all(({
                    let mut lengthOfCommonPrefix = lengthOfCommonPrefix.clone();
                    let mut a = a.clone();
                    let mut b = b.clone();
                    Arc::new(move |__forall_var_0: DafnyInt| -> bool{
                            let mut i: DafnyInt = __forall_var_0.clone();
                            !(int!(0) <= i.clone() && i.clone() < lengthOfCommonPrefix.clone()) || a.get(&i) == b.get(&i)
                        })
                }).as_ref()) && (lengthOfCommonPrefix.clone() == a.cardinality() || lengthOfCommonPrefix.clone() < b.cardinality() && less(&a.get(lengthOfCommonPrefix), &b.get(lengthOfCommonPrefix)))
        }
        /// ../mpl/StandardLibrary/src/StandardLibrary.dfy(409,3)
        pub fn IsMinimum<_T: DafnyTypeEq>(a: &Sequence<_T>, s: &Set<Sequence<_T>>, less: &Arc<dyn ::std::ops::Fn(&_T, &_T) -> bool + Sync + Send>) -> bool {
            s.contains(a) && s.iter().all(({
                    let mut a = a.clone();
                    let mut s = s.clone();
                    let mut less = less.clone();
                    Arc::new(move |__forall_var_0: &Sequence<_T>| -> bool{
                            let mut z: Sequence<_T> = __forall_var_0.clone();
                            !s.contains(&z) || _default::LexicographicLessOrEqual::<_T>(&a, &z, &less)
                        })
                }).as_ref())
        }
    }

    /// ../mpl/StandardLibrary/src/MemoryMath.dfy(12,1)
    pub mod _MemoryMath_Compile {
        pub struct _default {}

        impl _default {
            /// ../mpl/StandardLibrary/src/MemoryMath.dfy(60,3)
            pub fn Add(x: u64, y: u64) -> u64 {
                x + y
            }
            /// ../mpl/StandardLibrary/src/MemoryMath.dfy(67,3)
            pub fn Add3(x: u64, y: u64, z: u64) -> u64 {
                x + y + z
            }
            /// ../mpl/StandardLibrary/src/MemoryMath.dfy(74,3)
            pub fn Add4(w: u64, x: u64, y: u64, z: u64) -> u64 {
                w + x + y + z
            }
        }
    }

    /// ../mpl/StandardLibrary/src/Sequence.dfy(7,1)
    pub mod _Sequence_Compile {
        pub use ::dafny_runtime::DafnyType;
        pub use ::std::sync::Arc;
        pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
        pub use ::std::marker::Sync;
        pub use ::std::marker::Send;
        pub use ::dafny_runtime::Sequence;
        pub use ::dafny_runtime::truncate;
        pub use ::dafny_runtime::int;
        pub use ::dafny_runtime::seq;
        pub use ::dafny_runtime::DafnyTypeEq;
        pub use ::dafny_runtime::_System::nat;
        pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq64;
        pub use ::std::default::Default;
        pub use ::dafny_runtime::integer_range;
        pub use ::std::convert::Into;

        pub struct _default {}

        impl _default {
            /// ../mpl/StandardLibrary/src/Sequence.dfy(14,3)
            pub fn MapWithResult<_T: DafnyType, _R: DafnyType, _E: DafnyType>(f: &Arc<dyn ::std::ops::Fn(&_T) -> Arc<Result<_R, _E>> + Sync + Send>, xs: &Sequence<_T>, pos: u64, acc: &Sequence<_R>) -> Arc<Result<Sequence<_R>, _E>> {
                let mut _r0 = f.clone();
                let mut _r1 = xs.clone();
                let mut _r2 = pos;
                let mut _r3 = acc.clone();
                'TAIL_CALL_START: loop {
                    let f = _r0;
                    let xs = _r1;
                    let pos = _r2;
                    let acc = _r3;
                    if truncate!(xs.cardinality(), u64) == pos {
                        return Arc::new(Result::<Sequence<_R>, _E>::Success {
                                    value: acc.clone()
                                });
                    } else {
                        let mut valueOrError0: Arc<Result<_R, _E>> = (&f)(&xs.get(&int!((&pos).clone())));
                        if valueOrError0.IsFailure() {
                            return valueOrError0.PropagateFailure::<Sequence<_R>>();
                        } else {
                            let mut head: _R = valueOrError0.Extract();
                            let mut _in0: Arc<dyn ::std::ops::Fn(&_T) -> Arc<Result<_R, _E>> + Sync + Send> = f.clone();
                            let mut _in1: Sequence<_T> = xs.clone();
                            let mut _in2: u64 = pos + truncate!(int!(1), u64);
                            let mut _in3: Sequence<_R> = acc.concat(&seq![head.clone()]);
                            _r0 = _in0.clone();
                            _r1 = _in1.clone();
                            _r2 = _in2;
                            _r3 = _in3.clone();
                            continue 'TAIL_CALL_START;
                        }
                    }
                }
            }
            /// ../mpl/StandardLibrary/src/Sequence.dfy(42,3)
            pub fn Flatten<_T: DafnyType>(xs: &Sequence<Sequence<_T>>, pos: u64, acc: &Sequence<_T>) -> Sequence<_T> {
                let mut _r0 = xs.clone();
                let mut _r1 = pos;
                let mut _r2 = acc.clone();
                'TAIL_CALL_START: loop {
                    let xs = _r0;
                    let pos = _r1;
                    let acc = _r2;
                    if truncate!(xs.cardinality(), u64) == pos {
                        return acc.clone();
                    } else {
                        let mut _in0: Sequence<Sequence<_T>> = xs.clone();
                        let mut _in1: u64 = pos + truncate!(int!(1), u64);
                        let mut _in2: Sequence<_T> = acc.concat(&xs.get(&int!((&pos).clone())));
                        _r0 = _in0.clone();
                        _r1 = _in1;
                        _r2 = _in2.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
            /// ../mpl/StandardLibrary/src/Sequence.dfy(53,3)
            pub fn SequenceEqualNat<_T: DafnyTypeEq>(seq1: &Sequence<_T>, seq2: &Sequence<_T>, start1: &nat, start2: &nat, size: &nat) -> bool {
                crate::implementation_from_dafny::_StandardLibrary_Compile::_Sequence_Compile::_default::SequenceEqual::<_T>(seq1, seq2, truncate!(start1.clone(), u64), truncate!(start2.clone(), u64), truncate!(size.clone(), u64))
            }
            /// ../mpl/StandardLibrary/src/Sequence.dfy(63,3)
            pub fn SequenceEqual<_T: DafnyTypeEq>(seq1: &seq64<_T>, seq2: &seq64<_T>, start1: u64, start2: u64, size: u64) -> bool {
                let mut ret: bool = <bool as Default>::default();
                let mut j: u64 = start2;
                let mut _hi0: u64 = start1 + size;
                for i in integer_range(start1, _hi0).map(Into::<u64>::into) {
                    if !(seq1.get(&int!((&i).clone())) == seq2.get(&int!((&j).clone()))) {
                        ret = false;
                        return ret;
                    };
                    j = j + truncate!(int!(1), u64);
                }
                ret = true;
                return ret;
            }
        }
    }

    /// ../mpl/StandardLibrary/src/String.dfy(6,1)
    pub mod _String_Compile {
        pub use ::dafny_runtime::DafnyInt;
        pub use ::dafny_runtime::Sequence;
        pub use ::dafny_runtime::seq;
        pub use ::dafny_runtime::int;
        pub use ::dafny_runtime::euclidian_modulo;
        pub use ::dafny_runtime::euclidian_division;
        pub use ::dafny_runtime::DafnyCharUTF16;
        pub use ::dafny_runtime::string_utf16_of;
        pub use ::dafny_runtime::DafnyTypeEq;
        pub use ::std::sync::Arc;
        pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
        pub use ::dafny_runtime::truncate;
        pub use ::std::default::Default;
        pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
        pub use ::dafny_runtime::MaybePlacebo;
        pub use ::dafny_runtime::_System::nat;
        pub use ::dafny_runtime::integer_range;
        pub use ::std::convert::Into;

        pub struct _default {}

        impl _default {
            /// ../mpl/StandardLibrary/src/String.dfy(17,3)
            pub fn Int2Digits(n: &DafnyInt, base: &DafnyInt) -> Sequence<DafnyInt> {
                let mut _accumulator: Sequence<DafnyInt> = seq![] as Sequence<DafnyInt>;
                let mut _r0 = n.clone();
                let mut _r1 = base.clone();
                'TAIL_CALL_START: loop {
                    let n = _r0;
                    let base = _r1;
                    if n.clone() == int!(0) {
                        return (seq![] as Sequence<DafnyInt>).concat(&_accumulator);
                    } else {
                        _accumulator = seq![euclidian_modulo(n.clone(), base.clone())].concat(&_accumulator);
                        let mut _in0: DafnyInt = euclidian_division(n.clone(), base.clone());
                        let mut _in1: DafnyInt = base.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
            /// ../mpl/StandardLibrary/src/String.dfy(33,3)
            pub fn Digits2String(digits: &Sequence<DafnyInt>, chars: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
                let mut _accumulator: Sequence<DafnyCharUTF16> = seq![] as Sequence<DafnyCharUTF16>;
                let mut _r0 = digits.clone();
                let mut _r1 = chars.clone();
                'TAIL_CALL_START: loop {
                    let digits = _r0;
                    let chars = _r1;
                    if digits.clone().to_array().len() == 0 {
                        return _accumulator.concat(&string_utf16_of(""));
                    } else {
                        _accumulator = _accumulator.concat(&seq![chars.get(&digits.get(&int!(0)))]);
                        let mut _in0: Sequence<DafnyInt> = digits.drop(&int!(1));
                        let mut _in1: Sequence<DafnyCharUTF16> = chars.clone();
                        _r0 = _in0.clone();
                        _r1 = _in1.clone();
                        continue 'TAIL_CALL_START;
                    }
                }
            }
            /// ../mpl/StandardLibrary/src/String.dfy(43,3)
            pub fn Int2String(n: &DafnyInt, chars: &Sequence<DafnyCharUTF16>) -> Sequence<DafnyCharUTF16> {
                let mut base: DafnyInt = chars.cardinality();
                if n.clone() == int!(0) {
                    string_utf16_of("0")
                } else {
                    if int!(0) < n.clone() {
                        crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Digits2String(&crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Int2Digits(n, &base), chars)
                    } else {
                        string_utf16_of("-").concat(&crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Digits2String(&crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Int2Digits(&(int!(0) - n.clone()), &base), chars))
                    }
                }
            }
            /// ../mpl/StandardLibrary/src/String.dfy(55,3)
            pub fn Base10Int2String(n: &DafnyInt) -> Sequence<DafnyCharUTF16> {
                crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Int2String(n, &crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10())
            }
            /// ../mpl/StandardLibrary/src/String.dfy(62,3)
            pub fn SearchAndReplace<_T: DafnyTypeEq>(source: &Sequence<_T>, old_str: &Sequence<_T>, new_str: &Sequence<_T>) -> Sequence<_T> {
                let mut o: Sequence<_T>;
                let mut x: (Sequence<_T>, Arc<Option<u64>>);
                let mut _out0: (Sequence<_T>, Arc<Option<u64>>);
                _out0 = crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::SearchAndReplacePos::<_T>(source, old_str, new_str, truncate!(int!(0), u64));
                x = _out0.clone();
                o = x.0.clone();
                return o.clone();
            }
            /// ../mpl/StandardLibrary/src/String.dfy(73,3)
            pub fn SearchAndReplacePos<_T: DafnyTypeEq>(source: &Sequence<_T>, old_str: &Sequence<_T>, new_str: &Sequence<_T>, pos: u64) -> (Sequence<_T>, Arc<Option<u64>>) {
                let mut o: (Sequence<_T>, Arc<Option<u64>>) = (
                        <Sequence<_T> as Default>::default(),
                        <Arc<Option<u64>> as Default>::default()
                    );
                let mut old_pos: Arc<Option<u64>>;
                let mut _out0: Arc<Option<u64>>;
                _out0 = crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::HasSubStringPos::<_T>(source, old_str, pos);
                old_pos = _out0.clone();
                if matches!((&old_pos).as_ref(), None{ .. }) {
                    o = (
                            source.clone(),
                            Arc::new(Option::<u64>::None {})
                        );
                    return o.clone();
                } else {
                    let mut source_len: u64 = truncate!(source.cardinality(), u64);
                    let mut old_str_len: u64 = truncate!(old_str.cardinality(), u64);
                    let mut new_str_len: u64 = truncate!(new_str.cardinality(), u64);
                    o = (
                            source.take(&int!(old_pos.value().clone())).concat(new_str).concat(&source.drop(&int!((&(old_pos.value().clone() + old_str_len)).clone()))),
                            Arc::new(Option::<u64>::Some {
                                    value: crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(old_pos.value().clone(), new_str_len)
                                })
                        );
                    o = o.clone();
                    return o.clone();
                };
                return o.clone();
            }
            /// ../mpl/StandardLibrary/src/String.dfy(96,3)
            pub fn BadStart<_T: DafnyTypeEq>(source: &Sequence<_T>, pos: u64, chars: &Sequence<_T>) -> bool {
                if pos == truncate!(int!(0), u64) {
                    false
                } else {
                    chars.contains(&source.get(&int!((&(pos - truncate!(int!(1), u64))).clone())))
                }
            }
            /// ../mpl/StandardLibrary/src/String.dfy(105,3)
            pub fn BadEnd<_T: DafnyTypeEq>(source: &Sequence<_T>, pos: u64, match_len: u64, chars: &Sequence<_T>) -> bool {
                let mut source_len: u64 = truncate!(source.cardinality(), u64);
                if !(crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(pos, match_len) < source_len) {
                    false
                } else {
                    chars.contains(&source.get(&int!((&(pos + match_len)).clone())))
                }
            }
            /// ../mpl/StandardLibrary/src/String.dfy(114,3)
            pub fn BadMatch<_T: DafnyTypeEq>(source: &Sequence<_T>, pos: u64, match_len: u64, chars: &Sequence<_T>) -> bool {
                crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::BadStart::<_T>(source, pos, chars) || crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::BadEnd::<_T>(source, pos, match_len, chars)
            }
            /// ../mpl/StandardLibrary/src/String.dfy(127,3)
            pub fn SearchAndReplacePosWhole<_T: DafnyTypeEq>(source: &Sequence<_T>, old_str: &Sequence<_T>, new_str: &Sequence<_T>, xpos: u64, chars: &Sequence<_T>) -> (Sequence<_T>, Arc<Option<u64>>) {
                let mut o: (Sequence<_T>, Arc<Option<u64>>) = (
                        <Sequence<_T> as Default>::default(),
                        <Arc<Option<u64>> as Default>::default()
                    );
                let mut old_str_len: u64 = truncate!(old_str.cardinality(), u64);
                let mut pos: u64 = xpos;
                while pos < truncate!(source.cardinality(), u64) {
                    let mut old_pos: Arc<Option<u64>>;
                    let mut _out0: Arc<Option<u64>>;
                    _out0 = crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::HasSubStringPos::<_T>(source, old_str, pos);
                    old_pos = _out0.clone();
                    if matches!((&old_pos).as_ref(), None{ .. }) {
                        o = (
                                source.clone(),
                                Arc::new(Option::<u64>::None {})
                            );
                        return o.clone();
                    } else {
                        if crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::BadMatch::<_T>(source, old_pos.value().clone(), old_str_len, chars) {
                            pos = old_pos.value().clone() + truncate!(int!(1), u64);
                        } else {
                            let mut source_len: u64 = truncate!(source.cardinality(), u64);
                            let mut new_str_len: u64 = truncate!(new_str.cardinality(), u64);
                            o = (
                                    source.take(&int!(old_pos.value().clone())).concat(new_str).concat(&source.drop(&int!((&(old_pos.value().clone() + old_str_len)).clone()))),
                                    Arc::new(Option::<u64>::Some {
                                            value: crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(old_pos.value().clone(), new_str_len)
                                        })
                                );
                            o = o.clone();
                            return o.clone();
                        }
                    }
                };
                o = (
                        source.clone(),
                        Arc::new(Option::<u64>::None {})
                    );
                return o.clone();
            }
            /// ../mpl/StandardLibrary/src/String.dfy(162,3)
            pub fn SearchAndReplaceWhole<_T: DafnyTypeEq>(source: &Sequence<_T>, old_str: &Sequence<_T>, new_str: &Sequence<_T>, chars: &Sequence<_T>) -> (Sequence<_T>, Arc<Option<u64>>) {
                let mut o: (Sequence<_T>, Arc<Option<u64>>) = (
                        <Sequence<_T> as Default>::default(),
                        <Arc<Option<u64>> as Default>::default()
                    );
                let mut _out0: (Sequence<_T>, Arc<Option<u64>>);
                _out0 = crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::SearchAndReplacePosWhole::<_T>(source, old_str, new_str, truncate!(int!(0), u64), chars);
                o = _out0.clone();
                return o.clone();
            }
            /// ../mpl/StandardLibrary/src/String.dfy(174,3)
            pub fn SearchAndReplaceAll<_T: DafnyTypeEq>(source_in: &Sequence<_T>, old_str: &Sequence<_T>, new_str: &Sequence<_T>) -> Sequence<_T> {
                let mut o = MaybePlacebo::<Sequence<_T>>::new();
                let mut pos: u64 = truncate!(int!(0), u64);
                let mut source: Sequence<_T> = source_in.clone();
                while true {
                    let mut res: (Sequence<_T>, Arc<Option<u64>>);
                    let mut _out0: (Sequence<_T>, Arc<Option<u64>>);
                    _out0 = crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::SearchAndReplacePos::<_T>(&source, old_str, new_str, pos);
                    res = _out0.clone();
                    if matches!((&res.1.clone()).as_ref(), None{ .. }) {
                        pos = truncate!(source.cardinality(), u64);
                        o = MaybePlacebo::from(res.0.clone());
                        return o.read();
                    };
                    source = res.0.clone();
                    pos = res.1.clone().value().clone();
                };
                return o.read();
            }
            /// ../mpl/StandardLibrary/src/String.dfy(199,3)
            pub fn SearchAndReplaceAllWhole<_T: DafnyTypeEq>(source_in: &Sequence<_T>, old_str: &Sequence<_T>, new_str: &Sequence<_T>, chars: &Sequence<_T>) -> Sequence<_T> {
                let mut o = MaybePlacebo::<Sequence<_T>>::new();
                let mut pos: u64 = truncate!(int!(0), u64);
                let mut source: Sequence<_T> = source_in.clone();
                while true {
                    let mut res: (Sequence<_T>, Arc<Option<u64>>);
                    let mut _out0: (Sequence<_T>, Arc<Option<u64>>);
                    _out0 = crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::SearchAndReplacePosWhole::<_T>(&source, old_str, new_str, pos, chars);
                    res = _out0.clone();
                    if matches!((&res.1.clone()).as_ref(), None{ .. }) {
                        pos = truncate!(source.cardinality(), u64);
                        o = MaybePlacebo::from(res.0.clone());
                        return o.read();
                    };
                    source = res.0.clone();
                    pos = res.1.clone().value().clone();
                };
                return o.read();
            }
            /// ../mpl/StandardLibrary/src/String.dfy(222,3)
            pub fn HasSubString<_T: DafnyTypeEq>(haystack: &Sequence<_T>, needle: &Sequence<_T>) -> Arc<Option<nat>> {
                let mut o = MaybePlacebo::<Arc<Option<nat>>>::new();
                if truncate!(haystack.cardinality(), u64) < truncate!(needle.cardinality(), u64) {
                    o = MaybePlacebo::from(Arc::new(Option::<nat>::None {}));
                    return o.read();
                };
                let mut size: u64 = truncate!(needle.cardinality(), u64);
                let mut limit: u64 = crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(truncate!(haystack.cardinality(), u64) - size, truncate!(int!(1), u64));
                let mut _hi0: u64 = limit;
                for index in integer_range(truncate!(int!(0), u64), _hi0).map(Into::<u64>::into) {
                    if crate::implementation_from_dafny::_StandardLibrary_Compile::_Sequence_Compile::_default::SequenceEqual::<_T>(haystack, needle, index, truncate!(int!(0), u64), size) {
                        o = MaybePlacebo::from(Arc::new(Option::<nat>::Some {
                                        value: int!(index)
                                    }));
                        return o.read();
                    }
                }
                o = MaybePlacebo::from(Arc::new(Option::<nat>::None {}));
                return o.read();
            }
            /// ../mpl/StandardLibrary/src/String.dfy(254,3)
            pub fn HasSubStringPos<_T: DafnyTypeEq>(haystack: &Sequence<_T>, needle: &Sequence<_T>, pos: u64) -> Arc<Option<u64>> {
                let mut o = MaybePlacebo::<Arc<Option<u64>>>::new();
                if truncate!(haystack.cardinality(), u64) - pos < truncate!(needle.cardinality(), u64) {
                    o = MaybePlacebo::from(Arc::new(Option::<u64>::None {}));
                    return o.read();
                };
                let mut size: u64 = truncate!(needle.cardinality(), u64);
                let mut limit: u64 = crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(truncate!(haystack.cardinality(), u64) - size, truncate!(int!(1), u64));
                let mut _hi0: u64 = limit;
                for index in integer_range(pos, _hi0).map(Into::<u64>::into) {
                    if crate::implementation_from_dafny::_StandardLibrary_Compile::_Sequence_Compile::_default::SequenceEqual::<_T>(haystack, needle, index, truncate!(int!(0), u64), size) {
                        o = MaybePlacebo::from(Arc::new(Option::<u64>::Some {
                                        value: index
                                    }));
                        return o.read();
                    }
                }
                o = MaybePlacebo::from(Arc::new(Option::<u64>::None {}));
                return o.read();
            }
            /// ../mpl/StandardLibrary/src/String.dfy(15,3)
            pub fn Base10() -> Sequence<DafnyCharUTF16> {
                seq![DafnyCharUTF16(48 as u16), DafnyCharUTF16(49 as u16), DafnyCharUTF16(50 as u16), DafnyCharUTF16(51 as u16), DafnyCharUTF16(52 as u16), DafnyCharUTF16(53 as u16), DafnyCharUTF16(54 as u16), DafnyCharUTF16(55 as u16), DafnyCharUTF16(56 as u16), DafnyCharUTF16(57 as u16)]
            }
            /// ../mpl/StandardLibrary/src/String.dfy(120,3)
            pub fn AlphaNumeric() -> Sequence<DafnyCharUTF16> {
                string_utf16_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
            }
            /// ../mpl/StandardLibrary/src/String.dfy(121,3)
            pub fn AlphaNumericUnder() -> Sequence<DafnyCharUTF16> {
                string_utf16_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")
            }
        }
    }

    /// ../mpl/StandardLibrary/src/UInt.dfy(5,1)
    pub mod _UInt_Compile {
        pub use ::dafny_runtime::DafnyType;
        pub use ::dafny_runtime::Sequence;
        pub use ::dafny_runtime::_System::nat;
        pub use ::dafny_runtime::truncate;
        pub use ::dafny_runtime::int;
        pub use ::dafny_runtime::seq;
        pub use ::dafny_runtime::DafnyInt;

        pub struct _default {}

        impl _default {
            /// ../mpl/StandardLibrary/src/UInt.dfy(21,3)
            pub fn UInt8Less(a: u8, b: u8) -> bool {
                a < b
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(23,3)
            pub fn HasUint16Len<_T: DafnyType>(s: &Sequence<_T>) -> bool {
                s.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT()
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(30,3)
            pub fn HasUint32Len<_T: DafnyType>(s: &Sequence<_T>) -> bool {
                s.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT32_LIMIT()
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(37,3)
            pub fn HasUint64Len<_T: DafnyType>(s: &Sequence<_T>) -> bool {
                s.cardinality() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT64_LIMIT()
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(44,3)
            pub fn HasUint16Size(s: &nat) -> bool {
                s.clone() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT16_LIMIT()
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(47,3)
            pub fn HasUint32Size(s: &nat) -> bool {
                s.clone() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT32_LIMIT()
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(50,3)
            pub fn HasUint64Size(s: &nat) -> bool {
                s.clone() < crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UINT64_LIMIT()
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(54,3)
            pub fn UInt16ToSeq(x: u16) -> Sequence<u8> {
                let mut b0: u8 = (x / truncate!(int!(256), u16)) as u8;
                let mut b1: u8 = (x % truncate!(int!(256), u16)) as u8;
                seq![b0, b1]
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(63,3)
            pub fn SeqToUInt16(s: &Sequence<u8>) -> u16 {
                let mut x0: u16 = s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) as u16 * truncate!(int!(256), u16);
                x0 + s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) as u16
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(72,3)
            pub fn SeqPosToUInt16(s: &Sequence<u8>, pos: u64) -> u16 {
                let mut x0: u16 = s.get(&int!((&pos).clone())) as u16 * truncate!(int!(256), u16);
                x0 + s.get(&int!((&(pos + truncate!(int!(1), u64))).clone())) as u16
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(82,3)
            pub fn SeqPosToUInt32(s: &Sequence<u8>, pos: u64) -> u32 {
                let mut x0: u32 = s.get(&int!((&pos).clone())) as u32 * truncate!(int!(b"16777216"), u32);
                let mut x1: u32 = x0 + s.get(&int!((&(pos + truncate!(int!(1), u64))).clone())) as u32 * truncate!(int!(b"65536"), u32);
                let mut x2: u32 = x1 + s.get(&int!((&(pos + truncate!(int!(2), u64))).clone())) as u32 * truncate!(int!(256), u32);
                x2 + s.get(&int!((&(pos + truncate!(int!(3), u64))).clone())) as u32
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(93,3)
            pub fn SeqPosToUInt64(s: &Sequence<u8>, pos: u64) -> u64 {
                let mut x0: u64 = s.get(&int!((&pos).clone())) as u64 * truncate!(int!(b"72057594037927936"), u64);
                let mut x1: u64 = x0 + s.get(&int!((&(pos + truncate!(int!(1), u64))).clone())) as u64 * truncate!(int!(b"281474976710656"), u64);
                let mut x2: u64 = x1 + s.get(&int!((&(pos + truncate!(int!(2), u64))).clone())) as u64 * truncate!(int!(b"1099511627776"), u64);
                let mut x3: u64 = x2 + s.get(&int!((&(pos + truncate!(int!(3), u64))).clone())) as u64 * truncate!(int!(b"4294967296"), u64);
                let mut x4: u64 = x3 + s.get(&int!((&(pos + truncate!(int!(4), u64))).clone())) as u64 * truncate!(int!(b"16777216"), u64);
                let mut x5: u64 = x4 + s.get(&int!((&(pos + truncate!(int!(5), u64))).clone())) as u64 * truncate!(int!(b"65536"), u64);
                let mut x6: u64 = x5 + s.get(&int!((&(pos + truncate!(int!(6), u64))).clone())) as u64 * truncate!(int!(256), u64);
                let mut x: u64 = x6 + s.get(&int!((&(pos + truncate!(int!(7), u64))).clone())) as u64;
                x
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(140,3)
            pub fn UInt32ToSeq(x: u32) -> Sequence<u8> {
                let mut b0: u8 = (x / truncate!(int!(b"16777216"), u32)) as u8;
                let mut x0: u32 = x - b0 as u32 * truncate!(int!(b"16777216"), u32);
                let mut b1: u8 = (x0 / truncate!(int!(b"65536"), u32)) as u8;
                let mut x1: u32 = x0 - b1 as u32 * truncate!(int!(b"65536"), u32);
                let mut b2: u8 = (x1 / truncate!(int!(256), u32)) as u8;
                let mut b3: u8 = (x1 % truncate!(int!(256), u32)) as u8;
                seq![b0, b1, b2, b3]
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(155,3)
            pub fn SeqToUInt32(s: &Sequence<u8>) -> u32 {
                let mut x0: u32 = s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) as u32 * truncate!(int!(b"16777216"), u32);
                let mut x1: u32 = x0 + s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) as u32 * truncate!(int!(b"65536"), u32);
                let mut x2: u32 = x1 + s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) as u32 * truncate!(int!(256), u32);
                x2 + s.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) as u32
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(174,3)
            pub fn UInt64ToSeq(x: u64) -> Sequence<u8> {
                let mut b0: u8 = (x / truncate!(int!(b"72057594037927936"), u64)) as u8;
                let mut x0: u64 = x - b0 as u64 * truncate!(int!(b"72057594037927936"), u64);
                let mut b1: u8 = (x0 / truncate!(int!(b"281474976710656"), u64)) as u8;
                let mut x1: u64 = x0 - b1 as u64 * truncate!(int!(b"281474976710656"), u64);
                let mut b2: u8 = (x1 / truncate!(int!(b"1099511627776"), u64)) as u8;
                let mut x2: u64 = x1 - b2 as u64 * truncate!(int!(b"1099511627776"), u64);
                let mut b3: u8 = (x2 / truncate!(int!(b"4294967296"), u64)) as u8;
                let mut x3: u64 = x2 - b3 as u64 * truncate!(int!(b"4294967296"), u64);
                let mut b4: u8 = (x3 / truncate!(int!(b"16777216"), u64)) as u8;
                let mut x4: u64 = x3 - b4 as u64 * truncate!(int!(b"16777216"), u64);
                let mut b5: u8 = (x4 / truncate!(int!(b"65536"), u64)) as u8;
                let mut x5: u64 = x4 - b5 as u64 * truncate!(int!(b"65536"), u64);
                let mut b6: u8 = (x5 / truncate!(int!(256), u64)) as u8;
                let mut b7: u8 = (x5 % truncate!(int!(256), u64)) as u8;
                seq![b0, b1, b2, b3, b4, b5, b6, b7]
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(203,3)
            pub fn SeqToUInt64(s: &Sequence<u8>) -> u64 {
                let mut x0: u64 = s.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) as u64 * truncate!(int!(b"72057594037927936"), u64);
                let mut x1: u64 = x0 + s.get(&int!((&truncate!((&int!(1)).clone(), u32)).clone())) as u64 * truncate!(int!(b"281474976710656"), u64);
                let mut x2: u64 = x1 + s.get(&int!((&truncate!((&int!(2)).clone(), u32)).clone())) as u64 * truncate!(int!(b"1099511627776"), u64);
                let mut x3: u64 = x2 + s.get(&int!((&truncate!((&int!(3)).clone(), u32)).clone())) as u64 * truncate!(int!(b"4294967296"), u64);
                let mut x4: u64 = x3 + s.get(&int!((&truncate!((&int!(4)).clone(), u32)).clone())) as u64 * truncate!(int!(b"16777216"), u64);
                let mut x5: u64 = x4 + s.get(&int!((&truncate!((&int!(5)).clone(), u32)).clone())) as u64 * truncate!(int!(b"65536"), u64);
                let mut x6: u64 = x5 + s.get(&int!((&truncate!((&int!(6)).clone(), u32)).clone())) as u64 * truncate!(int!(256), u64);
                let mut x: u64 = x6 + s.get(&int!((&truncate!((&int!(7)).clone(), u32)).clone())) as u64;
                x
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(14,3)
            pub fn UINT16_LIMIT() -> DafnyInt {
                int!(crate::implementation_from_dafny::_BoundedInts_Compile::_default::UINT16_MAX()) + int!(1)
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(15,3)
            pub fn UINT32_LIMIT() -> DafnyInt {
                int!(crate::implementation_from_dafny::_BoundedInts_Compile::_default::UINT32_MAX()) + int!(1)
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(16,3)
            pub fn UINT64_LIMIT() -> DafnyInt {
                int!(crate::implementation_from_dafny::_BoundedInts_Compile::_default::UINT64_MAX()) + int!(1)
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(17,3)
            pub fn INT32_MAX_LIMIT() -> DafnyInt {
                int!(crate::implementation_from_dafny::_BoundedInts_Compile::_default::INT32_MAX())
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(18,3)
            pub fn INT64_MAX_LIMIT() -> DafnyInt {
                int!(crate::implementation_from_dafny::_BoundedInts_Compile::_default::INT64_MAX())
            }
            /// ../mpl/StandardLibrary/src/UInt.dfy(19,3)
            pub fn UINT64_MAX_LIMIT() -> DafnyInt {
                int!(crate::implementation_from_dafny::_BoundedInts_Compile::_default::UINT64_MAX())
            }
        }

        /// ../mpl/StandardLibrary/src/UInt.dfy(27,3)
        pub type seq16<T: DafnyType> = Sequence<T>;

        /// ../mpl/StandardLibrary/src/UInt.dfy(34,3)
        pub type seq32<T: DafnyType> = Sequence<T>;

        /// ../mpl/StandardLibrary/src/UInt.dfy(41,3)
        pub type seq64<T: DafnyType> = Sequence<T>;
    }
}
/// ../mpl/StandardLibrary/src/WrappersInterop.dfy(26,1)
pub mod _StandardLibraryInterop_Compile {
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;

    /// ../mpl/StandardLibrary/src/WrappersInterop.dfy(30,3)
    pub struct WrappersInterop {}

    impl WrappersInterop {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/StandardLibrary/src/WrappersInterop.dfy(32,5)
        pub fn CreateStringSome(s: &Sequence<DafnyCharUTF16>) -> Arc<Option<Sequence<DafnyCharUTF16>>> {
            Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                    value: s.clone()
                })
        }
        /// ../mpl/StandardLibrary/src/WrappersInterop.dfy(36,5)
        pub fn CreateStringNone() -> Arc<Option<Sequence<DafnyCharUTF16>>> {
            Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {})
        }
        /// ../mpl/StandardLibrary/src/WrappersInterop.dfy(40,5)
        pub fn CreateBooleanSome(b: bool) -> Arc<Option<bool>> {
            Arc::new(Option::<bool>::Some {
                    value: b
                })
        }
        /// ../mpl/StandardLibrary/src/WrappersInterop.dfy(44,5)
        pub fn CreateBooleanNone() -> Arc<Option<bool>> {
            Arc::new(Option::<bool>::None {})
        }
    }

    impl UpcastObject<DynAny>
        for WrappersInterop {
        UpcastObjectFn!(DynAny);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(19,1)
pub mod _StormTracker_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::StormTrackingCache;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CountingNumber;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::TimeUnits;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryOutput;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::TimeUnits::Seconds;
    pub use crate::implementation_from_dafny::_LocalCMC_Compile::LocalCMC;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::update_field_mut_uninit_object;
    pub use crate::implementation_from_dafny::DafnyLibraries::MutableMap;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong;
    pub use ::dafny_runtime::read_field;
    pub use crate::implementation_from_dafny::DafnyLibraries::MutableMapTrait;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::modify_field;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetCacheEntryInput;
    pub use ::dafny_runtime::euclidian_division;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::EntryDoesNotExist;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use crate::implementation_from_dafny::_StormTracker_Compile::CacheState::Full;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PutCacheEntryInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsCache;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DeleteCacheEntryInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::UpdateUsageMetadataInput;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(35,3)
        pub fn DefaultStorm() -> Arc<StormTrackingCache> {
            Arc::new(StormTrackingCache::StormTrackingCache {
                    entryCapacity: 1000,
                    entryPruningTailSize: Arc::new(Option::<CountingNumber>::Some {
                                value: 1
                            }),
                    gracePeriod: 10 * 1000,
                    graceInterval: 1 * 1000,
                    fanOut: 20,
                    inFlightTTL: 10 * 1000,
                    sleepMilli: 20,
                    timeUnits: Arc::new(Option::<Arc<TimeUnits>>::Some {
                                value: Arc::new(TimeUnits::Milliseconds {})
                            })
                })
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(61,3)
        pub fn ConsistentSettings(cache: &Arc<StormTrackingCache>) -> bool {
            cache.graceInterval().clone() <= cache.gracePeriod().clone() && cache.inFlightTTL().clone() <= cache.gracePeriod().clone() && cache.graceInterval().clone() <= cache.inFlightTTL().clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(69,3)
        pub fn N(n: CountingNumber) -> Sequence<DafnyCharUTF16> {
            crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&n).clone()))
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(73,3)
        pub fn BadCacheMsg(cache: &Arc<StormTrackingCache>) -> Sequence<DafnyCharUTF16> {
            let mut msg: Sequence<DafnyCharUTF16> = string_utf16_of("For a StormCache : ");
            let mut msg: Sequence<DafnyCharUTF16> = msg.concat(&(if !(cache.graceInterval().clone() <= cache.gracePeriod().clone()) {
                        string_utf16_of("graceInterval must not exceed gracePeriod, yet configuration has graceInterval=").concat(&_default::N(cache.graceInterval().clone())).concat(&string_utf16_of(" and gracePeriod=")).concat(&_default::N(cache.gracePeriod().clone())).concat(&string_utf16_of(". "))
                    } else {
                        string_utf16_of("")
                    }));
            let mut msg: Sequence<DafnyCharUTF16> = msg.concat(&(if !(cache.inFlightTTL().clone() <= cache.gracePeriod().clone()) {
                        string_utf16_of("inFlightTTL must not exceed gracePeriod, yet configuration has inFlightTTL=").concat(&_default::N(cache.inFlightTTL().clone())).concat(&string_utf16_of(" and gracePeriod=")).concat(&_default::N(cache.gracePeriod().clone())).concat(&string_utf16_of(". "))
                    } else {
                        string_utf16_of("")
                    }));
            msg.clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(96,3)
        pub fn CheckSettings(cache: &Arc<StormTrackingCache>) -> Arc<Outcome<Arc<Error>>> {
            if _default::ConsistentSettings(cache) {
                Arc::new(Outcome::<Arc<Error>>::Pass {})
            } else {
                Arc::new(Outcome::<Arc<Error>>::Fail {
                        error: Arc::new(Error::AwsCryptographicMaterialProvidersException {
                                    message: _default::BadCacheMsg(cache)
                                })
                    })
            }
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(30,3)
    #[derive(PartialEq, Clone)]
    pub enum CacheState {
        /// No data, client should wait
        EmptyWait {},
        /// No data, client should fetch
        EmptyFetch {},
        Full {
            data: Arc<GetCacheEntryOutput>
        }
    }

    impl CacheState {
        /// Gets the field data for all enum members which have it
        pub fn data(&self) -> &Arc<GetCacheEntryOutput> {
            match self {
                CacheState::EmptyWait{} => panic!("field does not exist on this variant"),
                CacheState::EmptyFetch{} => panic!("field does not exist on this variant"),
                CacheState::Full{data, } => data,
            }
        }
    }

    impl Debug
        for CacheState {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for CacheState {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                CacheState::EmptyWait{} => {
                    write!(_formatter, "StormTracker_Compile.CacheState.EmptyWait")?;
                    Ok(())
                },
                CacheState::EmptyFetch{} => {
                    write!(_formatter, "StormTracker_Compile.CacheState.EmptyFetch")?;
                    Ok(())
                },
                CacheState::Full{data, } => {
                    write!(_formatter, "StormTracker_Compile.CacheState.Full(")?;
                    DafnyPrint::fmt_print(data, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for CacheState {}

    impl Hash
        for CacheState {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                CacheState::EmptyWait{} => {

                },
                CacheState::EmptyFetch{} => {

                },
                CacheState::Full{data, } => {
                    Hash::hash(data, _state)
                },
            }
        }
    }

    impl Default
        for CacheState {
        fn default() -> CacheState {
            CacheState::EmptyWait {}
        }
    }

    impl AsRef<CacheState>
        for CacheState {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(107,3)
    pub struct StormTracker {
        pub wrapped: ::dafny_runtime::Field<Object<LocalCMC>>,
        pub inFlight: ::dafny_runtime::Field<Object<MutableMap<Sequence<u8>, PositiveLong>>>,
        pub gracePeriod: ::dafny_runtime::Field<PositiveLong>,
        pub graceInterval: ::dafny_runtime::Field<PositiveLong>,
        pub fanOut: ::dafny_runtime::Field<PositiveLong>,
        pub inFlightTTL: ::dafny_runtime::Field<PositiveLong>,
        pub lastPrune: ::dafny_runtime::Field<PositiveLong>,
        pub sleepMilli: ::dafny_runtime::Field<PositiveLong>
    }

    impl StormTracker {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(130,5)
        pub fn _ctor(this: &Object<StormTracker>, cache: &Arc<StormTrackingCache>) -> () {
            let mut _set_wrapped: bool = false;
            let mut _set_inFlight: bool = false;
            let mut _set_gracePeriod: bool = false;
            let mut _set_graceInterval: bool = false;
            let mut _set_fanOut: bool = false;
            let mut _set_inFlightTTL: bool = false;
            let mut _set_lastPrune: bool = false;
            let mut _set_sleepMilli: bool = false;
            let mut gracePeriod: i64 = <i64 as Default>::default();
            let mut graceInterval: i64 = <i64 as Default>::default();
            let mut inFlightTTL: i64 = <i64 as Default>::default();
            if matches!((&cache.timeUnits().UnwrapOr(&Arc::new(TimeUnits::Seconds {}))).as_ref(), Seconds{ .. }) {
                gracePeriod = cache.gracePeriod().clone() as i64 * 1000;
                graceInterval = cache.graceInterval().clone() as i64 * 1000;
                inFlightTTL = cache.inFlightTTL().clone() as i64 * 1000;
            } else {
                gracePeriod = cache.gracePeriod().clone() as i64;
                graceInterval = cache.graceInterval().clone() as i64;
                inFlightTTL = cache.inFlightTTL().clone() as i64;
            };
            let mut _nw0: Object<LocalCMC> = LocalCMC::_allocate_object();
            LocalCMC::_ctor(&_nw0, cache.entryCapacity().clone() as u64, cache.entryPruningTailSize().UnwrapOr(&truncate!((&int!(1)).clone(), i32)) as u64);
            update_field_mut_uninit_object!(this.clone(), wrapped, _set_wrapped, _nw0.clone());
            let mut _nw1: Object<MutableMap<Sequence<u8>, PositiveLong>> = MutableMap::<Sequence<u8>, PositiveLong>::_allocate_object(true);
            update_field_mut_uninit_object!(this.clone(), inFlight, _set_inFlight, _nw1.clone());
            update_field_mut_uninit_object!(this.clone(), gracePeriod, _set_gracePeriod, gracePeriod);
            update_field_mut_uninit_object!(this.clone(), graceInterval, _set_graceInterval, graceInterval);
            update_field_mut_uninit_object!(this.clone(), fanOut, _set_fanOut, cache.fanOut().clone() as i64);
            update_field_mut_uninit_object!(this.clone(), inFlightTTL, _set_inFlightTTL, inFlightTTL);
            update_field_mut_uninit_object!(this.clone(), sleepMilli, _set_sleepMilli, cache.sleepMilli().clone() as i64);
            update_field_mut_uninit_object!(this.clone(), lastPrune, _set_lastPrune, 0);
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(165,5)
        pub fn FanOutReached(&self, now: PositiveLong) -> bool {
            let mut res: bool = <bool as Default>::default();
            self.PruneInFlight(now);
            res = read_field!(self.fanOut) <= truncate!(MutableMapTrait::<Sequence<u8>, PositiveLong>::Size(rd!(read_field!(self.inFlight))), i64);
            return res;
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(181,5)
        pub fn AddLong(&self, x: PositiveLong, y: PositiveLong) -> PositiveLong {
            if x < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT64_MAX_LIMIT(), i64) - y {
                x + y
            } else {
                truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT64_MAX_LIMIT(), i64)
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(193,5)
        pub fn _GracePeriod_q(&self, result: &Arc<GetCacheEntryOutput>, now: PositiveLong) -> bool {
            result.expiryTime().clone() < 9223372036854775 && result.expiryTime().clone() * 1000 - read_field!(self.gracePeriod) <= now
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(217,5)
        pub fn CheckInFlight(&self, identifier: &Sequence<u8>, result: &Arc<GetCacheEntryOutput>, now: PositiveLong) -> Arc<CacheState> {
            let mut output = MaybePlacebo::<Arc<CacheState>>::new();
            let mut fanOutReached: bool;
            let mut _out0: bool = self.FanOutReached(now);
            fanOutReached = _out0;
            if fanOutReached {
                output = MaybePlacebo::from(Arc::new(CacheState::Full {
                                data: result.clone()
                            }));
                return output.read();
            } else {
                if !self._GracePeriod_q(result, now) {
                    output = MaybePlacebo::from(Arc::new(CacheState::Full {
                                    data: result.clone()
                                }));
                    return output.read();
                } else {
                    if MutableMapTrait::<Sequence<u8>, PositiveLong>::HasKey(rd!(read_field!(self.inFlight)), identifier) {
                        let mut entry: PositiveLong = MutableMapTrait::<Sequence<u8>, PositiveLong>::Select(rd!(read_field!(self.inFlight)), identifier);
                        if now < self.AddLong(entry, read_field!(self.graceInterval)) {
                            output = MaybePlacebo::from(Arc::new(CacheState::Full {
                                            data: result.clone()
                                        }));
                            return output.read();
                        }
                    };
                    MutableMapTrait::<Sequence<u8>, PositiveLong>::Put(rd!(read_field!(self.inFlight)), identifier, &now);
                    output = MaybePlacebo::from(Arc::new(CacheState::EmptyFetch {}));
                    return output.read();
                }
            };
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(296,5)
        pub fn PruneInFlight(&self, now: PositiveLong) -> () {
            if truncate!(MutableMapTrait::<Sequence<u8>, PositiveLong>::Size(rd!(read_field!(self.inFlight))), i64) < read_field!(self.fanOut) {
                return ();
            };
            if now - 1000 < read_field!(self.lastPrune) {
                return ();
            };
            modify_field!(self.lastPrune, now);
            let mut keySet: Set<Sequence<u8>> = MutableMapTrait::<Sequence<u8>, PositiveLong>::Keys(rd!(read_field!(self.inFlight)));
            let mut keys: Sequence<Sequence<u8>>;
            let mut _out0: Sequence<Sequence<u8>> = crate::implementation_from_dafny::SortedSets::_default::SetToSequence::<Sequence<u8>>(&keySet);
            keys = _out0.clone();
            let mut _hi0: u64 = truncate!(keys.cardinality(), u64);
            for i in integer_range(0, _hi0).map(Into::<u64>::into) {
                let mut v: PositiveLong = MutableMapTrait::<Sequence<u8>, PositiveLong>::Select(rd!(read_field!(self.inFlight)), &keys.get(&int!((&i).clone())));
                if now >= self.AddLong(v, read_field!(self.inFlightTTL)) {
                    MutableMapTrait::<Sequence<u8>, PositiveLong>::Remove(rd!(read_field!(self.inFlight)), &keys.get(&int!((&i).clone())))
                }
            }
            return ();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(350,5)
        pub fn CheckNewEntry(&self, identifier: &Sequence<u8>, now: PositiveLong) -> Arc<CacheState> {
            let mut output = MaybePlacebo::<Arc<CacheState>>::new();
            let mut fanOutReached: bool;
            let mut _out0: bool = self.FanOutReached(now);
            fanOutReached = _out0;
            if fanOutReached {
                output = MaybePlacebo::from(Arc::new(CacheState::EmptyWait {}));
                return output.read();
            } else {
                if MutableMapTrait::<Sequence<u8>, PositiveLong>::HasKey(rd!(read_field!(self.inFlight)), identifier) {
                    let mut entry: PositiveLong = MutableMapTrait::<Sequence<u8>, PositiveLong>::Select(rd!(read_field!(self.inFlight)), identifier);
                    if now < self.AddLong(entry, read_field!(self.graceInterval)) {
                        output = MaybePlacebo::from(Arc::new(CacheState::EmptyWait {}));
                        return output.read();
                    }
                }
            };
            MutableMapTrait::<Sequence<u8>, PositiveLong>::Put(rd!(read_field!(self.inFlight)), identifier, &now);
            output = MaybePlacebo::from(Arc::new(CacheState::EmptyFetch {}));
            return output.read();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(411,5)
        pub fn GetFromCacheWithTime(&self, input: &Arc<GetCacheEntryInput>, now: PositiveLong) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CacheState>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CacheState>, Arc<Error>>>;
            let mut result: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<Error>>> = rd!(read_field!(self.wrapped)).GetCacheEntryWithTime(input, truncate!(euclidian_division(int!(now), int!(1000)), i64));
            result = _out0.clone();
            if matches!((&result).as_ref(), Success{ .. }) {
                let mut newResult: Arc<CacheState>;
                let mut _out1: Arc<CacheState> = self.CheckInFlight(input.identifier(), result.value(), now);
                newResult = _out1.clone();
                output = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<CacheState>, Arc<Error>>::Success {
                            value: newResult.clone()
                        });
                return output.clone();
            } else {
                if matches!(result.error().as_ref(), EntryDoesNotExist{ .. }) {
                    let mut newResult: Arc<CacheState>;
                    let mut _out2: Arc<CacheState> = self.CheckNewEntry(input.identifier(), now);
                    newResult = _out2.clone();
                    output = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<CacheState>, Arc<Error>>::Success {
                                value: newResult.clone()
                            });
                    return output.clone();
                } else {
                    output = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<CacheState>, Arc<Error>>::Failure {
                                error: result.error().clone()
                            });
                    return output.clone();
                }
            };
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(433,5)
        pub fn GetFromCache(&self, input: &Arc<GetCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CacheState>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CacheState>, Arc<Error>>>;
            let mut now: i64;
            let mut _out0: i64 = crate::implementation_from_dafny::Time::_default::CurrentRelativeTimeMilli();
            now = _out0;
            let mut _out1: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CacheState>, Arc<Error>>> = self.GetFromCacheWithTime(input, now);
            output = _out1.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(449,5)
        pub fn GetCacheEntry(&self, input: &Arc<GetCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<GetCacheEntryOutput>, Arc<Error>>>;
            let mut result: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CacheState>, Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Arc<CacheState>, Arc<Error>>> = self.GetFromCache(input);
            result = _out0.clone();
            if matches!((&result).as_ref(), Failure{ .. }) {
                output = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GetCacheEntryOutput>, Arc<Error>>::Failure {
                            error: result.error().clone()
                        });
                return output.clone();
            } else {
                if matches!(result.value().as_ref(), Full{ .. }) {
                    output = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GetCacheEntryOutput>, Arc<Error>>::Success {
                                value: result.value().data().clone()
                            });
                    return output.clone();
                } else {
                    output = Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Arc<GetCacheEntryOutput>, Arc<Error>>::Failure {
                                error: Arc::new(Error::EntryDoesNotExist {
                                            message: string_utf16_of("Entry does not exist")
                                        })
                            });
                    return output.clone();
                }
            };
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(468,5)
        pub fn PutCacheEntry(&self, input: &Arc<PutCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>;
            MutableMapTrait::<Sequence<u8>, PositiveLong>::Remove(rd!(read_field!(self.inFlight)), input.identifier());
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> = ICryptographicMaterialsCache::_PutCacheEntry_k(rd!(read_field!(self.wrapped)), input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(481,5)
        pub fn DeleteCacheEntry(&self, input: &Arc<DeleteCacheEntryInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>;
            MutableMapTrait::<Sequence<u8>, PositiveLong>::Remove(rd!(read_field!(self.inFlight)), input.identifier());
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> = ICryptographicMaterialsCache::_DeleteCacheEntry_k(rd!(read_field!(self.wrapped)), input);
            output = _out0.clone();
            return output.clone();
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/CMCs/StormTracker.dfy(492,5)
        pub fn UpdateUsageMetadata(&self, input: &Arc<UpdateUsageMetadataInput>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> {
            let mut output: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>>;
            let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Arc<Error>>> = ICryptographicMaterialsCache::_UpdateUsageMetadata_k(rd!(read_field!(self.wrapped)), input);
            output = _out0.clone();
            return output.clone();
        }
    }

    impl UpcastObject<DynAny>
        for StormTracker {
        UpcastObjectFn!(DynAny);
    }
}
/// ../mpl/StandardLibrary/src/Streams.dfy(7,1)
pub mod _Streams_Compile {
    pub use ::dafny_runtime::DafnyType;
    pub use ::dafny_runtime::Object;
    pub use ::dafny_runtime::allocate_object;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::update_field_uninit_object;
    pub use ::dafny_runtime::update_field_mut_uninit_object;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::read_field;
    pub use ::dafny_runtime::modify_field;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::UpcastObject;
    pub use ::dafny_runtime::DynAny;
    pub use ::dafny_runtime::UpcastObjectFn;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::rd;
    pub use ::std::default::Default;
    pub use ::dafny_runtime::seq;

    /// ../mpl/StandardLibrary/src/Streams.dfy(12,3)
    pub struct SeqReader<T: DafnyType> {
        pub pos: ::dafny_runtime::Field<u64>,
        pub __i_data: Sequence<T>
    }

    impl<T: DafnyType> SeqReader<T> {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(26,5)
        pub fn _ctor(this: &Object<SeqReader<T>>, s: &Sequence<T>) -> () {
            let mut _set_pos: bool = false;
            let mut _set___i_data: bool = false;
            update_field_uninit_object!(this.clone(), __i_data, _set___i_data, s.clone());
            update_field_mut_uninit_object!(this.clone(), pos, _set_pos, 0);
            return ();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(36,5)
        pub fn ReadElements(&self, n: u64) -> Sequence<T> {
            let mut elems: Sequence<T> = self.data().clone().drop(&int!((&read_field!(self.pos)).clone())).take(&int!((&n).clone()));
            modify_field!(self.pos, crate::implementation_from_dafny::_StandardLibrary_Compile::_MemoryMath_Compile::_default::Add(read_field!(self.pos), n));
            elems = elems.clone();
            return elems.clone();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(50,5)
        pub fn ReadExact(&self, n: u64) -> Arc<Result<Sequence<T>, Sequence<DafnyCharUTF16>>> {
            let mut res: Arc<Result<Sequence<T>, Sequence<DafnyCharUTF16>>>;
            if truncate!(self.data().clone().cardinality(), u64) - read_field!(self.pos) < n {
                res = Arc::new(Result::<Sequence<T>, Sequence<DafnyCharUTF16>>::Failure {
                            error: string_utf16_of("IO Error: Not enough elements left on stream.")
                        });
                return res.clone();
            } else {
                let mut elements: Sequence<T>;
                let mut _out0: Sequence<T> = self.ReadElements(n);
                elements = _out0.clone();
                res = Arc::new(Result::<Sequence<T>, Sequence<DafnyCharUTF16>>::Success {
                            value: elements.clone()
                        });
                return res.clone();
            };
            return res.clone();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(14,5)
        pub fn data(&self) -> Sequence<T> {
            self.__i_data.clone()
        }
    }

    impl<T: DafnyType> UpcastObject<DynAny>
        for SeqReader<T> {
        UpcastObjectFn!(DynAny);
    }

    /// ../mpl/StandardLibrary/src/Streams.dfy(71,3)
    pub struct ByteReader {
        pub __i_reader: Object<SeqReader<u8>>
    }

    impl ByteReader {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(83,5)
        pub fn _ctor(this: &Object<ByteReader>, s: &Sequence<u8>) -> () {
            let mut _set___i_reader: bool = false;
            let mut mr: Object<SeqReader<u8>>;
            let mut _nw0: Object<SeqReader<u8>> = SeqReader::<u8>::_allocate_object();
            SeqReader::<u8>::_ctor(&_nw0, s);
            mr = _nw0.clone();
            update_field_uninit_object!(this.clone(), __i_reader, _set___i_reader, mr.clone());
            return ();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(93,5)
        pub fn ReadByte(&self) -> Arc<Result<u8, Sequence<DafnyCharUTF16>>> {
            let mut res = MaybePlacebo::<Arc<Result<u8, Sequence<DafnyCharUTF16>>>>::new();
            let mut valueOrError0: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>> = rd!(self.reader().clone()).ReadExact(1);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<u8>());
                return res.read();
            };
            let mut bytes: Sequence<u8> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<u8, Sequence<DafnyCharUTF16>>::Success {
                            value: bytes.get(&int!(0))
                        }));
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(108,5)
        pub fn ReadBytes(&self, n: u64) -> Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>>>::new();
            let mut valueOrError0: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>> = rd!(self.reader().clone()).ReadExact(n);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut bytes: Sequence<u8> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Sequence<DafnyCharUTF16>>::Success {
                            value: bytes.clone()
                        }));
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(126,5)
        pub fn ReadUInt16(&self) -> Arc<Result<u16, Sequence<DafnyCharUTF16>>> {
            let mut res = MaybePlacebo::<Arc<Result<u16, Sequence<DafnyCharUTF16>>>>::new();
            let mut valueOrError0: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>> = rd!(self.reader().clone()).ReadExact(2);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<u16>());
                return res.read();
            };
            let mut bytes: Sequence<u8> = valueOrError0.Extract();
            let mut n: u16 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt16(&bytes);
            res = MaybePlacebo::from(Arc::new(Result::<u16, Sequence<DafnyCharUTF16>>::Success {
                            value: n
                        }));
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(142,5)
        pub fn ReadUInt32(&self) -> Arc<Result<u32, Sequence<DafnyCharUTF16>>> {
            let mut res = MaybePlacebo::<Arc<Result<u32, Sequence<DafnyCharUTF16>>>>::new();
            let mut valueOrError0: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>> = rd!(self.reader().clone()).ReadExact(4);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<u32>());
                return res.read();
            };
            let mut bytes: Sequence<u8> = valueOrError0.Extract();
            let mut n: u32 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt32(&bytes);
            res = MaybePlacebo::from(Arc::new(Result::<u32, Sequence<DafnyCharUTF16>>::Success {
                            value: n
                        }));
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(158,5)
        pub fn ReadUInt64(&self) -> Arc<Result<u64, Sequence<DafnyCharUTF16>>> {
            let mut res = MaybePlacebo::<Arc<Result<u64, Sequence<DafnyCharUTF16>>>>::new();
            let mut valueOrError0: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>>;
            let mut _out0: Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>> = rd!(self.reader().clone()).ReadExact(8);
            valueOrError0 = _out0.clone();
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<u64>());
                return res.read();
            };
            let mut bytes: Sequence<u8> = valueOrError0.Extract();
            let mut n: u64 = crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::SeqToUInt64(&bytes);
            res = MaybePlacebo::from(Arc::new(Result::<u64, Sequence<DafnyCharUTF16>>::Success {
                            value: n
                        }));
            return res.read();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(174,5)
        pub fn IsDoneReading(&self) -> bool {
            let mut b: bool = <bool as Default>::default();
            b = truncate!(rd!(self.reader().clone().clone()).data().clone().cardinality(), u64) == read_field!(rd!(self.reader().clone().clone()).pos);
            return b;
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(183,5)
        pub fn GetSizeRead(&self) -> u64 {
            let mut n: u64 = <u64 as Default>::default();
            n = read_field!(rd!(self.reader().clone().clone()).pos);
            return n;
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(73,5)
        pub fn reader(&self) -> Object<SeqReader<u8>> {
            self.__i_reader.clone()
        }
    }

    impl UpcastObject<DynAny>
        for ByteReader {
        UpcastObjectFn!(DynAny);
    }

    /// ../mpl/StandardLibrary/src/Streams.dfy(192,3)
    pub struct SeqWriter<T: DafnyType> {
        pub data: ::dafny_runtime::Field<Sequence<T>>
    }

    impl<T: DafnyType> SeqWriter<T> {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(203,5)
        pub fn _ctor(this: &Object<SeqWriter<T>>) -> () {
            let mut _set_data: bool = false;
            update_field_mut_uninit_object!(this.clone(), data, _set_data, seq![] as Sequence<T>);
            return ();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(211,5)
        pub fn WriteElements(&self, elems: &Sequence<T>) -> u64 {
            let mut n: u64 = <u64 as Default>::default();
            modify_field!(self.data, read_field!(self.data).concat(elems));
            n = truncate!(elems.cardinality(), u64);
            return n;
        }
    }

    impl<T: DafnyType> UpcastObject<DynAny>
        for SeqWriter<T> {
        UpcastObjectFn!(DynAny);
    }

    /// ../mpl/StandardLibrary/src/Streams.dfy(226,3)
    pub struct ByteWriter {
        pub __i_writer: Object<SeqWriter<u8>>
    }

    impl ByteWriter {
        /// Allocates an UNINITIALIZED instance. Only the Dafny compiler should use that.
        pub fn _allocate_object() -> Object<Self> {
            allocate_object::<Self>()
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(238,5)
        pub fn _ctor(this: &Object<ByteWriter>) -> () {
            let mut _set___i_writer: bool = false;
            let mut mw: Object<SeqWriter<u8>>;
            let mut _nw0: Object<SeqWriter<u8>> = SeqWriter::<u8>::_allocate_object();
            SeqWriter::<u8>::_ctor(&_nw0);
            mw = _nw0.clone();
            update_field_uninit_object!(this.clone(), __i_writer, _set___i_writer, mw.clone());
            return ();
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(247,5)
        pub fn WriteByte(&self, n: u8) -> u64 {
            let mut r: u64 = <u64 as Default>::default();
            let mut _out0: u64 = rd!(self.writer().clone()).WriteElements(&seq![n]);
            r = _out0;
            return r;
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(257,5)
        pub fn WriteBytes(&self, s: &Sequence<u8>) -> u64 {
            let mut r: u64 = <u64 as Default>::default();
            let mut _out0: u64 = rd!(self.writer().clone()).WriteElements(s);
            r = _out0;
            return r;
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(267,5)
        pub fn WriteUInt16(&self, n: u16) -> u64 {
            let mut r: u64 = <u64 as Default>::default();
            let mut _out0: u64 = rd!(self.writer().clone()).WriteElements(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt16ToSeq(n));
            r = _out0;
            return r;
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(277,5)
        pub fn WriteUInt32(&self, n: u32) -> u64 {
            let mut r: u64 = <u64 as Default>::default();
            let mut _out0: u64 = rd!(self.writer().clone()).WriteElements(&crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::UInt32ToSeq(n));
            r = _out0;
            return r;
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(287,5)
        pub fn GetDataWritten(&self) -> Sequence<u8> {
            read_field!(rd!(self.writer().clone().clone()).data)
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(296,5)
        pub fn GetSizeWritten(&self) -> u64 {
            truncate!(read_field!(rd!(self.writer().clone().clone()).data).cardinality(), u64)
        }
        /// ../mpl/StandardLibrary/src/Streams.dfy(228,5)
        pub fn writer(&self) -> Object<SeqWriter<u8>> {
            self.__i_writer.clone()
        }
    }

    impl UpcastObject<DynAny>
        for ByteWriter {
        UpcastObjectFn!(DynAny);
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/StrictMultiKeyring.dfy(12,1)
pub mod _StrictMultiKeyring_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::GrantTokenList;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_MultiKeyring_Compile::MultiKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::_AwsArnParsing_Compile::AwsKmsIdentifier;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_AwsKmsKeyring_Compile::AwsKmsKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::integer_range;
    pub use ::std::convert::Into;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::rc_coerce;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Keyrings/AwsKms/StrictMultiKeyring.dfy(25,3)
        pub fn StrictMultiKeyring(generator: &Arc<Option<Sequence<DafnyCharUTF16>>>, awsKmsKeys: &Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>>, clientSupplier: &Object<dyn IClientSupplier>, grantTokens: &Arc<Option<GrantTokenList>>) -> Arc<Result<Object<MultiKeyring>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Object<MultiKeyring>, Arc<Error>>>>::new();
            let mut allStrings: Sequence<Sequence<DafnyCharUTF16>>;
            let mut _source0: Arc<Option<Sequence<DafnyCharUTF16>>> = generator.clone();
            if matches!((&_source0).as_ref(), None{ .. }) {
                allStrings = awsKmsKeys.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>));
            } else {
                let mut ___mcc_h0: Sequence<DafnyCharUTF16> = _source0.value().clone();
                let mut g: Sequence<DafnyCharUTF16> = ___mcc_h0.clone();
                allStrings = seq![g.clone()].concat(&awsKmsKeys.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>)));
            };
            let mut valueOrError0: Arc<Result<Sequence<Arc<AwsKmsIdentifier>>, Arc<Error>>> = crate::implementation_from_dafny::_Seq_Compile::_default::MapWithResult::<Sequence<DafnyCharUTF16>, Arc<AwsKmsIdentifier>, Sequence<DafnyCharUTF16>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsAwsKmsIdentifierString(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>), &allStrings).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Object<MultiKeyring>>());
                return output.read();
            };
            let mut allIdentifiers: Sequence<Arc<AwsKmsIdentifier>> = valueOrError0.Extract();
            let mut generatorKeyring: Arc<Option<Object<AwsKmsKeyring>>>;
            let mut _source1: Arc<Option<Sequence<DafnyCharUTF16>>> = generator.clone();
            if matches!((&_source1).as_ref(), None{ .. }) {
                generatorKeyring = Arc::new(Option::<Object<AwsKmsKeyring>>::None {});
            } else {
                let mut ___mcc_h1: Sequence<DafnyCharUTF16> = _source1.value().clone();
                let mut generatorIdentifier: Sequence<DafnyCharUTF16> = ___mcc_h1.clone();
                let mut valueOrError1: Arc<Result<Arc<AwsKmsIdentifier>, Arc<Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsAwsKmsIdentifierString(&generatorIdentifier).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
                if valueOrError1.IsFailure() {
                    output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Object<MultiKeyring>>());
                    return output.read();
                };
                let mut arn: Arc<AwsKmsIdentifier> = valueOrError1.Extract();
                let mut region: Arc<Option<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::GetRegion(&arn);
                let mut valueOrError2: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>>;
                let mut _out0: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput {
                                region: region.UnwrapOr(&string_utf16_of(""))
                            }));
                valueOrError2 = _out0.clone();
                if valueOrError2.IsFailure() {
                    output = MaybePlacebo::from(valueOrError2.PropagateFailure::<Object<MultiKeyring>>());
                    return output.read();
                };
                let mut client: Object<dyn IKMSClient> = valueOrError2.Extract();
                let mut g: Object<AwsKmsKeyring>;
                let mut _nw0: Object<AwsKmsKeyring> = AwsKmsKeyring::_allocate_object();
                AwsKmsKeyring::_ctor(&_nw0, &client, &generatorIdentifier, &grantTokens.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>)));
                g = _nw0.clone();
                generatorKeyring = Arc::new(Option::<Object<AwsKmsKeyring>>::Some {
                            value: g.clone()
                        });
            };
            let mut children: Sequence<Object<AwsKmsKeyring>> = seq![] as Sequence<Object<AwsKmsKeyring>>;
            let mut _source2: Arc<Option<Sequence<Sequence<DafnyCharUTF16>>>> = awsKmsKeys.clone();
            if matches!((&_source2).as_ref(), None{ .. }) {
                children = seq![] as Sequence<Object<AwsKmsKeyring>>;
            } else {
                let mut ___mcc_h2: Sequence<Sequence<DafnyCharUTF16>> = _source2.value().clone();
                let mut childIdentifiers: Sequence<Sequence<DafnyCharUTF16>> = ___mcc_h2.clone();
                let mut _hi0: u64 = truncate!(childIdentifiers.cardinality(), u64);
                for index in integer_range(0, _hi0).map(Into::<u64>::into) {
                    let mut childIdentifier: Sequence<DafnyCharUTF16> = childIdentifiers.get(&int!((&index).clone()));
                    let mut valueOrError3: Arc<Result<Arc<AwsKmsIdentifier>, Arc<Error>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::IsAwsKmsIdentifierString(&childIdentifier).MapFailure::<Arc<Error>>(&(Arc::new(move |x0: &Sequence<DafnyCharUTF16>| crate::implementation_from_dafny::_AwsKmsUtils_Compile::_default::WrapStringToError(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>));
                    if valueOrError3.IsFailure() {
                        output = MaybePlacebo::from(valueOrError3.PropagateFailure::<Object<MultiKeyring>>());
                        return output.read();
                    };
                    let mut info: Arc<AwsKmsIdentifier> = valueOrError3.Extract();
                    let mut region: Arc<Option<Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_AwsArnParsing_Compile::_default::GetRegion(&info);
                    let mut valueOrError4: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>>;
                    let mut _out1: Arc<Result<Object<dyn IKMSClient>, Arc<Error>>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput {
                                    region: region.UnwrapOr(&string_utf16_of(""))
                                }));
                    valueOrError4 = _out1.clone();
                    if valueOrError4.IsFailure() {
                        output = MaybePlacebo::from(valueOrError4.PropagateFailure::<Object<MultiKeyring>>());
                        return output.read();
                    };
                    let mut client: Object<dyn IKMSClient> = valueOrError4.Extract();
                    let mut keyring: Object<AwsKmsKeyring>;
                    let mut _nw1: Object<AwsKmsKeyring> = AwsKmsKeyring::_allocate_object();
                    AwsKmsKeyring::_ctor(&_nw1, &client, &childIdentifier, &grantTokens.UnwrapOr(&(seq![] as Sequence<Sequence<DafnyCharUTF16>>)));
                    keyring = _nw1.clone();
                    children = children.concat(&seq![keyring.clone()]);
                }
            };
            let mut valueOrError5: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(matches!((&generatorKeyring).as_ref(), Some{ .. }) || 0 < truncate!(children.cardinality(), u64), &Arc::new(Error::AwsCryptographicMaterialProvidersException {
                            message: string_utf16_of("generatorKeyring or child Keryings needed to create a multi keyring")
                        }));
            if valueOrError5.IsFailure() {
                output = MaybePlacebo::from(valueOrError5.PropagateFailure::<Object<MultiKeyring>>());
                return output.read();
            };
            let mut keyring: Object<MultiKeyring>;
            let mut _nw2: Object<MultiKeyring> = MultiKeyring::_allocate_object();
            MultiKeyring::_ctor(&_nw2, &rc_coerce(Option::<Object<AwsKmsKeyring>>::coerce(upcast_object::<AwsKmsKeyring, dyn IKeyring>()))(generatorKeyring.clone()), &Sequence::<Object<AwsKmsKeyring>>::coerce(upcast_object::<AwsKmsKeyring, dyn IKeyring>())(children.clone()));
            keyring = _nw2.clone();
            output = MaybePlacebo::from(Arc::new(Result::<Object<MultiKeyring>, Arc<Error>>::Success {
                            value: keyring.clone()
                        }));
            return output.read();
        }
    }
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(7,1)
pub mod _Structure_Compile {
    pub use ::dafny_runtime::Map;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::truncate;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue;
    pub use ::dafny_runtime::MapBuilder;
    pub use ::dafny_runtime::set;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BranchKeyMaterials;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::BeaconKeyMaterials;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::SetBuilder;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::dafny_runtime::map;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::S;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::N;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::AttributeValue::B;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(39,3)
        pub fn _BranchKeyContext_q(m: &Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>) -> bool {
            m.contains(&_default::BRANCH_KEY_IDENTIFIER_FIELD()) && m.contains(&_default::TYPE_FIELD()) && m.contains(&_default::KEY_CREATE_TIME()) && m.contains(&_default::HIERARCHY_VERSION()) && m.contains(&_default::TABLE_FIELD()) && m.contains(&_default::KMS_FIELD()) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(&m.get(&_default::KMS_FIELD())) && !m.keys().contains(&_default::BRANCH_KEY_FIELD()) && 0 < truncate!(m.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD()).cardinality(), u64) && 0 < truncate!(m.get(&_default::TYPE_FIELD()).cardinality(), u64) && (&m.keys()).iter().all(({
                    let mut m = m.clone();
                    Arc::new(move |__forall_var_0: &Sequence<DafnyCharUTF16>| -> bool{
                            let mut k: Sequence<DafnyCharUTF16> = __forall_var_0.clone();
                            !m.keys().contains(&k) || crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::_default::IsValid_AttributeName(&k)
                        })
                }).as_ref()) && m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) == (true && m.get(&_default::TYPE_FIELD()) == _default::BRANCH_KEY_ACTIVE_TYPE()) && (!m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) || true && _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD())) && !m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) == (m.get(&_default::TYPE_FIELD()) == _default::BEACON_KEY_TYPE_VALUE() || _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::TYPE_FIELD()))
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(116,3)
        pub fn ToAttributeMap(encryptionContext: &BranchKeyContext, encryptedKey: &Sequence<u8>) -> Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>> {
            (&({
                let mut encryptedKey = encryptedKey.clone();
                let mut encryptionContext = encryptionContext.clone();
                Arc::new(move || -> Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>{
                        let mut _coll0: MapBuilder<Sequence<DafnyCharUTF16>, Arc<AttributeValue>> = MapBuilder::<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>::new();
                        for __compr_0 in (&encryptionContext.keys().merge(&set!{_default::BRANCH_KEY_FIELD()}).subtract(&set!{_default::TABLE_FIELD()})).iter().cloned() {
                            if true {
                                let mut k: Sequence<DafnyCharUTF16> = __compr_0.clone();
                                if {
                                        let x: Sequence<DafnyCharUTF16> = k.clone();
                                        crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::_default::IsValid_AttributeName(&x)
                                    } {
                                    if encryptionContext.keys().merge(&set!{_default::BRANCH_KEY_FIELD()}).subtract(&set!{_default::TABLE_FIELD()}).contains(&k) {
                                        _coll0.add(&k, &(if k.clone() == _default::HIERARCHY_VERSION() {
                                                Arc::new(AttributeValue::N {
                                                        N: encryptionContext.get(&_default::HIERARCHY_VERSION())
                                                    })
                                            } else {
                                                if k.clone() == _default::BRANCH_KEY_FIELD() {
                                                    Arc::new(AttributeValue::B {
                                                            B: encryptedKey.clone()
                                                        })
                                                } else {
                                                    Arc::new(AttributeValue::S {
                                                            S: encryptionContext.get(&k)
                                                        })
                                                }
                                            }))
                                    }
                                }
                            }
                        }
                        _coll0.build()
                    })
            }))()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(141,3)
        pub fn ToBranchKeyContext(item: &Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>, logicalKeyStoreName: &Sequence<DafnyCharUTF16>) -> BranchKeyContext {
            (&({
                let mut logicalKeyStoreName = logicalKeyStoreName.clone();
                let mut item = item.clone();
                Arc::new(move || -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>{
                        let mut _coll0: MapBuilder<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = MapBuilder::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::new();
                        for __compr_0 in (&item.keys().subtract(&set!{_default::BRANCH_KEY_FIELD()}).merge(&set!{_default::TABLE_FIELD()})).iter().cloned() {
                            let mut k: Sequence<DafnyCharUTF16> = __compr_0.clone();
                            if item.keys().subtract(&set!{_default::BRANCH_KEY_FIELD()}).merge(&set!{_default::TABLE_FIELD()}).contains(&k) {
                                _coll0.add(&k, &(if k.clone() == _default::HIERARCHY_VERSION() {
                                        item.get(&k).N().clone()
                                    } else {
                                        if k.clone() == _default::TABLE_FIELD() {
                                            logicalKeyStoreName.clone()
                                        } else {
                                            item.get(&k).S().clone()
                                        }
                                    }))
                            }
                        }
                        _coll0.build()
                    })
            }))()
        }
        /// = aws-encryption-sdk-specification/framework/branch-key-store.md#branch-key-materials-from-authenticated-encryption-context
        /// = type=implication
        /// # The `type` attribute MUST either be equal to `"branch:ACTIVE"` or start with `"branch:version:"`.
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(162,3)
        pub fn ToBranchKeyMaterials(encryptionContext: &BranchKeyContext, plaintextKey: &Sequence<u8>) -> Arc<Result<Arc<BranchKeyMaterials>, Arc<Error>>> {
            let mut versionInformation: Sequence<DafnyCharUTF16> = if encryptionContext.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) {
                    encryptionContext.get(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD())
                } else {
                    encryptionContext.get(&_default::TYPE_FIELD())
                };
            let mut branchKeyVersion: Sequence<DafnyCharUTF16> = versionInformation.drop(&int!((&truncate!((&_default::BRANCH_KEY_TYPE_PREFIX().cardinality()).clone(), u32)).clone()));
            let mut valueOrError0: Arc<Result<ValidUTF8Bytes, Arc<Error>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&branchKeyVersion).MapFailure::<Arc<Error>>(&({
                        Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<Error>{
                                Arc::new(Error::KeyStoreException {
                                        message: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<BranchKeyMaterials>>()
            } else {
                let mut branchKeyVersionUtf8: ValidUTF8Bytes = valueOrError0.Extract();
                let mut valueOrError1: Arc<Result<Map<ValidUTF8Bytes, ValidUTF8Bytes>, Arc<Error>>> = _default::ExtractCustomEncryptionContext(encryptionContext);
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<BranchKeyMaterials>>()
                } else {
                    let mut customEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = valueOrError1.Extract();
                    Arc::new(Result::<Arc<BranchKeyMaterials>, Arc<Error>>::Success {
                            value: Arc::new(BranchKeyMaterials::BranchKeyMaterials {
                                        branchKeyIdentifier: encryptionContext.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD()),
                                        branchKeyVersion: branchKeyVersionUtf8.clone(),
                                        encryptionContext: customEncryptionContext.clone(),
                                        branchKey: plaintextKey.clone()
                                    })
                        })
                }
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(242,3)
        pub fn ToBeaconKeyMaterials(encryptionContext: &BranchKeyContext, plaintextKey: &Sequence<u8>) -> Arc<Result<Arc<BeaconKeyMaterials>, Arc<Error>>> {
            let mut valueOrError0: Arc<Result<Map<ValidUTF8Bytes, ValidUTF8Bytes>, Arc<Error>>> = _default::ExtractCustomEncryptionContext(encryptionContext);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<BeaconKeyMaterials>>()
            } else {
                let mut customEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes> = valueOrError0.Extract();
                Arc::new(Result::<Arc<BeaconKeyMaterials>, Arc<Error>>::Success {
                        value: Arc::new(BeaconKeyMaterials::BeaconKeyMaterials {
                                    beaconKeyIdentifier: encryptionContext.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD()),
                                    encryptionContext: customEncryptionContext.clone(),
                                    beaconKey: Arc::new(Option::<Sequence<u8>>::Some {
                                                value: plaintextKey.clone()
                                            }),
                                    hmacKeys: Arc::new(Option::<Map<Sequence<DafnyCharUTF16>, Sequence<u8>>>::None {})
                                })
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(258,3)
        pub fn ExtractCustomEncryptionContext(encryptionContext: &BranchKeyContext) -> Arc<Result<Map<ValidUTF8Bytes, ValidUTF8Bytes>, Arc<Error>>> {
            let mut prefixKeys: Set<Sequence<DafnyCharUTF16>> = (&({
                    let mut encryptionContext = encryptionContext.clone();
                    Arc::new(move || -> Set<Sequence<DafnyCharUTF16>>{
                            let mut _coll0: SetBuilder<Sequence<DafnyCharUTF16>> = SetBuilder::<Sequence<DafnyCharUTF16>>::new();
                            for __compr_0 in (&encryptionContext.keys()).iter().cloned() {
                                let mut k: Sequence<DafnyCharUTF16> = __compr_0.clone();
                                if encryptionContext.keys().contains(&k) && _default::ENCRYPTION_CONTEXT_PREFIX() <= k.clone() {
                                    _coll0.add(&k)
                                }
                            }
                            _coll0.build()
                        })
                }))();
            let mut encodedEncryptionContext: Set<(Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>, Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>)> = (&({
                    let mut prefixKeys = prefixKeys.clone();
                    let mut encryptionContext = encryptionContext.clone();
                    Arc::new(move || -> Set<(Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>, Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>)>{
                            let mut _coll1: SetBuilder<(Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>, Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>)> = SetBuilder::<(Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>, Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>)>::new();
                            for __compr_1 in (&prefixKeys).iter().cloned() {
                                let mut k: Sequence<DafnyCharUTF16> = __compr_1.clone();
                                if prefixKeys.contains(&k) {
                                    _coll1.add(&((
                                            crate::implementation_from_dafny::UTF8::_default::Encode(&k.drop(&int!((&truncate!((&_default::ENCRYPTION_CONTEXT_PREFIX().cardinality()).clone(), u32)).clone()))),
                                            crate::implementation_from_dafny::UTF8::_default::Encode(&encryptionContext.get(&k))
                                        )))
                                }
                            }
                            _coll1.build()
                        })
                }))();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>((&encodedEncryptionContext).iter().all(({
                            let mut encodedEncryptionContext = encodedEncryptionContext.clone();
                            Arc::new(move |__forall_var_0: &(Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>, Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>)| -> bool{
                                    let mut i: (Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>, Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>) = __forall_var_0.clone();
                                    !encodedEncryptionContext.contains(&i) || matches!((&i.0.clone()).as_ref(), Success{ .. }) && matches!((&i.1.clone()).as_ref(), Success{ .. })
                                })
                        }).as_ref()), &Arc::new(Error::KeyStoreException {
                            message: string_utf16_of("Unable to encode string")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>()
            } else {
                Arc::new(Result::<Map<ValidUTF8Bytes, ValidUTF8Bytes>, Arc<Error>>::Success {
                        value: (&({
                                let mut encodedEncryptionContext = encodedEncryptionContext.clone();
                                Arc::new(move || -> Map<ValidUTF8Bytes, ValidUTF8Bytes>{
                                        let mut _coll2: MapBuilder<ValidUTF8Bytes, ValidUTF8Bytes> = MapBuilder::<ValidUTF8Bytes, ValidUTF8Bytes>::new();
                                        for __compr_2 in (&encodedEncryptionContext).iter().cloned() {
                                            let mut i: (Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>, Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>>) = __compr_2.clone();
                                            if encodedEncryptionContext.contains(&i) {
                                                _coll2.add(i.0.clone().value(), i.1.clone().value())
                                            }
                                        }
                                        _coll2.build()
                                    })
                            }))()
                    })
            }
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(305,3)
        pub fn DecryptOnlyBranchKeyEncryptionContext(branchKeyId: &Sequence<DafnyCharUTF16>, branchKeyVersion: &Sequence<DafnyCharUTF16>, timestamp: &Sequence<DafnyCharUTF16>, logicalKeyStoreName: &Sequence<DafnyCharUTF16>, kmsKeyArn: &Sequence<DafnyCharUTF16>, customEncryptionContext: &Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>) -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> {
            map![(_default::BRANCH_KEY_IDENTIFIER_FIELD()) => (branchKeyId.clone()), (_default::TYPE_FIELD()) => (_default::BRANCH_KEY_TYPE_PREFIX().concat(branchKeyVersion)), (_default::KEY_CREATE_TIME()) => (timestamp.clone()), (_default::TABLE_FIELD()) => (logicalKeyStoreName.clone()), (_default::KMS_FIELD()) => (kmsKeyArn.clone()), (_default::HIERARCHY_VERSION()) => (string_utf16_of("1"))].merge(&(&({
                    let mut customEncryptionContext = customEncryptionContext.clone();
                    Arc::new(move || -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>{
                            let mut _coll0: MapBuilder<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> = MapBuilder::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::new();
                            for __compr_0 in (&customEncryptionContext).keys().iter().cloned() {
                                let mut k: Sequence<DafnyCharUTF16> = __compr_0.clone();
                                if customEncryptionContext.contains(&k) {
                                    _coll0.add(&_default::ENCRYPTION_CONTEXT_PREFIX().concat(&k), &customEncryptionContext.get(&k))
                                }
                            }
                            _coll0.build()
                        })
                }))())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(349,3)
        pub fn ActiveBranchKeyEncryptionContext(decryptOnlyEncryptionContext: &Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>) -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> {
            decryptOnlyEncryptionContext.merge(&map![(_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) => (decryptOnlyEncryptionContext.get(&_default::TYPE_FIELD())), (_default::TYPE_FIELD()) => (_default::BRANCH_KEY_ACTIVE_TYPE())])
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(365,3)
        pub fn BeaconKeyEncryptionContext(decryptOnlyEncryptionContext: &Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>) -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> {
            decryptOnlyEncryptionContext.merge(&map![(_default::TYPE_FIELD()) => (_default::BEACON_KEY_TYPE_VALUE())])
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(380,3)
        pub fn NewVersionFromActiveBranchKeyEncryptionContext(activeBranchKeyEncryptionContext: &Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>, branchKeyVersion: &Sequence<DafnyCharUTF16>, timestamp: &Sequence<DafnyCharUTF16>) -> Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>> {
            activeBranchKeyEncryptionContext.merge(&map![(_default::TYPE_FIELD()) => (_default::BRANCH_KEY_TYPE_PREFIX().concat(branchKeyVersion)), (_default::KEY_CREATE_TIME()) => (timestamp.clone())]).subtract(&set!{_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()})
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(410,3)
        pub fn _BranchKeyItem_q(m: &Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>) -> bool {
            m.contains(&_default::BRANCH_KEY_IDENTIFIER_FIELD()) && matches!((&m.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD())).as_ref(), S{ .. }) && m.contains(&_default::TYPE_FIELD()) && matches!((&m.get(&_default::TYPE_FIELD())).as_ref(), S{ .. }) && m.contains(&_default::KEY_CREATE_TIME()) && matches!((&m.get(&_default::KEY_CREATE_TIME())).as_ref(), S{ .. }) && m.contains(&_default::HIERARCHY_VERSION()) && matches!((&m.get(&_default::HIERARCHY_VERSION())).as_ref(), N{ .. }) && !m.contains(&_default::TABLE_FIELD()) && m.contains(&_default::KMS_FIELD()) && matches!((&m.get(&_default::KMS_FIELD())).as_ref(), S{ .. }) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_KeyIdType(m.get(&_default::KMS_FIELD()).S()) && m.contains(&_default::BRANCH_KEY_FIELD()) && matches!((&m.get(&_default::BRANCH_KEY_FIELD())).as_ref(), B{ .. }) && 0 < truncate!(m.get(&_default::BRANCH_KEY_IDENTIFIER_FIELD()).S().cardinality(), u64) && 0 < truncate!(m.get(&_default::TYPE_FIELD()).S().cardinality(), u64) && (&m.keys().subtract(&set!{_default::BRANCH_KEY_FIELD(), _default::HIERARCHY_VERSION()})).iter().all(({
                    let mut m = m.clone();
                    Arc::new(move |__forall_var_0: &Sequence<DafnyCharUTF16>| -> bool{
                            let mut k: Sequence<DafnyCharUTF16> = __forall_var_0.clone();
                            !m.keys().subtract(&set!{_default::BRANCH_KEY_FIELD(), _default::HIERARCHY_VERSION()}).contains(&k) || matches!((&m.get(&k)).as_ref(), S{ .. })
                        })
                }).as_ref()) && m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) == (true && m.get(&_default::TYPE_FIELD()).S().clone() == _default::BRANCH_KEY_ACTIVE_TYPE()) && (!m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) || true && _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()).S().clone()) && !m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) == (m.get(&_default::TYPE_FIELD()).S().clone() == _default::BEACON_KEY_TYPE_VALUE() || _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::TYPE_FIELD()).S().clone()) && crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::_default::IsValid_CiphertextType(m.get(&_default::BRANCH_KEY_FIELD()).B())
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(437,3)
        pub fn _ActiveBranchKeyItem_q(m: &Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>) -> bool {
            _default::_BranchKeyItem_q(m) && m.get(&_default::TYPE_FIELD()).S().clone() == _default::BRANCH_KEY_ACTIVE_TYPE() && m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) && matches!((&m.get(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD())).as_ref(), S{ .. }) && _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()).S().clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(445,3)
        pub fn _VersionBranchKeyItem_q(m: &Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>) -> bool {
            _default::_BranchKeyItem_q(m) && !m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) && _default::BRANCH_KEY_TYPE_PREFIX() < m.get(&_default::TYPE_FIELD()).S().clone()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(452,3)
        pub fn _BeaconKeyItem_q(m: &Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>) -> bool {
            _default::_BranchKeyItem_q(m) && !m.contains(&_default::BRANCH_KEY_ACTIVE_VERSION_FIELD()) && m.get(&_default::TYPE_FIELD()).S().clone() == _default::BEACON_KEY_TYPE_VALUE()
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(18,3)
        pub fn BRANCH_KEY_IDENTIFIER_FIELD() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("branch-key-id")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(19,3)
        pub fn TYPE_FIELD() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("type")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(20,3)
        pub fn KEY_CREATE_TIME() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("create-time")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(21,3)
        pub fn HIERARCHY_VERSION() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("hierarchy-version")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(22,3)
        pub fn TABLE_FIELD() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("tablename")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(23,3)
        pub fn KMS_FIELD() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("kms-arn")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(25,3)
        pub fn BRANCH_KEY_FIELD() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("enc")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(26,3)
        pub fn BRANCH_KEY_ACTIVE_VERSION_FIELD() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("version")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(29,3)
        pub fn BRANCH_KEY_ACTIVE_TYPE() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("branch:ACTIVE")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(28,3)
        pub fn BRANCH_KEY_TYPE_PREFIX() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("branch:version:")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(30,3)
        pub fn BEACON_KEY_TYPE_VALUE() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("beacon:ACTIVE")
        }
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(31,3)
        pub fn ENCRYPTION_CONTEXT_PREFIX() -> Sequence<DafnyCharUTF16> {
            string_utf16_of("aws-crypto-ec:")
        }
    }

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(38,3)
    pub type BranchKeyContext = Map<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(402,3)
    pub type BranchKeyItem = Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(436,3)
    pub type ActiveBranchKeyItem = Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(444,3)
    pub type VersionBranchKeyItem = Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>;

    /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographyKeyStore/src/Structure.dfy(451,3)
    pub type BeaconKeyItem = Map<Sequence<DafnyCharUTF16>, Arc<AttributeValue>>;
}
/// dafny/AwsEncryptionSdk/test/TestCreateEsdkClient.dfy(6,1)
pub mod _TestCreateEsdkClient_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::AwsEncryptionSdkConfig;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::IAwsEncryptionSdkClient;
    pub use ::dafny_runtime::upcast_object;
    pub use ::dafny_runtime::cast_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKCommitmentPolicy;
    pub use ::dafny_runtime::rd;
    pub use ::dafny_runtime::DafnyPrintWrapper;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::NetV4_0_0_RetryPolicy;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::seq;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IAwsCryptographicMaterialProvidersClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawAesKeyringInput;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::Zero;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AesWrappingAlg;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/test/TestCreateEsdkClient.dfy(52,3)
        pub fn TestClientCreation() -> () {
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<dyn IAwsEncryptionSdkClient> = upcast_object::<ESDKClient, dyn IAwsEncryptionSdkClient>()(valueOrError0.Extract());
            if !({
                    let __is_41: Object<dyn IAwsEncryptionSdkClient> = esdk.clone();
                    __is_41.clone().is_instance_of::<ESDKClient>()
                }) {
                panic!("Halt")
            };
            let mut esdkClient: Object<ESDKClient> = cast_object!(esdk.clone(), ESDKClient);
            let mut _e00: Arc<ESDKCommitmentPolicy> = rd!(esdkClient.clone()).config().clone().commitmentPolicy().clone();
            let mut _e10: Arc<ESDKCommitmentPolicy> = defaultConfig.commitmentPolicy().value().clone();
            if !(_e00.clone() == _e10.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e00));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e10));
                panic!("Halt")
            };
            let mut _e01: Arc<Option<CountingNumbers>> = rd!(esdkClient.clone()).config().clone().maxEncryptedDataKeys().clone();
            let mut _e11: Arc<Option<CountingNumbers>> = defaultConfig.maxEncryptedDataKeys().clone();
            if !(_e01.clone() == _e11.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e01));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e11));
                panic!("Halt")
            };
            let mut _e02: Arc<NetV4_0_0_RetryPolicy> = rd!(esdkClient.clone()).config().clone().netV4_0_0_RetryPolicy().clone();
            let mut _e12: Arc<NetV4_0_0_RetryPolicy> = Arc::new(NetV4_0_0_RetryPolicy::ALLOW_RETRY {});
            if !(_e02.clone() == _e12.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e02));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e12));
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestCreateEsdkClient.dfy(64,3)
        pub fn TestNetRetryFlag() -> () {
            let mut valueOrError0: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError0.Extract();
            let mut keyNamespace: Sequence<DafnyCharUTF16> = string_utf16_of("Some managed raw keys");
            let mut keyName: Sequence<DafnyCharUTF16> = string_utf16_of("My 256-bit AES wrapping key");
            let mut expectedMessage: Sequence<u8> = seq![84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 116, 101, 115, 116, 46];
            let mut valueOrError1: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRawAesKeyring(rd!(mpl.clone()), &Arc::new(CreateRawAesKeyringInput::CreateRawAesKeyringInput {
                            keyNamespace: keyNamespace.clone(),
                            keyName: keyName.clone(),
                            wrappingKey: {
                                    let _initializer = {
                                            Arc::new(move |i: &DafnyInt| -> u8{
                                                    0
                                                })
                                        };
                                    integer_range(Zero::zero(), int!(32)).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                                },
                            wrappingAlg: Arc::new(AesWrappingAlg::ALG_AES256_GCM_IV12_TAG16 {})
                        }));
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut rawAesKeyring: Object<dyn IKeyring> = valueOrError1.Extract();
            let mut esdkConfig: Arc<AwsEncryptionSdkConfig> = Arc::new(AwsEncryptionSdkConfig::AwsEncryptionSdkConfig {
                        commitmentPolicy: Arc::new(Option::<Arc<ESDKCommitmentPolicy>>::Some {
                                    value: Arc::new(ESDKCommitmentPolicy::REQUIRE_ENCRYPT_REQUIRE_DECRYPT {})
                                }),
                        maxEncryptedDataKeys: Arc::new(Option::<CountingNumbers>::None {}),
                        netV4_0_0_RetryPolicy: Arc::new(Option::<Arc<NetV4_0_0_RetryPolicy>>::Some {
                                    value: Arc::new(NetV4_0_0_RetryPolicy::FORBID_RETRY {})
                                })
                    });
            let mut valueOrError2: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out2: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&esdkConfig);
            valueOrError2 = _out2.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut noRetryEsdk: Object<ESDKClient> = valueOrError2.Extract();
            let mut expectFailureDecryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(noRetryEsdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: _default::ESDK_NET_V400_MESSAGE(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rawAesKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::None {})
                        }));
            expectFailureDecryptOutput = _out3.clone();
            if !matches!((&expectFailureDecryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError3: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError3 = _out4.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError3.Extract();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out5: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: _default::ESDK_NET_V400_MESSAGE(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rawAesKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::None {})
                        }));
            decryptOutput = _out5.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut _e00: Sequence<u8> = decryptOutput.value().plaintext().clone();
            let mut _e10: Sequence<u8> = expectedMessage.clone();
            if !(_e00.clone() == _e10.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e00));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e10));
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestCreateEsdkClient.dfy(22,3)
        pub fn ESDK_NET_V400_MESSAGE() -> Sequence<u8> {
            seq![2, 5, 120, 238, 5, 239, 107, 129, 136, 211, 103, 75, 18, 140, 11, 74, 26, 191, 92, 27, 202, 170, 33, 28, 9, 117, 252, 29, 29, 92, 213, 21, 231, 172, 234, 0, 95, 0, 1, 0, 21, 97, 119, 115, 45, 99, 114, 121, 112, 116, 111, 45, 112, 117, 98, 108, 105, 99, 45, 107, 101, 121, 0, 68, 65, 119, 102, 117, 103, 90, 99, 107, 57, 116, 100, 53, 104, 78, 108, 49, 78, 108, 75, 111, 47, 104, 105, 114, 53, 85, 47, 48, 81, 109, 98, 73, 111, 107, 79, 72, 81, 87, 97, 72, 83, 43, 115, 117, 119, 75, 73, 77, 82, 76, 99, 67, 80, 49, 54, 55, 56, 43, 49, 82, 75, 49, 48, 82, 101, 119, 61, 61, 0, 1, 0, 21, 83, 111, 109, 101, 32, 109, 97, 110, 97, 103, 101, 100, 32, 114, 97, 119, 32, 107, 101, 121, 115, 0, 47, 77, 121, 32, 50, 53, 54, 45, 98, 105, 116, 32, 65, 69, 83, 32, 119, 114, 97, 112, 112, 105, 110, 103, 32, 107, 101, 121, 0, 0, 0, 128, 0, 0, 0, 12, 229, 254, 197, 205, 110, 124, 222, 48, 217, 121, 252, 11, 0, 48, 64, 60, 232, 232, 76, 229, 15, 118, 224, 152, 79, 93, 113, 166, 255, 172, 255, 148, 185, 150, 195, 179, 78, 52, 186, 38, 216, 48, 118, 45, 113, 204, 71, 102, 116, 148, 199, 109, 178, 19, 2, 203, 150, 201, 65, 32, 199, 180, 2, 0, 0, 16, 0, 67, 72, 208, 112, 230, 137, 188, 187, 0, 28, 183, 198, 192, 45, 248, 108, 2, 129, 34, 42, 59, 155, 70, 117, 182, 216, 239, 27, 210, 78, 62, 104, 181, 247, 141, 50, 133, 42, 72, 200, 185, 57, 20, 49, 193, 240, 171, 140, 255, 255, 255, 255, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 15, 67, 37, 106, 11, 15, 23, 78, 239, 208, 185, 4, 36, 182, 9, 63, 62, 83, 97, 42, 250, 252, 185, 165, 14, 182, 231, 83, 176, 227, 191, 92, 0, 103, 48, 101, 2, 49, 0, 193, 152, 7, 169, 197, 137, 244, 88, 9, 1, 6, 56, 96, 13, 220, 201, 56, 16, 50, 68, 70, 36, 174, 38, 14, 241, 207, 11, 139, 154, 166, 224, 191, 20, 12, 175, 56, 117, 183, 120, 119, 228, 173, 130, 71, 110, 211, 189, 2, 48, 99, 98, 250, 36, 53, 182, 2, 204, 198, 55, 150, 51, 159, 101, 231, 34, 42, 30, 57, 204, 88, 114, 138, 94, 12, 79, 52, 71, 178, 34, 61, 246, 55, 163, 145, 95, 80, 61, 85, 143, 32, 0, 98, 20, 88, 251, 204, 5]
        }
    }

    /// dafny/AwsEncryptionSdk/test/TestCreateEsdkClient.dfy(52,3)
    #[test]
    pub fn TestClientCreation() {
        _default::TestClientCreation()
    }

    /// dafny/AwsEncryptionSdk/test/TestCreateEsdkClient.dfy(64,3)
    #[test]
    pub fn TestNetRetryFlag() {
        _default::TestNetRetryFlag()
    }
}
/// dafny/AwsEncryptionSdk/test/TestEncryptDecrypt.dfy(8,1)
pub mod _TestEncryptDecrypt_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::seq;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::AwsEncryptionSdkConfig;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IAwsCryptographicMaterialProvidersClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultClientSupplierInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsKeyringInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::IAwsEncryptionSdkClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptInput;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::FrameLength;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptInput;
    pub use ::dafny_runtime::DafnyPrintWrapper;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/test/TestEncryptDecrypt.dfy(17,3)
        pub fn TestEncryptDecrypt() -> () {
            let mut kmsKey: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_Fixtures_Compile::_default::keyArn();
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultClientSupplier(rd!(mpl.clone()), &Arc::new(CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput {}));
            valueOrError2 = _out2.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut clientSupplier: Object<dyn IClientSupplier> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput {
                            region: string_utf16_of("us-west-2")
                        }));
            valueOrError3 = _out3.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut kmsClient: Object<dyn IKMSClient> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateAwsKmsKeyring(rd!(mpl.clone()), &Arc::new(CreateAwsKmsKeyringInput::CreateAwsKmsKeyringInput {
                            kmsKeyId: kmsKey.clone(),
                            kmsClient: kmsClient.clone(),
                            grantTokens: Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::None {})
                        }));
            valueOrError4 = _out4.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            let mut kmsKeyring: Object<dyn IKeyring> = valueOrError4.Extract();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out5: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::None {}),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out5.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::None {})
                        }));
            decryptOutput = _out6.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut cycledPlaintext: Sequence<u8> = decryptOutput.value().plaintext().clone();
            let mut _e00: Sequence<u8> = cycledPlaintext.clone();
            let mut _e10: Sequence<u8> = asdf.clone();
            if !(_e00.clone() == _e10.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e00));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e10));
                panic!("Halt")
            };
            return ();
        }
    }

    /// dafny/AwsEncryptionSdk/test/TestEncryptDecrypt.dfy(17,3)
    #[test]
    pub fn TestEncryptDecrypt() {
        _default::TestEncryptDecrypt()
    }
}
/// dafny/AwsEncryptionSdk/test/TestReproducedEncContext.dfy(8,1)
pub mod _TestReproducedEncryptionContext_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::seq;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::AwsEncryptionSdkConfig;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IAwsCryptographicMaterialProvidersClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultClientSupplierInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsKeyringInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::_Fixtures_Compile::SmallEncryptionContextVariation;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::IAwsEncryptionSdkClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::FrameLength;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptInput;
    pub use ::dafny_runtime::DafnyPrintWrapper;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawAesKeyringInput;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::Zero;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AesWrappingAlg;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/test/TestReproducedEncContext.dfy(17,3)
        pub fn TestEncryptionContextOnDecrypt() -> () {
            let mut kmsKey: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_Fixtures_Compile::_default::keyArn();
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultClientSupplier(rd!(mpl.clone()), &Arc::new(CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput {}));
            valueOrError2 = _out2.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut clientSupplier: Object<dyn IClientSupplier> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput {
                            region: string_utf16_of("us-west-2")
                        }));
            valueOrError3 = _out3.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut kmsClient: Object<dyn IKMSClient> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateAwsKmsKeyring(rd!(mpl.clone()), &Arc::new(CreateAwsKmsKeyringInput::CreateAwsKmsKeyringInput {
                            kmsKeyId: kmsKey.clone(),
                            kmsClient: kmsClient.clone(),
                            grantTokens: Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::None {})
                        }));
            valueOrError4 = _out4.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            let mut kmsKeyring: Object<dyn IKeyring> = valueOrError4.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out5: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::AB {}));
            encryptionContext = _out5.clone();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out6.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out7: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out7.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut cycledPlaintext: Sequence<u8> = decryptOutput.value().plaintext().clone();
            let mut _e00: Sequence<u8> = cycledPlaintext.clone();
            let mut _e10: Sequence<u8> = asdf.clone();
            if !(_e00.clone() == _e10.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e00));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e10));
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestReproducedEncContext.dfy(64,3)
        pub fn TestEncryptionContextOnDecryptFailure() -> () {
            let mut kmsKey: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_Fixtures_Compile::_default::keyArn();
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultClientSupplier(rd!(mpl.clone()), &Arc::new(CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput {}));
            valueOrError2 = _out2.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut clientSupplier: Object<dyn IClientSupplier> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput {
                            region: string_utf16_of("us-west-2")
                        }));
            valueOrError3 = _out3.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut kmsClient: Object<dyn IKMSClient> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateAwsKmsKeyring(rd!(mpl.clone()), &Arc::new(CreateAwsKmsKeyringInput::CreateAwsKmsKeyringInput {
                            kmsKeyId: kmsKey.clone(),
                            kmsClient: kmsClient.clone(),
                            grantTokens: Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::None {})
                        }));
            valueOrError4 = _out4.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            let mut kmsKeyring: Object<dyn IKeyring> = valueOrError4.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out5: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::A {}));
            encryptionContext = _out5.clone();
            let mut incorrectReproducedEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out6: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::AB {}));
            incorrectReproducedEncryptionContext = _out6.clone();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out7: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out7.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out8: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: incorrectReproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out8.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestReproducedEncContext.dfy(110,3)
        pub fn TestMismatchedEncryptionContextOnDecrypt() -> () {
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut namespace: Sequence<DafnyCharUTF16>;
            let mut name: Sequence<DafnyCharUTF16>;
            let mut _out0: Sequence<DafnyCharUTF16>;
            let mut _out1: Sequence<DafnyCharUTF16>;
            let _x = crate::implementation_from_dafny::_Fixtures_Compile::_default::NamespaceAndName(&int!(0));
            _out0 = _x.0;
            _out1 = _x.1;
            namespace = _out0.clone();
            name = _out1.clone();
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out2: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out2.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out3.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRawAesKeyring(rd!(mpl.clone()), &Arc::new(CreateRawAesKeyringInput::CreateRawAesKeyringInput {
                            keyNamespace: namespace.clone(),
                            keyName: name.clone(),
                            wrappingKey: {
                                    let _initializer = {
                                            Arc::new(move |i: &DafnyInt| -> u8{
                                                    0
                                                })
                                        };
                                    integer_range(Zero::zero(), int!(32)).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                                },
                            wrappingAlg: Arc::new(AesWrappingAlg::ALG_AES256_GCM_IV12_TAG16 {})
                        }));
            valueOrError2 = _out4.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut rawAESKeyring: Object<dyn IKeyring> = valueOrError2.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out5: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::A {}));
            encryptionContext = _out5.clone();
            let mut mismatchedEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out6: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallMismatchedEncryptionContex(&Arc::new(SmallEncryptionContextVariation::A {}));
            mismatchedEncryptionContext = _out6.clone();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out7: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rawAESKeyring.clone()
                                    }),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out7.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out8: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rawAESKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: mismatchedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out8.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out9: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rawAESKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out9.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut _out10: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rawAESKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::None {})
                        }));
            decryptOutput = _out10.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            return ();
        }
    }

    /// dafny/AwsEncryptionSdk/test/TestReproducedEncContext.dfy(17,3)
    #[test]
    pub fn TestEncryptionContextOnDecrypt() {
        _default::TestEncryptionContextOnDecrypt()
    }

    /// dafny/AwsEncryptionSdk/test/TestReproducedEncContext.dfy(64,3)
    #[test]
    pub fn TestEncryptionContextOnDecryptFailure() {
        _default::TestEncryptionContextOnDecryptFailure()
    }

    /// dafny/AwsEncryptionSdk/test/TestReproducedEncContext.dfy(110,3)
    #[test]
    pub fn TestMismatchedEncryptionContextOnDecrypt() {
        _default::TestMismatchedEncryptionContextOnDecrypt()
    }
}
/// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(8,1)
pub mod _TestRequiredEncryptionContext_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::seq;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::AwsEncryptionSdkConfig;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::ESDKClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IKeyring;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IAwsCryptographicMaterialProvidersClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateMultiKeyringInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Map;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::_Fixtures_Compile::SmallEncryptionContextVariation;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::IAwsEncryptionSdkClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::EncryptInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ICryptographicMaterialsManager;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::ESDKAlgorithmSuiteId;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::FrameLength;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::DecryptInput;
    pub use ::dafny_runtime::DafnyPrintWrapper;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultCryptographicMaterialsManagerInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRequiredEncryptionContextCMMInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PositiveLong;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::IKMSClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::IDynamoDBClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KMSConfiguration;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::KeyStoreConfig;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::KeyStoreClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsHierarchicalKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IBranchKeyIdSupplier;
    pub use ::dafny_runtime::upcast_object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::IKeyStoreClient;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CacheType;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GenerateRSAKeyPairOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawRsaKeyringInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::PaddingScheme;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateRawAesKeyringInput;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::Zero;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AesWrappingAlg;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::IClientSupplier;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateDefaultClientSupplierInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::GetClientInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::CreateAwsKmsKeyringInput;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(33,3)
        pub fn TestReprEncryptionContextWithSameECHappyCase() -> () {
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut rsaKeyring: Object<dyn IKeyring>;
            let mut _out2: Object<dyn IKeyring> = _default::GetRsaKeyring();
            rsaKeyring = _out2.clone();
            let mut kmsKeyring: Object<dyn IKeyring>;
            let mut _out3: Object<dyn IKeyring> = _default::GetKmsKeyring();
            kmsKeyring = _out3.clone();
            let mut aesKeyring: Object<dyn IKeyring>;
            let mut _out4: Object<dyn IKeyring> = _default::GetAesKeyring();
            aesKeyring = _out4.clone();
            let mut hKeyring: Object<dyn IKeyring>;
            let mut _out5: Object<dyn IKeyring> = _default::GetHierarchicalKeyring();
            hKeyring = _out5.clone();
            let mut valueOrError2: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateMultiKeyring(rd!(mpl.clone()), &Arc::new(CreateMultiKeyringInput::CreateMultiKeyringInput {
                            generator: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            childKeyrings: seq![rsaKeyring.clone(), kmsKeyring.clone(), hKeyring.clone()]
                        }));
            valueOrError2 = _out6.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut multiKeyring: Object<dyn IKeyring> = valueOrError2.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out7: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::AB {}));
            encryptionContext = _out7.clone();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out8: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: multiKeyring.clone()
                                    }),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out8.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out9: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rsaKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out9.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut cycledPlaintext: Sequence<u8> = decryptOutput.value().plaintext().clone();
            let mut _e00: Sequence<u8> = cycledPlaintext.clone();
            let mut _e10: Sequence<u8> = asdf.clone();
            if !(_e00.clone() == _e10.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e00));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e10));
                panic!("Halt")
            };
            let mut _out10: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out10.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e01: Sequence<u8> = cycledPlaintext.clone();
            let mut _e11: Sequence<u8> = asdf.clone();
            if !(_e01.clone() == _e11.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e01));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e11));
                panic!("Halt")
            };
            let mut _out11: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out11.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e02: Sequence<u8> = cycledPlaintext.clone();
            let mut _e12: Sequence<u8> = asdf.clone();
            if !(_e02.clone() == _e12.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e02));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e12));
                panic!("Halt")
            };
            let mut _out12: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: hKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out12.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e03: Sequence<u8> = cycledPlaintext.clone();
            let mut _e13: Sequence<u8> = asdf.clone();
            if !(_e03.clone() == _e13.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e03));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e13));
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(118,3)
        pub fn TestRemoveOnEncryptAndSupplyOnDecryptHappyCase() -> () {
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut rsaKeyring: Object<dyn IKeyring>;
            let mut _out2: Object<dyn IKeyring> = _default::GetRsaKeyring();
            rsaKeyring = _out2.clone();
            let mut kmsKeyring: Object<dyn IKeyring>;
            let mut _out3: Object<dyn IKeyring> = _default::GetKmsKeyring();
            kmsKeyring = _out3.clone();
            let mut aesKeyring: Object<dyn IKeyring>;
            let mut _out4: Object<dyn IKeyring> = _default::GetAesKeyring();
            aesKeyring = _out4.clone();
            let mut hKeyring: Object<dyn IKeyring>;
            let mut _out5: Object<dyn IKeyring> = _default::GetHierarchicalKeyring();
            hKeyring = _out5.clone();
            let mut valueOrError2: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateMultiKeyring(rd!(mpl.clone()), &Arc::new(CreateMultiKeyringInput::CreateMultiKeyringInput {
                            generator: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            childKeyrings: seq![rsaKeyring.clone(), kmsKeyring.clone(), hKeyring.clone()]
                        }));
            valueOrError2 = _out6.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut multiKeyring: Object<dyn IKeyring> = valueOrError2.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out7: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::AB {}));
            encryptionContext = _out7.clone();
            let mut reproducedEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out8: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::A {}));
            reproducedEncryptionContext = _out8.clone();
            let mut requiredEncryptionContextKeys: Sequence<ValidUTF8Bytes>;
            let mut _out9: Sequence<ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContextKeys(&Arc::new(SmallEncryptionContextVariation::A {}));
            requiredEncryptionContextKeys = _out9.clone();
            let mut valueOrError3: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out10: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: multiKeyring.clone()
                        }));
            valueOrError3 = _out10.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut defaultCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out11: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            valueOrError4 = _out11.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            let mut reqCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError4.Extract();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out12: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out12.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out13: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rsaKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out13.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut cycledPlaintext: Sequence<u8> = decryptOutput.value().plaintext().clone();
            let mut _e00: Sequence<u8> = cycledPlaintext.clone();
            let mut _e10: Sequence<u8> = asdf.clone();
            if !(_e00.clone() == _e10.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e00));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e10));
                panic!("Halt")
            };
            let mut _out14: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out14.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e01: Sequence<u8> = cycledPlaintext.clone();
            let mut _e11: Sequence<u8> = asdf.clone();
            if !(_e01.clone() == _e11.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e01));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e11));
                panic!("Halt")
            };
            let mut _out15: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out15.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e02: Sequence<u8> = cycledPlaintext.clone();
            let mut _e12: Sequence<u8> = asdf.clone();
            if !(_e02.clone() == _e12.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e02));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e12));
                panic!("Halt")
            };
            let mut _out16: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: hKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out16.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e03: Sequence<u8> = cycledPlaintext.clone();
            let mut _e13: Sequence<u8> = asdf.clone();
            if !(_e03.clone() == _e13.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e03));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e13));
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(227,3)
        pub fn TestRemoveOnEncryptRemoveAndSupplyOnDecryptHappyCase() -> () {
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut rsaKeyring: Object<dyn IKeyring>;
            let mut _out2: Object<dyn IKeyring> = _default::GetRsaKeyring();
            rsaKeyring = _out2.clone();
            let mut kmsKeyring: Object<dyn IKeyring>;
            let mut _out3: Object<dyn IKeyring> = _default::GetKmsKeyring();
            kmsKeyring = _out3.clone();
            let mut aesKeyring: Object<dyn IKeyring>;
            let mut _out4: Object<dyn IKeyring> = _default::GetAesKeyring();
            aesKeyring = _out4.clone();
            let mut hKeyring: Object<dyn IKeyring>;
            let mut _out5: Object<dyn IKeyring> = _default::GetHierarchicalKeyring();
            hKeyring = _out5.clone();
            let mut valueOrError2: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateMultiKeyring(rd!(mpl.clone()), &Arc::new(CreateMultiKeyringInput::CreateMultiKeyringInput {
                            generator: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            childKeyrings: seq![rsaKeyring.clone(), kmsKeyring.clone(), hKeyring.clone()]
                        }));
            valueOrError2 = _out6.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut multiKeyring: Object<dyn IKeyring> = valueOrError2.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out7: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::AB {}));
            encryptionContext = _out7.clone();
            let mut reproducedEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out8: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::A {}));
            reproducedEncryptionContext = _out8.clone();
            let mut requiredEncryptionContextKeys: Sequence<ValidUTF8Bytes>;
            let mut _out9: Sequence<ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContextKeys(&Arc::new(SmallEncryptionContextVariation::A {}));
            requiredEncryptionContextKeys = _out9.clone();
            let mut valueOrError3: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out10: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: multiKeyring.clone()
                        }));
            valueOrError3 = _out10.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut defaultCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out11: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            valueOrError4 = _out11.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            let mut reqCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError4.Extract();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out12: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out12.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut valueOrError5: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out13: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: rsaKeyring.clone()
                        }));
            valueOrError5 = _out13.clone();
            if !(!valueOrError5.IsFailure()) {
                panic!("Halt")
            };
            defaultCMM = valueOrError5.Extract();
            let mut valueOrError6: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out14: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            valueOrError6 = _out14.clone();
            if !(!valueOrError6.IsFailure()) {
                panic!("Halt")
            };
            reqCMM = valueOrError6.Extract();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out15: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out15.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut cycledPlaintext: Sequence<u8> = decryptOutput.value().plaintext().clone();
            let mut _e00: Sequence<u8> = cycledPlaintext.clone();
            let mut _e10: Sequence<u8> = asdf.clone();
            if !(_e00.clone() == _e10.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e00));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e10));
                panic!("Halt")
            };
            let mut valueOrError7: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out16: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: kmsKeyring.clone()
                        }));
            valueOrError7 = _out16.clone();
            if !(!valueOrError7.IsFailure()) {
                panic!("Halt")
            };
            defaultCMM = valueOrError7.Extract();
            let mut valueOrError8: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out17: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            valueOrError8 = _out17.clone();
            if !(!valueOrError8.IsFailure()) {
                panic!("Halt")
            };
            reqCMM = valueOrError8.Extract();
            let mut _out18: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out18.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e01: Sequence<u8> = cycledPlaintext.clone();
            let mut _e11: Sequence<u8> = asdf.clone();
            if !(_e01.clone() == _e11.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e01));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e11));
                panic!("Halt")
            };
            let mut valueOrError9: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out19: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: aesKeyring.clone()
                        }));
            valueOrError9 = _out19.clone();
            if !(!valueOrError9.IsFailure()) {
                panic!("Halt")
            };
            defaultCMM = valueOrError9.Extract();
            let mut valueOrError10: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out20: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            valueOrError10 = _out20.clone();
            if !(!valueOrError10.IsFailure()) {
                panic!("Halt")
            };
            reqCMM = valueOrError10.Extract();
            let mut _out21: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out21.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e02: Sequence<u8> = cycledPlaintext.clone();
            let mut _e12: Sequence<u8> = asdf.clone();
            if !(_e02.clone() == _e12.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e02));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e12));
                panic!("Halt")
            };
            let mut valueOrError11: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out22: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: hKeyring.clone()
                        }));
            valueOrError11 = _out22.clone();
            if !(!valueOrError11.IsFailure()) {
                panic!("Halt")
            };
            defaultCMM = valueOrError11.Extract();
            let mut valueOrError12: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out23: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            valueOrError12 = _out23.clone();
            if !(!valueOrError12.IsFailure()) {
                panic!("Halt")
            };
            reqCMM = valueOrError12.Extract();
            let mut _out24: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out24.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e03: Sequence<u8> = cycledPlaintext.clone();
            let mut _e13: Sequence<u8> = asdf.clone();
            if !(_e03.clone() == _e13.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e03));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e13));
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(409,3)
        pub fn TestRemoveOnDecryptIsBackwardsCompatibleHappyCase() -> () {
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut rsaKeyring: Object<dyn IKeyring>;
            let mut _out2: Object<dyn IKeyring> = _default::GetRsaKeyring();
            rsaKeyring = _out2.clone();
            let mut kmsKeyring: Object<dyn IKeyring>;
            let mut _out3: Object<dyn IKeyring> = _default::GetKmsKeyring();
            kmsKeyring = _out3.clone();
            let mut aesKeyring: Object<dyn IKeyring>;
            let mut _out4: Object<dyn IKeyring> = _default::GetAesKeyring();
            aesKeyring = _out4.clone();
            let mut hKeyring: Object<dyn IKeyring>;
            let mut _out5: Object<dyn IKeyring> = _default::GetHierarchicalKeyring();
            hKeyring = _out5.clone();
            let mut valueOrError2: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateMultiKeyring(rd!(mpl.clone()), &Arc::new(CreateMultiKeyringInput::CreateMultiKeyringInput {
                            generator: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            childKeyrings: seq![rsaKeyring.clone(), kmsKeyring.clone(), hKeyring.clone()]
                        }));
            valueOrError2 = _out6.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut multiKeyring: Object<dyn IKeyring> = valueOrError2.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out7: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::AB {}));
            encryptionContext = _out7.clone();
            let mut reproducedEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out8: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::A {}));
            reproducedEncryptionContext = _out8.clone();
            let mut requiredEncryptionContextKeys: Sequence<ValidUTF8Bytes>;
            let mut _out9: Sequence<ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContextKeys(&Arc::new(SmallEncryptionContextVariation::A {}));
            requiredEncryptionContextKeys = _out9.clone();
            let mut valueOrError3: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out10: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: multiKeyring.clone()
                        }));
            valueOrError3 = _out10.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut defaultCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError3.Extract();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out11: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out11.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut valueOrError4: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out12: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: rsaKeyring.clone()
                        }));
            valueOrError4 = _out12.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            defaultCMM = valueOrError4.Extract();
            let mut valueOrError5: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out13: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            valueOrError5 = _out13.clone();
            if !(!valueOrError5.IsFailure()) {
                panic!("Halt")
            };
            let mut reqCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError5.Extract();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out14: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out14.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut cycledPlaintext: Sequence<u8> = decryptOutput.value().plaintext().clone();
            let mut _e00: Sequence<u8> = cycledPlaintext.clone();
            let mut _e10: Sequence<u8> = asdf.clone();
            if !(_e00.clone() == _e10.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e00));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e10));
                panic!("Halt")
            };
            let mut valueOrError6: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out15: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: kmsKeyring.clone()
                        }));
            valueOrError6 = _out15.clone();
            if !(!valueOrError6.IsFailure()) {
                panic!("Halt")
            };
            defaultCMM = valueOrError6.Extract();
            let mut valueOrError7: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out16: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            valueOrError7 = _out16.clone();
            if !(!valueOrError7.IsFailure()) {
                panic!("Halt")
            };
            reqCMM = valueOrError7.Extract();
            let mut _out17: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out17.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e01: Sequence<u8> = cycledPlaintext.clone();
            let mut _e11: Sequence<u8> = asdf.clone();
            if !(_e01.clone() == _e11.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e01));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e11));
                panic!("Halt")
            };
            let mut valueOrError8: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out18: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: aesKeyring.clone()
                        }));
            valueOrError8 = _out18.clone();
            if !(!valueOrError8.IsFailure()) {
                panic!("Halt")
            };
            defaultCMM = valueOrError8.Extract();
            let mut valueOrError9: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out19: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            valueOrError9 = _out19.clone();
            if !(!valueOrError9.IsFailure()) {
                panic!("Halt")
            };
            reqCMM = valueOrError9.Extract();
            let mut _out20: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out20.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e02: Sequence<u8> = cycledPlaintext.clone();
            let mut _e12: Sequence<u8> = asdf.clone();
            if !(_e02.clone() == _e12.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e02));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e12));
                panic!("Halt")
            };
            let mut valueOrError10: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out21: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: hKeyring.clone()
                        }));
            valueOrError10 = _out21.clone();
            if !(!valueOrError10.IsFailure()) {
                panic!("Halt")
            };
            defaultCMM = valueOrError10.Extract();
            let mut valueOrError11: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out22: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredEncryptionContextKeys.clone()
                        }));
            valueOrError11 = _out22.clone();
            if !(!valueOrError11.IsFailure()) {
                panic!("Halt")
            };
            reqCMM = valueOrError11.Extract();
            let mut _out23: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out23.clone();
            if !matches!((&decryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            cycledPlaintext = decryptOutput.value().plaintext().clone();
            let mut _e03: Sequence<u8> = cycledPlaintext.clone();
            let mut _e13: Sequence<u8> = asdf.clone();
            if !(_e03.clone() == _e13.clone()) {
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nLeft:\n")));
                print!("{}", DafnyPrintWrapper(&_e03));
                print!("{}", DafnyPrintWrapper(&string_utf16_of("\nRight:\n")));
                print!("{}", DafnyPrintWrapper(&_e13));
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(581,3)
        pub fn TestDifferentECOnDecryptFailure() -> () {
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut rsaKeyring: Object<dyn IKeyring>;
            let mut _out2: Object<dyn IKeyring> = _default::GetRsaKeyring();
            rsaKeyring = _out2.clone();
            let mut kmsKeyring: Object<dyn IKeyring>;
            let mut _out3: Object<dyn IKeyring> = _default::GetKmsKeyring();
            kmsKeyring = _out3.clone();
            let mut aesKeyring: Object<dyn IKeyring>;
            let mut _out4: Object<dyn IKeyring> = _default::GetAesKeyring();
            aesKeyring = _out4.clone();
            let mut hKeyring: Object<dyn IKeyring>;
            let mut _out5: Object<dyn IKeyring> = _default::GetHierarchicalKeyring();
            hKeyring = _out5.clone();
            let mut valueOrError2: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateMultiKeyring(rd!(mpl.clone()), &Arc::new(CreateMultiKeyringInput::CreateMultiKeyringInput {
                            generator: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            childKeyrings: seq![rsaKeyring.clone(), kmsKeyring.clone(), hKeyring.clone()]
                        }));
            valueOrError2 = _out6.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut multiKeyring: Object<dyn IKeyring> = valueOrError2.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out7: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::AB {}));
            encryptionContext = _out7.clone();
            let mut reproducedAdditionalEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out8: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::C {}));
            reproducedAdditionalEncryptionContext = _out8.clone();
            let mut reproducedMismatchedEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out9: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallMismatchedEncryptionContex(&Arc::new(SmallEncryptionContextVariation::AB {}));
            reproducedMismatchedEncryptionContext = _out9.clone();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out10: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: multiKeyring.clone()
                                    }),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out10.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out11: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rsaKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedAdditionalEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out11.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out12: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rsaKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedMismatchedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out12.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out13: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedAdditionalEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out13.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out14: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedMismatchedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out14.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out15: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedAdditionalEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out15.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out16: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedMismatchedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out16.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out17: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: hKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedAdditionalEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out17.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out18: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: hKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: reproducedMismatchedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out18.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(703,3)
        pub fn TestRemoveECAndNotSupplyOnDecryptFailure() -> () {
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut rsaKeyring: Object<dyn IKeyring>;
            let mut _out2: Object<dyn IKeyring> = _default::GetRsaKeyring();
            rsaKeyring = _out2.clone();
            let mut kmsKeyring: Object<dyn IKeyring>;
            let mut _out3: Object<dyn IKeyring> = _default::GetKmsKeyring();
            kmsKeyring = _out3.clone();
            let mut aesKeyring: Object<dyn IKeyring>;
            let mut _out4: Object<dyn IKeyring> = _default::GetAesKeyring();
            aesKeyring = _out4.clone();
            let mut hKeyring: Object<dyn IKeyring>;
            let mut _out5: Object<dyn IKeyring> = _default::GetHierarchicalKeyring();
            hKeyring = _out5.clone();
            let mut valueOrError2: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateMultiKeyring(rd!(mpl.clone()), &Arc::new(CreateMultiKeyringInput::CreateMultiKeyringInput {
                            generator: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            childKeyrings: seq![rsaKeyring.clone(), kmsKeyring.clone(), hKeyring.clone()]
                        }));
            valueOrError2 = _out6.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut multiKeyring: Object<dyn IKeyring> = valueOrError2.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out7: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::AB {}));
            encryptionContext = _out7.clone();
            let mut requiredECKeys: Sequence<ValidUTF8Bytes>;
            let mut _out8: Sequence<ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContextKeys(&Arc::new(SmallEncryptionContextVariation::A {}));
            requiredECKeys = _out8.clone();
            let mut valueOrError3: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out9: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: multiKeyring.clone()
                        }));
            valueOrError3 = _out9.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut defaultCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out10: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredECKeys.clone()
                        }));
            valueOrError4 = _out10.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            let mut reqCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError4.Extract();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out11: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out11.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out12: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rsaKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::None {})
                        }));
            decryptOutput = _out12.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out13: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::None {})
                        }));
            decryptOutput = _out13.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out14: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::None {})
                        }));
            decryptOutput = _out14.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out15: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: hKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::None {})
                        }));
            decryptOutput = _out15.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(806,3)
        pub fn TestRemoveECAndSupplyMismatchedReprECFailure() -> () {
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut rsaKeyring: Object<dyn IKeyring>;
            let mut _out2: Object<dyn IKeyring> = _default::GetRsaKeyring();
            rsaKeyring = _out2.clone();
            let mut kmsKeyring: Object<dyn IKeyring>;
            let mut _out3: Object<dyn IKeyring> = _default::GetKmsKeyring();
            kmsKeyring = _out3.clone();
            let mut aesKeyring: Object<dyn IKeyring>;
            let mut _out4: Object<dyn IKeyring> = _default::GetAesKeyring();
            aesKeyring = _out4.clone();
            let mut hKeyring: Object<dyn IKeyring>;
            let mut _out5: Object<dyn IKeyring> = _default::GetHierarchicalKeyring();
            hKeyring = _out5.clone();
            let mut valueOrError2: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateMultiKeyring(rd!(mpl.clone()), &Arc::new(CreateMultiKeyringInput::CreateMultiKeyringInput {
                            generator: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            childKeyrings: seq![rsaKeyring.clone(), kmsKeyring.clone(), hKeyring.clone()]
                        }));
            valueOrError2 = _out6.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut multiKeyring: Object<dyn IKeyring> = valueOrError2.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out7: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::AB {}));
            encryptionContext = _out7.clone();
            let mut requiredECKeys: Sequence<ValidUTF8Bytes>;
            let mut _out8: Sequence<ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContextKeys(&Arc::new(SmallEncryptionContextVariation::A {}));
            requiredECKeys = _out8.clone();
            let mut mismatchedReproducedEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out9: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallMismatchedEncryptionContex(&Arc::new(SmallEncryptionContextVariation::A {}));
            mismatchedReproducedEncryptionContext = _out9.clone();
            let mut valueOrError3: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out10: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: multiKeyring.clone()
                        }));
            valueOrError3 = _out10.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut defaultCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out11: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredECKeys.clone()
                        }));
            valueOrError4 = _out11.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            let mut reqCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError4.Extract();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out12: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out12.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out13: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rsaKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: mismatchedReproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out13.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out14: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: mismatchedReproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out14.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out15: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: mismatchedReproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out15.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out16: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: hKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: mismatchedReproducedEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out16.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(911,3)
        pub fn TestRemoveECAndSupplyWithMissingRequiredValueDecryptFailure() -> () {
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut rsaKeyring: Object<dyn IKeyring>;
            let mut _out2: Object<dyn IKeyring> = _default::GetRsaKeyring();
            rsaKeyring = _out2.clone();
            let mut kmsKeyring: Object<dyn IKeyring>;
            let mut _out3: Object<dyn IKeyring> = _default::GetKmsKeyring();
            kmsKeyring = _out3.clone();
            let mut aesKeyring: Object<dyn IKeyring>;
            let mut _out4: Object<dyn IKeyring> = _default::GetAesKeyring();
            aesKeyring = _out4.clone();
            let mut hKeyring: Object<dyn IKeyring>;
            let mut _out5: Object<dyn IKeyring> = _default::GetHierarchicalKeyring();
            hKeyring = _out5.clone();
            let mut valueOrError2: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateMultiKeyring(rd!(mpl.clone()), &Arc::new(CreateMultiKeyringInput::CreateMultiKeyringInput {
                            generator: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            childKeyrings: seq![rsaKeyring.clone(), kmsKeyring.clone(), hKeyring.clone()]
                        }));
            valueOrError2 = _out6.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut multiKeyring: Object<dyn IKeyring> = valueOrError2.Extract();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out7: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::AB {}));
            encryptionContext = _out7.clone();
            let mut requiredECKeys: Sequence<ValidUTF8Bytes>;
            let mut _out8: Sequence<ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContextKeys(&Arc::new(SmallEncryptionContextVariation::A {}));
            requiredECKeys = _out8.clone();
            let mut droppedRequiredKeyEncryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out9: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::SmallEncryptionContext(&Arc::new(SmallEncryptionContextVariation::B {}));
            droppedRequiredKeyEncryptionContext = _out9.clone();
            let mut valueOrError3: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out10: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: multiKeyring.clone()
                        }));
            valueOrError3 = _out10.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut defaultCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out11: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredECKeys.clone()
                        }));
            valueOrError4 = _out11.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            let mut reqCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError4.Extract();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out12: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out12.clone();
            if !matches!((&encryptOutput).as_ref(), Success{ .. }) {
                panic!("Halt")
            };
            let mut esdkCiphertext: Sequence<u8> = encryptOutput.value().ciphertext().clone();
            let mut decryptOutput: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out13: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: rsaKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: droppedRequiredKeyEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out13.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out14: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: kmsKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: droppedRequiredKeyEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out14.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out15: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: aesKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: droppedRequiredKeyEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out15.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            let mut _out16: Arc<Result<Arc<DecryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Decrypt(rd!(esdk.clone()), &Arc::new(DecryptInput::DecryptInput {
                            ciphertext: esdkCiphertext.clone(),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::None {}),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::Some {
                                        value: hKeyring.clone()
                                    }),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: droppedRequiredKeyEncryptionContext.clone()
                                    })
                        }));
            decryptOutput = _out16.clone();
            if !matches!((&decryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(1016,3)
        pub fn TestReservedEncryptionContextKeyFailure() -> () {
            let mut asdf: Sequence<u8> = seq![97, 115, 100, 102];
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut rsaKeyring: Object<dyn IKeyring>;
            let mut _out2: Object<dyn IKeyring> = _default::GetRsaKeyring();
            rsaKeyring = _out2.clone();
            let mut encryptionContext: Map<ValidUTF8Bytes, ValidUTF8Bytes>;
            let mut _out3: Map<ValidUTF8Bytes, ValidUTF8Bytes> = crate::implementation_from_dafny::_Fixtures_Compile::_default::GetResrvedECMap();
            encryptionContext = _out3.clone();
            let mut requiredECKeys: Sequence<ValidUTF8Bytes> = seq![crate::implementation_from_dafny::_Fixtures_Compile::_default::RESERVED_ENCRYPTION_CONTEXT()];
            let mut valueOrError2: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultCryptographicMaterialsManager(rd!(mpl.clone()), &Arc::new(CreateDefaultCryptographicMaterialsManagerInput::CreateDefaultCryptographicMaterialsManagerInput {
                            keyring: rsaKeyring.clone()
                        }));
            valueOrError2 = _out4.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut defaultCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out5: Arc<Result<Object<dyn ICryptographicMaterialsManager>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRequiredEncryptionContextCMM(rd!(mpl.clone()), &Arc::new(CreateRequiredEncryptionContextCMMInput::CreateRequiredEncryptionContextCMMInput {
                            underlyingCMM: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: defaultCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            requiredEncryptionContextKeys: requiredECKeys.clone()
                        }));
            valueOrError3 = _out5.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut reqCMM: Object<dyn ICryptographicMaterialsManager> = valueOrError3.Extract();
            let mut encryptOutput: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out6: Arc<Result<Arc<EncryptOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = IAwsEncryptionSdkClient::Encrypt(rd!(esdk.clone()), &Arc::new(EncryptInput::EncryptInput {
                            plaintext: asdf.clone(),
                            encryptionContext: Arc::new(Option::<Map<ValidUTF8Bytes, ValidUTF8Bytes>>::Some {
                                        value: encryptionContext.clone()
                                    }),
                            materialsManager: Arc::new(Option::<Object<dyn ICryptographicMaterialsManager>>::Some {
                                        value: reqCMM.clone()
                                    }),
                            keyring: Arc::new(Option::<Object<dyn IKeyring>>::None {}),
                            algorithmSuiteId: Arc::new(Option::<Arc<ESDKAlgorithmSuiteId>>::None {}),
                            frameLength: Arc::new(Option::<FrameLength>::None {})
                        }));
            encryptOutput = _out6.clone();
            if !matches!((&encryptOutput).as_ref(), Failure{ .. }) {
                panic!("Halt")
            };
            return ();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(1064,3)
        pub fn GetHierarchicalKeyring() -> Object<dyn IKeyring> {
            let mut output = MaybePlacebo::<Object<dyn IKeyring>>::new();
            let mut branchKeyId: Sequence<DafnyCharUTF16> = _default::BRANCH_KEY_ID();
            let mut ttl: PositiveLong = 1 * 60000 * 10;
            let mut valueOrError0: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::services::kms::internaldafny::_default::KMSClient();
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut kmsClient: Object<dyn IKMSClient> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<Object<dyn IDynamoDBClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>>;
            let mut _out2: Arc<Result<Object<dyn IDynamoDBClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::services::dynamodb::internaldafny::_default::DynamoDBClient();
            valueOrError2 = _out2.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut ddbClient: Object<dyn IDynamoDBClient> = valueOrError2.Extract();
            let mut kmsConfig: Arc<KMSConfiguration> = Arc::new(KMSConfiguration::kmsKeyArn {
                        kmsKeyArn: _default::hierarchyKeyArn()
                    });
            let mut keyStoreConfig: Arc<KeyStoreConfig> = Arc::new(KeyStoreConfig::KeyStoreConfig {
                        ddbTableName: _default::branchKeyStoreName(),
                        kmsConfiguration: kmsConfig.clone(),
                        logicalKeyStoreName: _default::logicalKeyStoreName(),
                        id: Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {}),
                        grantTokens: Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::None {}),
                        ddbClient: Arc::new(Option::<Object<dyn IDynamoDBClient>>::Some {
                                    value: ddbClient.clone()
                                }),
                        kmsClient: Arc::new(Option::<Object<dyn IKMSClient>>::Some {
                                    value: kmsClient.clone()
                                })
                    });
            let mut valueOrError3: Arc<Result<Object<KeyStoreClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<Object<KeyStoreClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::keystore::internaldafny::_default::KeyStore(&keyStoreConfig);
            valueOrError3 = _out3.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut keyStore: Object<KeyStoreClient> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateAwsKmsHierarchicalKeyring(rd!(mpl.clone()), &Arc::new(CreateAwsKmsHierarchicalKeyringInput::CreateAwsKmsHierarchicalKeyringInput {
                            branchKeyId: Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                                        value: branchKeyId.clone()
                                    }),
                            branchKeyIdSupplier: Arc::new(Option::<Object<dyn IBranchKeyIdSupplier>>::None {}),
                            keyStore: upcast_object::<KeyStoreClient, dyn IKeyStoreClient>()(keyStore.clone()),
                            ttlSeconds: ttl,
                            cache: Arc::new(Option::<Arc<CacheType>>::None {}),
                            partitionId: Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {})
                        }));
            valueOrError4 = _out4.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            output = MaybePlacebo::from(valueOrError4.Extract());
            return output.read();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(1098,3)
        pub fn GetRsaKeyring() -> Object<dyn IKeyring> {
            let mut output = MaybePlacebo::<Object<dyn IKeyring>>::new();
            let mut valueOrError0: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError0.Extract();
            let mut namespace: Sequence<DafnyCharUTF16>;
            let mut name: Sequence<DafnyCharUTF16>;
            let mut _out1: Sequence<DafnyCharUTF16>;
            let mut _out2: Sequence<DafnyCharUTF16>;
            let _x = crate::implementation_from_dafny::_Fixtures_Compile::_default::NamespaceAndName(&int!(0));
            _out1 = _x.0;
            _out2 = _x.1;
            namespace = _out1.clone();
            name = _out2.clone();
            let mut keys: Arc<GenerateRSAKeyPairOutput>;
            let mut _out3: Arc<GenerateRSAKeyPairOutput> = crate::implementation_from_dafny::_Fixtures_Compile::_default::GenerateKeyPair(2048);
            keys = _out3.clone();
            let mut valueOrError1: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRawRsaKeyring(rd!(mpl.clone()), &Arc::new(CreateRawRsaKeyringInput::CreateRawRsaKeyringInput {
                            keyNamespace: namespace.clone(),
                            keyName: name.clone(),
                            paddingScheme: Arc::new(PaddingScheme::OAEP_SHA1_MGF1 {}),
                            publicKey: Arc::new(Option::<Sequence<u8>>::Some {
                                        value: keys.publicKey().pem().clone()
                                    }),
                            privateKey: Arc::new(Option::<Sequence<u8>>::Some {
                                        value: keys.privateKey().pem().clone()
                                    })
                        }));
            valueOrError1 = _out4.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            output = MaybePlacebo::from(valueOrError1.Extract());
            return output.read();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(1116,3)
        pub fn GetAesKeyring() -> Object<dyn IKeyring> {
            let mut output = MaybePlacebo::<Object<dyn IKeyring>>::new();
            let mut valueOrError0: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError0.Extract();
            let mut namespace: Sequence<DafnyCharUTF16>;
            let mut name: Sequence<DafnyCharUTF16>;
            let mut _out1: Sequence<DafnyCharUTF16>;
            let mut _out2: Sequence<DafnyCharUTF16>;
            let _x = crate::implementation_from_dafny::_Fixtures_Compile::_default::NamespaceAndName(&int!(0));
            _out1 = _x.0;
            _out2 = _x.1;
            namespace = _out1.clone();
            name = _out2.clone();
            let mut valueOrError1: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateRawAesKeyring(rd!(mpl.clone()), &Arc::new(CreateRawAesKeyringInput::CreateRawAesKeyringInput {
                            keyNamespace: namespace.clone(),
                            keyName: name.clone(),
                            wrappingKey: {
                                    let _initializer = {
                                            Arc::new(move |i: &DafnyInt| -> u8{
                                                    0
                                                })
                                        };
                                    integer_range(Zero::zero(), int!(32)).map(move |i| _initializer(&i)).collect::<Sequence<_>>()
                                },
                            wrappingAlg: Arc::new(AesWrappingAlg::ALG_AES256_GCM_IV12_TAG16 {})
                        }));
            valueOrError1 = _out3.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            output = MaybePlacebo::from(valueOrError1.Extract());
            return output.read();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(1131,3)
        pub fn GetKmsKeyring() -> Object<dyn IKeyring> {
            let mut output = MaybePlacebo::<Object<dyn IKeyring>>::new();
            let mut kmsKey: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_Fixtures_Compile::_default::keyArn();
            let mut defaultConfig: Arc<AwsEncryptionSdkConfig> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::DefaultAwsEncryptionSdkConfig();
            let mut valueOrError0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Object<ESDKClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::_default::ESDK(&defaultConfig);
            valueOrError0 = _out0.clone();
            if !(!valueOrError0.IsFailure()) {
                panic!("Halt")
            };
            let mut esdk: Object<ESDKClient> = valueOrError0.Extract();
            let mut valueOrError1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out1: Arc<Result<Object<MaterialProvidersClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::MaterialProviders(&crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::_default::DefaultMaterialProvidersConfig());
            valueOrError1 = _out1.clone();
            if !(!valueOrError1.IsFailure()) {
                panic!("Halt")
            };
            let mut mpl: Object<MaterialProvidersClient> = valueOrError1.Extract();
            let mut valueOrError2: Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out2: Arc<Result<Object<dyn IClientSupplier>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateDefaultClientSupplier(rd!(mpl.clone()), &Arc::new(CreateDefaultClientSupplierInput::CreateDefaultClientSupplierInput {}));
            valueOrError2 = _out2.clone();
            if !(!valueOrError2.IsFailure()) {
                panic!("Halt")
            };
            let mut clientSupplier: Object<dyn IClientSupplier> = valueOrError2.Extract();
            let mut valueOrError3: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out3: Arc<Result<Object<dyn IKMSClient>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IClientSupplier::GetClient(rd!(clientSupplier.clone()), &Arc::new(GetClientInput::GetClientInput {
                            region: string_utf16_of("us-west-2")
                        }));
            valueOrError3 = _out3.clone();
            if !(!valueOrError3.IsFailure()) {
                panic!("Halt")
            };
            let mut kmsClient: Object<dyn IKMSClient> = valueOrError3.Extract();
            let mut valueOrError4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>;
            let mut _out4: Arc<Result<Object<dyn IKeyring>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = IAwsCryptographicMaterialProvidersClient::CreateAwsKmsKeyring(rd!(mpl.clone()), &Arc::new(CreateAwsKmsKeyringInput::CreateAwsKmsKeyringInput {
                            kmsKeyId: kmsKey.clone(),
                            kmsClient: kmsClient.clone(),
                            grantTokens: Arc::new(Option::<Sequence<Sequence<DafnyCharUTF16>>>::None {})
                        }));
            valueOrError4 = _out4.clone();
            if !(!valueOrError4.IsFailure()) {
                panic!("Halt")
            };
            output = MaybePlacebo::from(valueOrError4.Extract());
            return output.read();
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(28,3)
        pub fn branchKeyStoreName() -> Sequence<DafnyCharUTF16> {
            crate::implementation_from_dafny::_Fixtures_Compile::_default::branchKeyStoreName()
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(29,3)
        pub fn logicalKeyStoreName() -> Sequence<DafnyCharUTF16> {
            _default::branchKeyStoreName()
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(31,3)
        pub fn BRANCH_KEY_ID() -> Sequence<DafnyCharUTF16> {
            crate::implementation_from_dafny::_Fixtures_Compile::_default::branchKeyId()
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(27,3)
        pub fn hierarchyKeyArn() -> Sequence<DafnyCharUTF16> {
            crate::implementation_from_dafny::_Fixtures_Compile::_default::hierarchyKeyArn()
        }
        /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(26,3)
        pub fn keyArn() -> Sequence<DafnyCharUTF16> {
            crate::implementation_from_dafny::_Fixtures_Compile::_default::keyArn()
        }
    }

    /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(33,3)
    #[test]
    pub fn TestReprEncryptionContextWithSameECHappyCase() {
        _default::TestReprEncryptionContextWithSameECHappyCase()
    }

    /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(118,3)
    #[test]
    pub fn TestRemoveOnEncryptAndSupplyOnDecryptHappyCase() {
        _default::TestRemoveOnEncryptAndSupplyOnDecryptHappyCase()
    }

    /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(227,3)
    #[test]
    pub fn TestRemoveOnEncryptRemoveAndSupplyOnDecryptHappyCase() {
        _default::TestRemoveOnEncryptRemoveAndSupplyOnDecryptHappyCase()
    }

    /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(409,3)
    #[test]
    pub fn TestRemoveOnDecryptIsBackwardsCompatibleHappyCase() {
        _default::TestRemoveOnDecryptIsBackwardsCompatibleHappyCase()
    }

    /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(581,3)
    #[test]
    pub fn TestDifferentECOnDecryptFailure() {
        _default::TestDifferentECOnDecryptFailure()
    }

    /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(703,3)
    #[test]
    pub fn TestRemoveECAndNotSupplyOnDecryptFailure() {
        _default::TestRemoveECAndNotSupplyOnDecryptFailure()
    }

    /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(806,3)
    #[test]
    pub fn TestRemoveECAndSupplyMismatchedReprECFailure() {
        _default::TestRemoveECAndSupplyMismatchedReprECFailure()
    }

    /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(911,3)
    #[test]
    pub fn TestRemoveECAndSupplyWithMissingRequiredValueDecryptFailure() {
        _default::TestRemoveECAndSupplyWithMissingRequiredValueDecryptFailure()
    }

    /// dafny/AwsEncryptionSdk/test/TestRequiredEncryptionContext.dfy(1016,3)
    #[test]
    pub fn TestReservedEncryptionContextKeyFailure() {
        _default::TestReservedEncryptionContextKeyFailure()
    }
}
/// ../mpl/StandardLibrary/src/Time.dfy(11,1)
pub mod Time {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::std::sync::Arc;
    pub use ::dafny_runtime::DafnyPrintWrapper;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use crate::implementation_from_dafny::UTF8::ValidUTF8Bytes;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/Time.dfy(57,3)
        pub fn FormatMilli(diff: u64) -> Sequence<DafnyCharUTF16> {
            let mut whole: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&(diff / 1000)).clone()));
            let mut frac: Sequence<DafnyCharUTF16> = crate::implementation_from_dafny::_StandardLibrary_Compile::_String_Compile::_default::Base10Int2String(&int!((&(diff % 1000)).clone()));
            if frac.cardinality() == int!(1) {
                whole.concat(&string_utf16_of(".00")).concat(&frac)
            } else {
                if frac.cardinality() == int!(2) {
                    whole.concat(&string_utf16_of(".0")).concat(&frac)
                } else {
                    whole.concat(&string_utf16_of(".")).concat(&frac)
                }
            }
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(69,3)
        pub fn FormatMilliDiff(start: i64, end: i64) -> Sequence<DafnyCharUTF16> {
            if start <= end {
                _default::FormatMilli((end - start) as u64)
            } else {
                string_utf16_of("-").concat(&_default::FormatMilli((start - end) as u64))
            }
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(87,3)
        pub fn GetAbsoluteTime() -> Arc<AbsoluteTime> {
            let mut output: Arc<AbsoluteTime>;
            let mut ClockTime: i64;
            let mut _out0: i64 = _default::CurrentRelativeTimeMilli();
            ClockTime = _out0;
            let mut CpuTime: i64;
            let mut _out1: i64 = _default::GetProcessCpuTimeMillis();
            CpuTime = _out1;
            output = Arc::new(AbsoluteTime::AbsoluteTime {
                        ClockTime: ClockTime as u64,
                        CpuTime: CpuTime as u64
                    });
            return output.clone();
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(97,3)
        pub fn PrintTimeSince(start: &Arc<AbsoluteTime>) -> () {
            let mut t: Arc<RelativeTime>;
            let mut _out0: Arc<RelativeTime> = _default::TimeSince(start);
            t = _out0.clone();
            _default::PrintTime(&t);
            return ();
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(103,3)
        pub fn PrintTimeSinceShort(start: &Arc<AbsoluteTime>) -> () {
            let mut t: Arc<RelativeTime>;
            let mut _out0: Arc<RelativeTime> = _default::TimeSince(start);
            t = _out0.clone();
            _default::PrintTimeShort(&t);
            return ();
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(109,3)
        pub fn PrintTimeSinceShortChained(start: &Arc<AbsoluteTime>) -> Arc<AbsoluteTime> {
            let mut x: Arc<AbsoluteTime>;
            let mut end: Arc<AbsoluteTime>;
            let mut _out0: Arc<AbsoluteTime> = _default::GetAbsoluteTime();
            end = _out0.clone();
            _default::PrintTimeShort(&_default::TimeDiff(start, &end));
            x = end.clone();
            return x.clone();
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(116,3)
        pub fn TimeDiff(start: &Arc<AbsoluteTime>, end: &Arc<AbsoluteTime>) -> Arc<RelativeTime> {
            if start.ClockTime().clone() <= end.ClockTime().clone() && start.CpuTime().clone() <= end.CpuTime().clone() {
                Arc::new(RelativeTime::RelativeTime {
                        ClockTime: end.ClockTime().clone() - start.ClockTime().clone(),
                        CpuTime: end.CpuTime().clone() - start.CpuTime().clone()
                    })
            } else {
                Arc::new(RelativeTime::RelativeTime {
                        ClockTime: 0,
                        CpuTime: 0
                    })
            }
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(130,3)
        pub fn TimeSince(start: &Arc<AbsoluteTime>) -> Arc<RelativeTime> {
            let mut output: Arc<RelativeTime>;
            let mut end: Arc<AbsoluteTime>;
            let mut _out0: Arc<AbsoluteTime> = _default::GetAbsoluteTime();
            end = _out0.clone();
            output = _default::TimeDiff(start, &end);
            return output.clone();
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(136,3)
        pub fn PrintTime(time: &Arc<RelativeTime>) -> () {
            print!("{}", DafnyPrintWrapper(&string_utf16_of("Clock Time : ")));
            print!("{}", DafnyPrintWrapper(&_default::FormatMilli(time.ClockTime().clone())));
            print!("{}", DafnyPrintWrapper(&string_utf16_of(" CPU Time : ")));
            print!("{}", DafnyPrintWrapper(&_default::FormatMilli(time.CpuTime().clone())));
            print!("{}", DafnyPrintWrapper(&string_utf16_of("\n")));
            return ();
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(141,3)
        pub fn PrintTimeSinceLong(start: &Arc<AbsoluteTime>, tag: &Sequence<DafnyCharUTF16>, file: &Arc<Option<Sequence<DafnyCharUTF16>>>) -> () {
            let mut t: Arc<RelativeTime>;
            let mut _out0: Arc<RelativeTime> = _default::TimeSince(start);
            t = _out0.clone();
            _default::PrintTimeLong(&t, tag, file);
            return ();
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(147,3)
        pub fn PrintTimeLong(time: &Arc<RelativeTime>, tag: &Sequence<DafnyCharUTF16>, file: &Arc<Option<Sequence<DafnyCharUTF16>>>) -> () {
            let mut val: Sequence<DafnyCharUTF16> = tag.concat(&string_utf16_of(" ")).concat(&crate::implementation_from_dafny::OsLang::_default::GetOsShort()).concat(&string_utf16_of(" ")).concat(&crate::implementation_from_dafny::OsLang::_default::GetLanguageShort()).concat(&string_utf16_of(" ")).concat(&_default::FormatMilli(time.ClockTime().clone())).concat(&string_utf16_of(" ")).concat(&_default::FormatMilli(time.CpuTime().clone())).concat(&string_utf16_of("\n"));
            print!("{}", DafnyPrintWrapper(&val));
            if matches!(file.as_ref(), Some{ .. }) {
                let mut utf8_val: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::UTF8::_default::Encode(&val);
                if matches!((&utf8_val).as_ref(), Success{ .. }) {
                    let mut _v0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Sequence<DafnyCharUTF16>>>;
                    let mut _out0: Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<(), Sequence<DafnyCharUTF16>>> = crate::implementation_from_dafny::_FileIO_Compile::_default::AppendBytesToFile(file.value(), utf8_val.value());
                    _v0 = _out0.clone();
                }
            };
            return ();
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(159,3)
        pub fn PrintTimeShort(time: &Arc<RelativeTime>) -> () {
            print!("{}", DafnyPrintWrapper(&string_utf16_of("CPU:")));
            print!("{}", DafnyPrintWrapper(&_default::FormatMilli(time.CpuTime().clone())));
            print!("{}", DafnyPrintWrapper(&string_utf16_of(" ")));
            return ();
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(169,3)
        pub fn CreateGetCurrentTimeStampSuccess(value: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::Success {
                    value: value.clone()
                })
        }
        /// ../mpl/StandardLibrary/src/Time.dfy(173,3)
        pub fn CreateGetCurrentTimeStampFailure(error: &Sequence<DafnyCharUTF16>) -> Arc<crate::implementation_from_dafny::_Wrappers_Compile::Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> {
            Arc::new(crate::implementation_from_dafny::_Wrappers_Compile::Result::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::Failure {
                    error: error.clone()
                })
        }
    }

    /// ../mpl/StandardLibrary/src/Time.dfy(79,3)
    #[derive(PartialEq, Clone)]
    pub enum AbsoluteTime {
        AbsoluteTime {
            ClockTime: u64,
            CpuTime: u64
        }
    }

    impl AbsoluteTime {
        /// Returns a borrow of the field ClockTime
        pub fn ClockTime(&self) -> &u64 {
            match self {
                AbsoluteTime::AbsoluteTime{ClockTime, CpuTime, } => ClockTime,
            }
        }
        /// Returns a borrow of the field CpuTime
        pub fn CpuTime(&self) -> &u64 {
            match self {
                AbsoluteTime::AbsoluteTime{ClockTime, CpuTime, } => CpuTime,
            }
        }
    }

    impl Debug
        for AbsoluteTime {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for AbsoluteTime {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                AbsoluteTime::AbsoluteTime{ClockTime, CpuTime, } => {
                    write!(_formatter, "Time.AbsoluteTime.AbsoluteTime(")?;
                    DafnyPrint::fmt_print(ClockTime, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(CpuTime, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for AbsoluteTime {}

    impl Hash
        for AbsoluteTime {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                AbsoluteTime::AbsoluteTime{ClockTime, CpuTime, } => {
                    Hash::hash(ClockTime, _state);
                    Hash::hash(CpuTime, _state)
                },
            }
        }
    }

    impl Default
        for AbsoluteTime {
        fn default() -> AbsoluteTime {
            AbsoluteTime::AbsoluteTime {
                ClockTime: Default::default(),
                CpuTime: Default::default()
            }
        }
    }

    impl AsRef<AbsoluteTime>
        for AbsoluteTime {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/StandardLibrary/src/Time.dfy(83,3)
    #[derive(PartialEq, Clone)]
    pub enum RelativeTime {
        RelativeTime {
            ClockTime: u64,
            CpuTime: u64
        }
    }

    impl RelativeTime {
        /// Returns a borrow of the field ClockTime
        pub fn ClockTime(&self) -> &u64 {
            match self {
                RelativeTime::RelativeTime{ClockTime, CpuTime, } => ClockTime,
            }
        }
        /// Returns a borrow of the field CpuTime
        pub fn CpuTime(&self) -> &u64 {
            match self {
                RelativeTime::RelativeTime{ClockTime, CpuTime, } => CpuTime,
            }
        }
    }

    impl Debug
        for RelativeTime {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl DafnyPrint
        for RelativeTime {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                RelativeTime::RelativeTime{ClockTime, CpuTime, } => {
                    write!(_formatter, "Time.RelativeTime.RelativeTime(")?;
                    DafnyPrint::fmt_print(ClockTime, _formatter, false)?;
                    write!(_formatter, ", ")?;
                    DafnyPrint::fmt_print(CpuTime, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl Eq
        for RelativeTime {}

    impl Hash
        for RelativeTime {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                RelativeTime::RelativeTime{ClockTime, CpuTime, } => {
                    Hash::hash(ClockTime, _state);
                    Hash::hash(CpuTime, _state)
                },
            }
        }
    }

    impl Default
        for RelativeTime {
        fn default() -> RelativeTime {
            RelativeTime::RelativeTime {
                ClockTime: Default::default(),
                CpuTime: Default::default()
            }
        }
    }

    impl AsRef<RelativeTime>
        for RelativeTime {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}
/// ../mpl/StandardLibrary/src/UTF8.dfy(17,1)
pub mod UTF8 {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::dafny_runtime::integer_range;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::_System::nat;
    pub use ::std::default::Default;
    pub use ::dafny_runtime::truncate;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq64;
    pub use ::dafny_runtime::seq;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/UTF8.dfy(41,3)
        pub fn CreateEncodeSuccess(bytes: &ValidUTF8Bytes) -> Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> {
            Arc::new(Result::<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>::Success {
                    value: bytes.clone()
                })
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(45,3)
        pub fn CreateEncodeFailure(error: &Sequence<DafnyCharUTF16>) -> Arc<Result<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>> {
            Arc::new(Result::<ValidUTF8Bytes, Sequence<DafnyCharUTF16>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(49,3)
        pub fn CreateDecodeSuccess(s: &Sequence<DafnyCharUTF16>) -> Arc<Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> {
            Arc::new(Result::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::Success {
                    value: s.clone()
                })
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(53,3)
        pub fn CreateDecodeFailure(error: &Sequence<DafnyCharUTF16>) -> Arc<Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> {
            Arc::new(Result::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(57,3)
        pub fn IsASCIIString(s: &Sequence<DafnyCharUTF16>) -> bool {
            integer_range(int!(0), s.cardinality()).all(({
                    let mut s = s.clone();
                    Arc::new(move |__forall_var_0: DafnyInt| -> bool{
                            let mut i: DafnyInt = __forall_var_0.clone();
                            !(int!(0) <= i.clone() && i.clone() < s.cardinality()) || int!(s.get(&i).0) < int!(128)
                        })
                }).as_ref())
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(108,3)
        pub fn Uses1Byte(s: &Sequence<u8>) -> bool {
            0 <= s.get(&int!(0)) && s.get(&int!(0)) <= 127
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(115,3)
        pub fn Uses2Bytes(s: &Sequence<u8>) -> bool {
            194 <= s.get(&int!(0)) && s.get(&int!(0)) <= 223 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191)
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(122,3)
        pub fn Uses3Bytes(s: &Sequence<u8>) -> bool {
            s.get(&int!(0)) == 224 && (160 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) || 225 <= s.get(&int!(0)) && s.get(&int!(0)) <= 236 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) || s.get(&int!(0)) == 237 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 159) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) || 238 <= s.get(&int!(0)) && s.get(&int!(0)) <= 239 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191)
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(132,3)
        pub fn Uses4Bytes(s: &Sequence<u8>) -> bool {
            s.get(&int!(0)) == 240 && (144 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) && (128 <= s.get(&int!(3)) && s.get(&int!(3)) <= 191) || 241 <= s.get(&int!(0)) && s.get(&int!(0)) <= 243 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 191) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) && (128 <= s.get(&int!(3)) && s.get(&int!(3)) <= 191) || s.get(&int!(0)) == 244 && (128 <= s.get(&int!(1)) && s.get(&int!(1)) <= 143) && (128 <= s.get(&int!(2)) && s.get(&int!(2)) <= 191) && (128 <= s.get(&int!(3)) && s.get(&int!(3)) <= 191)
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(141,3)
        pub fn ValidUTF8Range(a: &Sequence<u8>, lo: &nat, hi: &nat) -> bool {
            let mut _hresult: bool = <bool as Default>::default();
            if crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::HasUint64Len::<u8>(a) {
                _hresult = _default::BoundedValidUTF8Range(a, truncate!(lo.clone(), u64), truncate!(hi.clone(), u64));
                return _hresult;
            };
            if lo.clone() == hi.clone() {
                _hresult = true;
                return _hresult;
            };
            let mut i: DafnyInt = lo.clone();
            while i.clone() < hi.clone() {
                if i.clone() < hi.clone() && (0 <= a.get(&i) && a.get(&i) <= 127) {
                    i = i.clone() + int!(1);
                } else {
                    if i.clone() + int!(1) < hi.clone() && (194 <= a.get(&i) && a.get(&i) <= 223) && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) {
                        i = i.clone() + int!(2);
                    } else {
                        if i.clone() + int!(2) < hi.clone() && (a.get(&i) == 224 && (160 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) || 225 <= a.get(&i) && a.get(&i) <= 236 && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) || a.get(&i) == 237 && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 159) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) || 238 <= a.get(&i) && a.get(&i) <= 239 && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191)) {
                            i = i.clone() + int!(3);
                        } else {
                            if i.clone() + int!(3) < hi.clone() && (a.get(&i) == 240 && (144 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) && (128 <= a.get(&(i.clone() + int!(3))) && a.get(&(i.clone() + int!(3))) <= 191) || 241 <= a.get(&i) && a.get(&i) <= 243 && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 191) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) && (128 <= a.get(&(i.clone() + int!(3))) && a.get(&(i.clone() + int!(3))) <= 191) || a.get(&i) == 244 && (128 <= a.get(&(i.clone() + int!(1))) && a.get(&(i.clone() + int!(1))) <= 143) && (128 <= a.get(&(i.clone() + int!(2))) && a.get(&(i.clone() + int!(2))) <= 191) && (128 <= a.get(&(i.clone() + int!(3))) && a.get(&(i.clone() + int!(3))) <= 191)) {
                                i = i.clone() + int!(4);
                            } else {
                                _hresult = false;
                                return _hresult;
                            }
                        }
                    }
                }
            };
            _hresult = true;
            return _hresult;
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(223,3)
        pub fn BoundedValidUTF8Range(a: &seq64<u8>, lo: u64, hi: u64) -> bool {
            let mut _hresult: bool = <bool as Default>::default();
            if lo == hi {
                _hresult = true;
                return _hresult;
            };
            let mut i: u64 = lo;
            while i < hi {
                if i < hi && (0 <= a.get(&int!((&i).clone())) && a.get(&int!((&i).clone())) <= 127) {
                    i = i + 1;
                } else {
                    if i < hi - 1 && (194 <= a.get(&int!((&i).clone())) && a.get(&int!((&i).clone())) <= 223) && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) {
                        i = i + 2;
                    } else {
                        if 2 <= hi && i < hi - 2 && (a.get(&int!((&i).clone())) == 224 && (160 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) || 225 <= a.get(&int!((&i).clone())) && a.get(&int!((&i).clone())) <= 236 && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) || a.get(&int!((&i).clone())) == 237 && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 159) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) || 238 <= a.get(&int!((&i).clone())) && a.get(&int!((&i).clone())) <= 239 && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191)) {
                            i = i + 3;
                        } else {
                            if 3 <= hi && i < hi - 3 && (a.get(&int!((&i).clone())) == 240 && (144 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 3)).clone())) && a.get(&int!((&(i + 3)).clone())) <= 191) || 241 <= a.get(&int!((&i).clone())) && a.get(&int!((&i).clone())) <= 243 && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 3)).clone())) && a.get(&int!((&(i + 3)).clone())) <= 191) || a.get(&int!((&i).clone())) == 244 && (128 <= a.get(&int!((&(i + 1)).clone())) && a.get(&int!((&(i + 1)).clone())) <= 143) && (128 <= a.get(&int!((&(i + 2)).clone())) && a.get(&int!((&(i + 2)).clone())) <= 191) && (128 <= a.get(&int!((&(i + 3)).clone())) && a.get(&int!((&(i + 3)).clone())) <= 191)) {
                                i = i + 4;
                            } else {
                                _hresult = false;
                                return _hresult;
                            }
                        }
                    }
                }
            };
            _hresult = true;
            return _hresult;
        }
        /// ../mpl/StandardLibrary/src/UTF8.dfy(303,3)
        pub fn ValidUTF8Seq(s: &Sequence<u8>) -> bool {
            _default::ValidUTF8Range(s, &int!(0), &s.cardinality())
        }
    }

    /// ../mpl/StandardLibrary/src/UTF8.dfy(21,3)
    pub type ValidUTF8Bytes = Sequence<u8>;

    /// An element of ValidUTF8Bytes
    pub fn __init_ValidUTF8Bytes() -> Sequence<u8> {
        seq![] as Sequence<u8>
    }
}
/// ../mpl/StandardLibrary/src/UUID.dfy(6,1)
pub mod UUID {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::DafnyCharUTF16;

    pub struct _default {}

    impl _default {
        /// ../mpl/StandardLibrary/src/UUID.dfy(30,3)
        pub fn CreateBytesSuccess(bytes: &Sequence<u8>) -> Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>> {
            Arc::new(Result::<Sequence<u8>, Sequence<DafnyCharUTF16>>::Success {
                    value: bytes.clone()
                })
        }
        /// ../mpl/StandardLibrary/src/UUID.dfy(34,3)
        pub fn CreateBytesFailure(error: &Sequence<DafnyCharUTF16>) -> Arc<Result<Sequence<u8>, Sequence<DafnyCharUTF16>>> {
            Arc::new(Result::<Sequence<u8>, Sequence<DafnyCharUTF16>>::Failure {
                    error: error.clone()
                })
        }
        /// ../mpl/StandardLibrary/src/UUID.dfy(38,3)
        pub fn CreateStringSuccess(s: &Sequence<DafnyCharUTF16>) -> Arc<Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> {
            Arc::new(Result::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::Success {
                    value: s.clone()
                })
        }
        /// ../mpl/StandardLibrary/src/UUID.dfy(42,3)
        pub fn CreateStringFailure(error: &Sequence<DafnyCharUTF16>) -> Arc<Result<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>> {
            Arc::new(Result::<Sequence<DafnyCharUTF16>, Sequence<DafnyCharUTF16>>::Failure {
                    error: error.clone()
                })
        }
    }
}
/// ../mpl/libraries/src/Unicode/Unicode.dfy(12,1)
pub mod _Unicode_Compile {
    pub use ::dafny_runtime::Set;
    pub use ::dafny_runtime::set;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/Unicode/Unicode.dfy(27,3)
        pub fn HIGH_SURROGATE_MIN() -> CodePoint {
            55296 as u32
        }
        /// ../mpl/libraries/src/Unicode/Unicode.dfy(28,3)
        pub fn HIGH_SURROGATE_MAX() -> CodePoint {
            56319 as u32
        }
        /// ../mpl/libraries/src/Unicode/Unicode.dfy(35,3)
        pub fn LOW_SURROGATE_MIN() -> CodePoint {
            56320 as u32
        }
        /// ../mpl/libraries/src/Unicode/Unicode.dfy(36,3)
        pub fn LOW_SURROGATE_MAX() -> CodePoint {
            57343 as u32
        }
        /// ../mpl/libraries/src/Unicode/Unicode.dfy(45,3)
        pub fn ASSIGNED_PLANES() -> Set<u8> {
            set!{0 as u8, 1 as u8, 2 as u8, 3 as u8, 14 as u8, 15 as u8, 16 as u8}
        }
    }

    /// Any value in the Unicode codespace (a range of integers from 0 to 10FFFF_16). (Section 3.9 D9-D10)
    /// ../mpl/libraries/src/Unicode/Unicode.dfy(20,3)
    pub type CodePoint = u32;

    /// A Unicode code point in the range U+D800 to U+DBFF. (Section 3.8 D71)
    /// ../mpl/libraries/src/Unicode/Unicode.dfy(25,3)
    pub type HighSurrogateCodePoint = u32;

    /// An element of HighSurrogateCodePoint
    pub fn __init_HighSurrogateCodePoint() -> u32 {
        _default::HIGH_SURROGATE_MIN()
    }

    /// A Unicode code point in the range U+DC00 to U+DFFF. (Section 3.8 D73)
    /// ../mpl/libraries/src/Unicode/Unicode.dfy(33,3)
    pub type LowSurrogateCodePoint = u32;

    /// An element of LowSurrogateCodePoint
    pub fn __init_LowSurrogateCodePoint() -> u32 {
        _default::LOW_SURROGATE_MIN()
    }

    /// Any Unicode code point except high-surrogate and low-surrogate code points. (Section 3.9 D76)
    /// ../mpl/libraries/src/Unicode/Unicode.dfy(41,3)
    pub type ScalarValue = u32;

    /// ../mpl/libraries/src/Unicode/Unicode.dfy(65,3)
    pub type AssignedCodePoint = u32;
}
/// ../mpl/libraries/src/Unicode/UnicodeStringsWithoutUnicodeChar.dfy(13,1)
pub mod _UnicodeStrings_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Unicode_Compile::ScalarValue;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/Unicode/UnicodeStringsWithoutUnicodeChar.dfy(19,3)
        pub fn IsWellFormedString(s: &Sequence<DafnyCharUTF16>) -> bool {
            crate::implementation_from_dafny::_Utf16EncodingForm_Compile::_default::IsWellFormedCodeUnitSequence(&crate::implementation_from_dafny::_Seq_Compile::_default::Map::<DafnyCharUTF16, u16>(&({
                        Arc::new(move |c: &DafnyCharUTF16| -> u16{
                                c.clone().0 as u16
                            })
                    }), s))
        }
        /// ../mpl/libraries/src/Unicode/UnicodeStringsWithoutUnicodeChar.dfy(25,3)
        pub fn ToUTF8Checked(s: &Sequence<DafnyCharUTF16>) -> Arc<Option<Sequence<u8>>> {
            let mut asCodeUnits: Sequence<u16> = crate::implementation_from_dafny::_Seq_Compile::_default::Map::<DafnyCharUTF16, u16>(&({
                        Arc::new(move |c: &DafnyCharUTF16| -> u16{
                                c.clone().0 as u16
                            })
                    }), s);
            let mut valueOrError0: Arc<Option<Sequence<ScalarValue>>> = crate::implementation_from_dafny::_Utf16EncodingForm_Compile::_default::DecodeCodeUnitSequenceChecked(&asCodeUnits);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Sequence<u8>>()
            } else {
                let mut utf32: Sequence<ScalarValue> = valueOrError0.Extract();
                let mut asUtf8CodeUnits: crate::implementation_from_dafny::_Utf8EncodingForm_Compile::WellFormedCodeUnitSeq = crate::implementation_from_dafny::_Utf8EncodingForm_Compile::_default::EncodeScalarSequence(&utf32);
                Arc::new(Option::<Sequence<u8>>::Some {
                        value: crate::implementation_from_dafny::_Seq_Compile::_default::Map::<u8, u8>(&({
                                    Arc::new(move |c: &u8| -> u8{
                                            c.clone() as u8
                                        })
                                }), &asUtf8CodeUnits)
                    })
            }
        }
        /// ../mpl/libraries/src/Unicode/UnicodeStringsWithoutUnicodeChar.dfy(32,3)
        pub fn FromUTF8Checked(bs: &Sequence<u8>) -> Arc<Option<Sequence<DafnyCharUTF16>>> {
            let mut asCodeUnits: Sequence<u8> = crate::implementation_from_dafny::_Seq_Compile::_default::Map::<u8, u8>(&({
                        Arc::new(move |c: &u8| -> u8{
                                c.clone() as u8
                            })
                    }), bs);
            let mut valueOrError0: Arc<Option<Sequence<ScalarValue>>> = crate::implementation_from_dafny::_Utf8EncodingForm_Compile::_default::DecodeCodeUnitSequenceChecked(&asCodeUnits);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Sequence<DafnyCharUTF16>>()
            } else {
                let mut utf32: Sequence<ScalarValue> = valueOrError0.Extract();
                let mut asUtf16CodeUnits: crate::implementation_from_dafny::_Utf16EncodingForm_Compile::WellFormedCodeUnitSeq = crate::implementation_from_dafny::_Utf16EncodingForm_Compile::_default::EncodeScalarSequence(&utf32);
                Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                        value: crate::implementation_from_dafny::_Seq_Compile::_default::Map::<u16, DafnyCharUTF16>(&({
                                    Arc::new(move |cu: &u16| -> DafnyCharUTF16{
                                            DafnyCharUTF16(cu.clone() as u16)
                                        })
                                }), &asUtf16CodeUnits)
                    })
            }
        }
        /// ../mpl/libraries/src/Unicode/UnicodeStringsWithoutUnicodeChar.dfy(39,3)
        pub fn ToUTF16Checked(s: &Sequence<DafnyCharUTF16>) -> Arc<Option<Sequence<u16>>> {
            if crate::implementation_from_dafny::_Utf16EncodingForm_Compile::_default::IsWellFormedCodeUnitSequence(&crate::implementation_from_dafny::_Seq_Compile::_default::Map::<DafnyCharUTF16, u16>(&({
                            Arc::new(move |c: &DafnyCharUTF16| -> u16{
                                    c.clone().0 as u16
                                })
                        }), s)) {
                Arc::new(Option::<Sequence<u16>>::Some {
                        value: crate::implementation_from_dafny::_Seq_Compile::_default::Map::<DafnyCharUTF16, u16>(&({
                                    Arc::new(move |c: &DafnyCharUTF16| -> u16{
                                            c.clone().0 as u16
                                        })
                                }), s)
                    })
            } else {
                Arc::new(Option::<Sequence<u16>>::None {})
            }
        }
        /// ../mpl/libraries/src/Unicode/UnicodeStringsWithoutUnicodeChar.dfy(46,3)
        pub fn FromUTF16Checked(bs: &Sequence<u16>) -> Arc<Option<Sequence<DafnyCharUTF16>>> {
            if crate::implementation_from_dafny::_Utf16EncodingForm_Compile::_default::IsWellFormedCodeUnitSequence(&crate::implementation_from_dafny::_Seq_Compile::_default::Map::<u16, u16>(&({
                            Arc::new(move |c: &u16| -> u16{
                                    c.clone() as u16
                                })
                        }), bs)) {
                Arc::new(Option::<Sequence<DafnyCharUTF16>>::Some {
                        value: crate::implementation_from_dafny::_Seq_Compile::_default::Map::<u16, DafnyCharUTF16>(&({
                                    Arc::new(move |c: &u16| -> DafnyCharUTF16{
                                            DafnyCharUTF16(c.clone() as u16)
                                        })
                                }), bs)
                    })
            } else {
                Arc::new(Option::<Sequence<DafnyCharUTF16>>::None {})
            }
        }
        /// ../mpl/libraries/src/Unicode/UnicodeStrings.dfy(45,3)
        pub fn ASCIIToUTF8(s: &Sequence<DafnyCharUTF16>) -> Sequence<u8> {
            crate::implementation_from_dafny::_Seq_Compile::_default::Map::<DafnyCharUTF16, u8>(&({
                    Arc::new(move |c: &DafnyCharUTF16| -> u8{
                            c.clone().0 as u8
                        })
                }), s)
        }
        /// ../mpl/libraries/src/Unicode/UnicodeStrings.dfy(55,3)
        pub fn ASCIIToUTF16(s: &Sequence<DafnyCharUTF16>) -> Sequence<u16> {
            crate::implementation_from_dafny::_Seq_Compile::_default::Map::<DafnyCharUTF16, u16>(&({
                    Arc::new(move |c: &DafnyCharUTF16| -> u16{
                            c.clone().0 as u16
                        })
                }), s)
        }
    }
}
/// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(15,1)
pub mod _Utf16EncodingForm_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::int;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Unicode_Compile::ScalarValue;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::integer_range_down;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(22,3)
        pub fn IsMinimalWellFormedCodeUnitSubsequence(s: &Sequence<u16>) -> bool {
            if s.cardinality() == int!(1) {
                _default::IsWellFormedSingleCodeUnitSequence(s)
            } else {
                if s.cardinality() == int!(2) {
                    let mut b: bool = _default::IsWellFormedDoubleCodeUnitSequence(s);
                    b
                } else {
                    false
                }
            }
        }
        /// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(33,3)
        pub fn IsWellFormedSingleCodeUnitSequence(s: &Sequence<u16>) -> bool {
            let mut firstWord: u16 = s.get(&int!(0));
            (0 as u16) <= firstWord && firstWord <= 55295 as u16 || (57344 as u16) <= firstWord && firstWord <= 65535 as u16
        }
        /// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(41,3)
        pub fn IsWellFormedDoubleCodeUnitSequence(s: &Sequence<u16>) -> bool {
            let mut firstWord: u16 = s.get(&int!(0));
            let mut secondWord: u16 = s.get(&int!(1));
            (55296 as u16) <= firstWord && firstWord <= 56319 as u16 && ((56320 as u16) <= secondWord && secondWord <= 57343 as u16)
        }
        /// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(51,3)
        pub fn SplitPrefixMinimalWellFormedCodeUnitSubsequence(s: &Sequence<u16>) -> Arc<Option<MinimalWellFormedCodeUnitSeq>> {
            if s.cardinality() >= int!(1) && _default::IsWellFormedSingleCodeUnitSequence(&s.take(&int!(1))) {
                Arc::new(Option::<Sequence<u16>>::Some {
                        value: s.take(&int!(1))
                    })
            } else {
                if s.cardinality() >= int!(2) && _default::IsWellFormedDoubleCodeUnitSequence(&s.take(&int!(2))) {
                    Arc::new(Option::<Sequence<u16>>::Some {
                            value: s.take(&int!(2))
                        })
                } else {
                    Arc::new(Option::<Sequence<u16>>::None {})
                }
            }
        }
        /// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(71,3)
        pub fn EncodeScalarValue(v: ScalarValue) -> MinimalWellFormedCodeUnitSeq {
            if (0 as u32) <= v && v <= 55295 as u32 || (57344 as u32) <= v && v <= 65535 as u32 {
                _default::EncodeScalarValueSingleWord(v)
            } else {
                _default::EncodeScalarValueDoubleWord(v)
            }
        }
        /// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(77,3)
        pub fn EncodeScalarValueSingleWord(v: ScalarValue) -> MinimalWellFormedCodeUnitSeq {
            let mut firstWord: u16 = v as u16;
            seq![firstWord]
        }
        /// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(88,3)
        pub fn EncodeScalarValueDoubleWord(v: ScalarValue) -> MinimalWellFormedCodeUnitSeq {
            let mut x2: u16 = (v & 1023 as u32) as u16;
            let mut x1: u8 = ((v & 64512 as u32) >> 10) as u8;
            let mut u: u8 = ((v & 2031616 as u32) >> 16) as u8;
            let mut w: u8 = u.wrapping_sub(1 as u8);
            let mut firstWord: u16 = 55296 as u16 | (w as u16) << 6 | x1 as u16;
            let mut secondWord: u16 = 56320 as u16 | x2;
            seq![firstWord, secondWord]
        }
        /// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(106,3)
        pub fn DecodeMinimalWellFormedCodeUnitSubsequence(m: &MinimalWellFormedCodeUnitSeq) -> ScalarValue {
            if m.cardinality() == int!(1) {
                _default::DecodeMinimalWellFormedCodeUnitSubsequenceSingleWord(m)
            } else {
                _default::DecodeMinimalWellFormedCodeUnitSubsequenceDoubleWord(m)
            }
        }
        /// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(112,3)
        pub fn DecodeMinimalWellFormedCodeUnitSubsequenceSingleWord(m: &MinimalWellFormedCodeUnitSeq) -> ScalarValue {
            let mut firstWord: u16 = m.get(&int!(0));
            let mut x: u16 = firstWord;
            x as u32
        }
        /// ../mpl/libraries/src/Unicode/Utf16EncodingForm.dfy(125,3)
        pub fn DecodeMinimalWellFormedCodeUnitSubsequenceDoubleWord(m: &MinimalWellFormedCodeUnitSeq) -> ScalarValue {
            let mut firstWord: u16 = m.get(&int!(0));
            let mut secondWord: u16 = m.get(&int!(1));
            let mut x2: u32 = (secondWord & 1023 as u16) as u32;
            let mut x1: u32 = (firstWord & 63 as u16) as u32;
            let mut w: u32 = ((firstWord & 960 as u16) >> 6) as u32;
            let mut u: u32 = w.wrapping_add(1 as u32);
            let mut v: u32 = u << 16 | x1 << 10 | x2;
            v
        }
        /// Returns the unique partition of the given code unit sequence into minimal well-formed code unit subsequences,
        /// or None if no such partition exists.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(116,3)
        pub fn PartitionCodeUnitSequenceChecked(s: &Sequence<u16>) -> Arc<Option<Sequence<MinimalWellFormedCodeUnitSeq>>> {
            let mut maybeParts = MaybePlacebo::<Arc<Option<Sequence<MinimalWellFormedCodeUnitSeq>>>>::new();
            if s.clone().to_array().len() == 0 {
                maybeParts = MaybePlacebo::from(Arc::new(Option::<Sequence<MinimalWellFormedCodeUnitSeq>>::Some {
                                value: seq![] as Sequence<MinimalWellFormedCodeUnitSeq>
                            }));
                return maybeParts.read();
            };
            let mut result: Sequence<MinimalWellFormedCodeUnitSeq> = seq![] as Sequence<MinimalWellFormedCodeUnitSeq>;
            let mut rest: Sequence<u16> = s.clone();
            while int!(0) < rest.cardinality() {
                let mut valueOrError0: Arc<Option<MinimalWellFormedCodeUnitSeq>> = _default::SplitPrefixMinimalWellFormedCodeUnitSubsequence(&rest);
                if valueOrError0.IsFailure() {
                    maybeParts = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<MinimalWellFormedCodeUnitSeq>>());
                    return maybeParts.read();
                };
                let mut prefix: MinimalWellFormedCodeUnitSeq = valueOrError0.Extract();
                result = result.concat(&seq![prefix.clone()]);
                rest = rest.drop(&prefix.cardinality());
            };
            maybeParts = MaybePlacebo::from(Arc::new(Option::<Sequence<MinimalWellFormedCodeUnitSeq>>::Some {
                            value: result.clone()
                        }));
            return maybeParts.read();
        }
        /// Returns the unique partition of the given well-formed code unit sequence into minimal well-formed code unit
        /// subsequences.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(157,3)
        pub fn PartitionCodeUnitSequence(s: &WellFormedCodeUnitSeq) -> Sequence<MinimalWellFormedCodeUnitSeq> {
            _default::PartitionCodeUnitSequenceChecked(s).Extract()
        }
        /// A code unit sequence is well-formed iff it can be partitioned into a sequence of minimal well-formed code unit subsequences.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(188,3)
        pub fn IsWellFormedCodeUnitSequence(s: &Sequence<u16>) -> bool {
            matches!((&_default::PartitionCodeUnitSequenceChecked(s)).as_ref(), Some{ .. })
        }
        /// Returns the well-formed Unicode string that is the encoding of the given scalar value sequence.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(254,3)
        pub fn EncodeScalarSequence(vs: &Sequence<ScalarValue>) -> WellFormedCodeUnitSeq {
            let mut s: WellFormedCodeUnitSeq = seq![] as Sequence<u16>;
            s = seq![] as Sequence<u16>;
            let mut _lo0: DafnyInt = int!(0);
            for i in integer_range_down(vs.cardinality(), _lo0.clone()) {
                let mut next: MinimalWellFormedCodeUnitSeq = _default::EncodeScalarValue(vs.get(&i));
                s = next.concat(&s);
            }
            return s.clone();
        }
        /// Returns the scalar value sequence encoded by the given well-formed Unicode string.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(281,3)
        pub fn DecodeCodeUnitSequence(s: &WellFormedCodeUnitSeq) -> Sequence<ScalarValue> {
            let mut parts: Sequence<MinimalWellFormedCodeUnitSeq> = _default::PartitionCodeUnitSequence(s);
            let mut vs: Sequence<ScalarValue> = crate::implementation_from_dafny::_Seq_Compile::_default::Map::<MinimalWellFormedCodeUnitSeq, ScalarValue>(&(Arc::new(move |x0: &MinimalWellFormedCodeUnitSeq| _default::DecodeMinimalWellFormedCodeUnitSubsequence(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>), &parts);
            vs.clone()
        }
        /// Returns the scalar value sequence encoded by the given code unit sequence, or None if the given Unicode string
        /// is not well-formed.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(300,3)
        pub fn DecodeCodeUnitSequenceChecked(s: &Sequence<u16>) -> Arc<Option<Sequence<ScalarValue>>> {
            let mut maybeVs = MaybePlacebo::<Arc<Option<Sequence<ScalarValue>>>>::new();
            let mut maybeParts: Arc<Option<Sequence<MinimalWellFormedCodeUnitSeq>>> = _default::PartitionCodeUnitSequenceChecked(s);
            if matches!((&maybeParts).as_ref(), None{ .. }) {
                maybeVs = MaybePlacebo::from(Arc::new(Option::<Sequence<ScalarValue>>::None {}));
                return maybeVs.read();
            };
            let mut parts: Sequence<MinimalWellFormedCodeUnitSeq> = maybeParts.value().clone();
            let mut vs: Sequence<ScalarValue> = crate::implementation_from_dafny::_Seq_Compile::_default::Map::<MinimalWellFormedCodeUnitSeq, ScalarValue>(&(Arc::new(move |x0: &MinimalWellFormedCodeUnitSeq| _default::DecodeMinimalWellFormedCodeUnitSubsequence(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>), &parts);
            maybeVs = MaybePlacebo::from(Arc::new(Option::<Sequence<ScalarValue>>::Some {
                            value: vs.clone()
                        }));
            return maybeVs.read();
        }
    }

    /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(36,3)
    pub type WellFormedCodeUnitSeq = Sequence<u16>;

    /// An element of WellFormedCodeUnitSeq
    pub fn __init_WellFormedCodeUnitSeq() -> Sequence<u16> {
        seq![] as Sequence<u16>
    }

    /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(39,3)
    pub type MinimalWellFormedCodeUnitSeq = Sequence<u16>;
}
/// The Unicode encoding form that assigns each Unicode scalar value to an unsigned byte sequence of one to four bytes
/// in length, as specified in Table 3-6 and Table 3-7.
/// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(18,1)
pub mod _Utf8EncodingForm_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::int;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::_Unicode_Compile::ScalarValue;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::Some;
    pub use ::dafny_runtime::DafnyInt;
    pub use ::dafny_runtime::integer_range_down;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(25,3)
        pub fn IsMinimalWellFormedCodeUnitSubsequence(s: &Sequence<u8>) -> bool {
            if s.cardinality() == int!(1) {
                let mut b: bool = _default::IsWellFormedSingleCodeUnitSequence(s);
                b
            } else {
                if s.cardinality() == int!(2) {
                    let mut b: bool = _default::IsWellFormedDoubleCodeUnitSequence(s);
                    b
                } else {
                    if s.cardinality() == int!(3) {
                        let mut b: bool = _default::IsWellFormedTripleCodeUnitSequence(s);
                        b
                    } else {
                        if s.cardinality() == int!(4) {
                            let mut b: bool = _default::IsWellFormedQuadrupleCodeUnitSequence(s);
                            b
                        } else {
                            false
                        }
                    }
                }
            }
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(50,3)
        pub fn IsWellFormedSingleCodeUnitSequence(s: &Sequence<u8>) -> bool {
            let mut firstByte: u8 = s.get(&int!(0));
            true && ((0 as u8) <= firstByte && firstByte <= 127 as u8)
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(57,3)
        pub fn IsWellFormedDoubleCodeUnitSequence(s: &Sequence<u8>) -> bool {
            let mut firstByte: u8 = s.get(&int!(0));
            let mut secondByte: u8 = s.get(&int!(1));
            (194 as u8) <= firstByte && firstByte <= 223 as u8 && ((128 as u8) <= secondByte && secondByte <= 191 as u8)
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(68,3)
        pub fn IsWellFormedTripleCodeUnitSequence(s: &Sequence<u8>) -> bool {
            let mut firstByte: u8 = s.get(&int!(0));
            let mut secondByte: u8 = s.get(&int!(1));
            let mut thirdByte: u8 = s.get(&int!(2));
            (firstByte == 224 as u8 && ((160 as u8) <= secondByte && secondByte <= 191 as u8) || (225 as u8) <= firstByte && firstByte <= 236 as u8 && ((128 as u8) <= secondByte && secondByte <= 191 as u8) || firstByte == 237 as u8 && ((128 as u8) <= secondByte && secondByte <= 159 as u8) || (238 as u8) <= firstByte && firstByte <= 239 as u8 && ((128 as u8) <= secondByte && secondByte <= 191 as u8)) && ((128 as u8) <= thirdByte && thirdByte <= 191 as u8)
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(86,3)
        pub fn IsWellFormedQuadrupleCodeUnitSequence(s: &Sequence<u8>) -> bool {
            let mut firstByte: u8 = s.get(&int!(0));
            let mut secondByte: u8 = s.get(&int!(1));
            let mut thirdByte: u8 = s.get(&int!(2));
            let mut fourthByte: u8 = s.get(&int!(3));
            (firstByte == 240 as u8 && ((144 as u8) <= secondByte && secondByte <= 191 as u8) || (241 as u8) <= firstByte && firstByte <= 243 as u8 && ((128 as u8) <= secondByte && secondByte <= 191 as u8) || firstByte == 244 as u8 && ((128 as u8) <= secondByte && secondByte <= 143 as u8)) && ((128 as u8) <= thirdByte && thirdByte <= 191 as u8) && ((128 as u8) <= fourthByte && fourthByte <= 191 as u8)
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(106,3)
        pub fn SplitPrefixMinimalWellFormedCodeUnitSubsequence(s: &Sequence<u8>) -> Arc<Option<MinimalWellFormedCodeUnitSeq>> {
            if s.cardinality() >= int!(1) && _default::IsWellFormedSingleCodeUnitSequence(&s.take(&int!(1))) {
                Arc::new(Option::<Sequence<u8>>::Some {
                        value: s.take(&int!(1))
                    })
            } else {
                if s.cardinality() >= int!(2) && _default::IsWellFormedDoubleCodeUnitSequence(&s.take(&int!(2))) {
                    Arc::new(Option::<Sequence<u8>>::Some {
                            value: s.take(&int!(2))
                        })
                } else {
                    if s.cardinality() >= int!(3) && _default::IsWellFormedTripleCodeUnitSequence(&s.take(&int!(3))) {
                        Arc::new(Option::<Sequence<u8>>::Some {
                                value: s.take(&int!(3))
                            })
                    } else {
                        if s.cardinality() >= int!(4) && _default::IsWellFormedQuadrupleCodeUnitSequence(&s.take(&int!(4))) {
                            Arc::new(Option::<Sequence<u8>>::Some {
                                    value: s.take(&int!(4))
                                })
                        } else {
                            Arc::new(Option::<Sequence<u8>>::None {})
                        }
                    }
                }
            }
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(121,3)
        pub fn EncodeScalarValue(v: ScalarValue) -> MinimalWellFormedCodeUnitSeq {
            if v <= 127 as u32 {
                _default::EncodeScalarValueSingleByte(v)
            } else {
                if v <= 2047 as u32 {
                    _default::EncodeScalarValueDoubleByte(v)
                } else {
                    if v <= 65535 as u32 {
                        _default::EncodeScalarValueTripleByte(v)
                    } else {
                        _default::EncodeScalarValueQuadrupleByte(v)
                    }
                }
            }
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(129,3)
        pub fn EncodeScalarValueSingleByte(v: ScalarValue) -> MinimalWellFormedCodeUnitSeq {
            let mut x: u8 = (v & 127 as u32) as u8;
            let mut firstByte: u8 = x;
            seq![firstByte]
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(141,3)
        pub fn EncodeScalarValueDoubleByte(v: ScalarValue) -> Sequence<u8> {
            let mut x: u8 = (v & 63 as u32) as u8;
            let mut y: u8 = ((v & 1984 as u32) >> 6) as u8;
            let mut firstByte: u8 = 192 as u8 | y;
            let mut secondByte: u8 = 128 as u8 | x;
            seq![firstByte, secondByte]
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(155,3)
        pub fn EncodeScalarValueTripleByte(v: ScalarValue) -> Sequence<u8> {
            let mut x: u8 = (v & 63 as u32) as u8;
            let mut y: u8 = ((v & 4032 as u32) >> 6) as u8;
            let mut z: u8 = ((v & 61440 as u32) >> 12) as u8;
            let mut firstByte: u8 = 224 as u8 | z;
            let mut secondByte: u8 = 128 as u8 | y;
            let mut thirdByte: u8 = 128 as u8 | x;
            seq![firstByte, secondByte, thirdByte]
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(171,3)
        pub fn EncodeScalarValueQuadrupleByte(v: ScalarValue) -> Sequence<u8> {
            let mut x: u8 = (v & 63 as u32) as u8;
            let mut y: u8 = ((v & 4032 as u32) >> 6) as u8;
            let mut z: u8 = ((v & 61440 as u32) >> 12) as u8;
            let mut u2: u8 = ((v & 196608 as u32) >> 16) as u8;
            let mut u1: u8 = ((v & 1835008 as u32) >> 18) as u8;
            let mut firstByte: u8 = 240 as u8 | u1;
            let mut secondByte: u8 = 128 as u8 | u2 << 4 | z;
            let mut thirdByte: u8 = 128 as u8 | y;
            let mut fourthByte: u8 = 128 as u8 | x;
            seq![firstByte, secondByte, thirdByte, fourthByte]
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(194,3)
        pub fn DecodeMinimalWellFormedCodeUnitSubsequence(m: &MinimalWellFormedCodeUnitSeq) -> ScalarValue {
            if m.cardinality() == int!(1) {
                _default::DecodeMinimalWellFormedCodeUnitSubsequenceSingleByte(m)
            } else {
                if m.cardinality() == int!(2) {
                    _default::DecodeMinimalWellFormedCodeUnitSubsequenceDoubleByte(m)
                } else {
                    if m.cardinality() == int!(3) {
                        _default::DecodeMinimalWellFormedCodeUnitSubsequenceTripleByte(m)
                    } else {
                        _default::DecodeMinimalWellFormedCodeUnitSubsequenceQuadrupleByte(m)
                    }
                }
            }
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(202,3)
        pub fn DecodeMinimalWellFormedCodeUnitSubsequenceSingleByte(m: &MinimalWellFormedCodeUnitSeq) -> ScalarValue {
            let mut firstByte: u8 = m.get(&int!(0));
            let mut x: u8 = firstByte;
            x as u32
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(212,3)
        pub fn DecodeMinimalWellFormedCodeUnitSubsequenceDoubleByte(m: &MinimalWellFormedCodeUnitSeq) -> ScalarValue {
            let mut firstByte: u8 = m.get(&int!(0));
            let mut secondByte: u8 = m.get(&int!(1));
            let mut y: u32 = (firstByte & 31 as u8) as u32;
            let mut x: u32 = (secondByte & 63 as u8) as u32;
            y << 6 | x
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(224,3)
        pub fn DecodeMinimalWellFormedCodeUnitSubsequenceTripleByte(m: &MinimalWellFormedCodeUnitSeq) -> ScalarValue {
            let mut firstByte: u8 = m.get(&int!(0));
            let mut secondByte: u8 = m.get(&int!(1));
            let mut thirdByte: u8 = m.get(&int!(2));
            let mut z: u32 = (firstByte & 15 as u8) as u32;
            let mut y: u32 = (secondByte & 63 as u8) as u32;
            let mut x: u32 = (thirdByte & 63 as u8) as u32;
            z << 12 | y << 6 | x
        }
        /// ../mpl/libraries/src/Unicode/Utf8EncodingForm.dfy(239,3)
        pub fn DecodeMinimalWellFormedCodeUnitSubsequenceQuadrupleByte(m: &MinimalWellFormedCodeUnitSeq) -> ScalarValue {
            let mut firstByte: u8 = m.get(&int!(0));
            let mut secondByte: u8 = m.get(&int!(1));
            let mut thirdByte: u8 = m.get(&int!(2));
            let mut fourthByte: u8 = m.get(&int!(3));
            let mut u1: u32 = (firstByte & 7 as u8) as u32;
            let mut u2: u32 = ((secondByte & 48 as u8) >> 4) as u32;
            let mut z: u32 = (secondByte & 15 as u8) as u32;
            let mut y: u32 = (thirdByte & 63 as u8) as u32;
            let mut x: u32 = (fourthByte & 63 as u8) as u32;
            u1 << 18 | u2 << 16 | z << 12 | y << 6 | x
        }
        /// Returns the unique partition of the given code unit sequence into minimal well-formed code unit subsequences,
        /// or None if no such partition exists.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(116,3)
        pub fn PartitionCodeUnitSequenceChecked(s: &Sequence<u8>) -> Arc<Option<Sequence<MinimalWellFormedCodeUnitSeq>>> {
            let mut maybeParts = MaybePlacebo::<Arc<Option<Sequence<MinimalWellFormedCodeUnitSeq>>>>::new();
            if s.clone().to_array().len() == 0 {
                maybeParts = MaybePlacebo::from(Arc::new(Option::<Sequence<MinimalWellFormedCodeUnitSeq>>::Some {
                                value: seq![] as Sequence<MinimalWellFormedCodeUnitSeq>
                            }));
                return maybeParts.read();
            };
            let mut result: Sequence<MinimalWellFormedCodeUnitSeq> = seq![] as Sequence<MinimalWellFormedCodeUnitSeq>;
            let mut rest: Sequence<u8> = s.clone();
            while int!(0) < rest.cardinality() {
                let mut valueOrError0: Arc<Option<MinimalWellFormedCodeUnitSeq>> = _default::SplitPrefixMinimalWellFormedCodeUnitSubsequence(&rest);
                if valueOrError0.IsFailure() {
                    maybeParts = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<MinimalWellFormedCodeUnitSeq>>());
                    return maybeParts.read();
                };
                let mut prefix: MinimalWellFormedCodeUnitSeq = valueOrError0.Extract();
                result = result.concat(&seq![prefix.clone()]);
                rest = rest.drop(&prefix.cardinality());
            };
            maybeParts = MaybePlacebo::from(Arc::new(Option::<Sequence<MinimalWellFormedCodeUnitSeq>>::Some {
                            value: result.clone()
                        }));
            return maybeParts.read();
        }
        /// Returns the unique partition of the given well-formed code unit sequence into minimal well-formed code unit
        /// subsequences.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(157,3)
        pub fn PartitionCodeUnitSequence(s: &WellFormedCodeUnitSeq) -> Sequence<MinimalWellFormedCodeUnitSeq> {
            _default::PartitionCodeUnitSequenceChecked(s).Extract()
        }
        /// A code unit sequence is well-formed iff it can be partitioned into a sequence of minimal well-formed code unit subsequences.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(188,3)
        pub fn IsWellFormedCodeUnitSequence(s: &Sequence<u8>) -> bool {
            matches!((&_default::PartitionCodeUnitSequenceChecked(s)).as_ref(), Some{ .. })
        }
        /// Returns the well-formed Unicode string that is the encoding of the given scalar value sequence.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(254,3)
        pub fn EncodeScalarSequence(vs: &Sequence<ScalarValue>) -> WellFormedCodeUnitSeq {
            let mut s: WellFormedCodeUnitSeq = seq![] as Sequence<u8>;
            s = seq![] as Sequence<u8>;
            let mut _lo0: DafnyInt = int!(0);
            for i in integer_range_down(vs.cardinality(), _lo0.clone()) {
                let mut next: MinimalWellFormedCodeUnitSeq = _default::EncodeScalarValue(vs.get(&i));
                s = next.concat(&s);
            }
            return s.clone();
        }
        /// Returns the scalar value sequence encoded by the given well-formed Unicode string.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(281,3)
        pub fn DecodeCodeUnitSequence(s: &WellFormedCodeUnitSeq) -> Sequence<ScalarValue> {
            let mut parts: Sequence<MinimalWellFormedCodeUnitSeq> = _default::PartitionCodeUnitSequence(s);
            let mut vs: Sequence<ScalarValue> = crate::implementation_from_dafny::_Seq_Compile::_default::Map::<MinimalWellFormedCodeUnitSeq, ScalarValue>(&(Arc::new(move |x0: &MinimalWellFormedCodeUnitSeq| _default::DecodeMinimalWellFormedCodeUnitSubsequence(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>), &parts);
            vs.clone()
        }
        /// Returns the scalar value sequence encoded by the given code unit sequence, or None if the given Unicode string
        /// is not well-formed.
        /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(300,3)
        pub fn DecodeCodeUnitSequenceChecked(s: &Sequence<u8>) -> Arc<Option<Sequence<ScalarValue>>> {
            let mut maybeVs = MaybePlacebo::<Arc<Option<Sequence<ScalarValue>>>>::new();
            let mut maybeParts: Arc<Option<Sequence<MinimalWellFormedCodeUnitSeq>>> = _default::PartitionCodeUnitSequenceChecked(s);
            if matches!((&maybeParts).as_ref(), None{ .. }) {
                maybeVs = MaybePlacebo::from(Arc::new(Option::<Sequence<ScalarValue>>::None {}));
                return maybeVs.read();
            };
            let mut parts: Sequence<MinimalWellFormedCodeUnitSeq> = maybeParts.value().clone();
            let mut vs: Sequence<ScalarValue> = crate::implementation_from_dafny::_Seq_Compile::_default::Map::<MinimalWellFormedCodeUnitSeq, ScalarValue>(&(Arc::new(move |x0: &MinimalWellFormedCodeUnitSeq| _default::DecodeMinimalWellFormedCodeUnitSubsequence(x0)) as Arc<dyn ::std::ops::Fn(&_) -> _ + Sync + Send>), &parts);
            maybeVs = MaybePlacebo::from(Arc::new(Option::<Sequence<ScalarValue>>::Some {
                            value: vs.clone()
                        }));
            return maybeVs.read();
        }
    }

    /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(36,3)
    pub type WellFormedCodeUnitSeq = Sequence<u8>;

    /// An element of WellFormedCodeUnitSeq
    pub fn __init_WellFormedCodeUnitSeq() -> Sequence<u8> {
        seq![] as Sequence<u8>
    }

    /// ../mpl/libraries/src/Unicode/UnicodeEncodingForm.dfy(39,3)
    pub type MinimalWellFormedCodeUnitSeq = Sequence<u8>;
}
/// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Utils.dfy(5,1)
pub mod _Utils_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECDHCurveSpec;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::ECCPrivateKey;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::AtomicPrimitivesClient;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetPublicKeyFromPrivateKeyOutput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::IAwsCryptographicPrimitivesClient;
    pub use ::dafny_runtime::rd;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::GetPublicKeyFromPrivateKeyInput;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders/src/Utils.dfy(14,3)
        pub fn GetPublicKey(curveSpec: &Arc<ECDHCurveSpec>, privateKey: &Arc<ECCPrivateKey>, crypto: &Object<AtomicPrimitivesClient>) -> Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> {
            let mut res = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>>>::new();
            let mut maybePublicKey: Arc<Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>>;
            let mut _out0: Arc<Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>>> = IAwsCryptographicPrimitivesClient::GetPublicKeyFromPrivateKey(rd!(crypto.clone()), &Arc::new(GetPublicKeyFromPrivateKeyInput::GetPublicKeyFromPrivateKeyInput {
                            eccCurve: curveSpec.clone(),
                            privateKey: privateKey.clone()
                        }));
            maybePublicKey = _out0.clone();
            let mut valueOrError0: Arc<Result<Arc<GetPublicKeyFromPrivateKeyOutput>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>> = maybePublicKey.MapFailure::<Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>(&({
                        Arc::new(move |e: &Arc<crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error>| -> Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>{
                                Arc::new(crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error::AwsCryptographyPrimitives {
                                        AwsCryptographyPrimitives: e.clone()
                                    })
                            })
                    }));
            if valueOrError0.IsFailure() {
                res = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return res.read();
            };
            let mut keyPairOutput: Arc<GetPublicKeyFromPrivateKeyOutput> = valueOrError0.Extract();
            res = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::Error>>::Success {
                            value: keyPairOutput.publicKey().clone()
                        }));
            return res.read();
        }
    }
}
/// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(12,1)
pub mod _V1HeaderBody_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageFormatVersion;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageFormatVersion::V1;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageType;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ESDKAlgorithmSuite;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::None;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageId;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded;
    pub use crate::implementation_from_dafny::_EncryptionContext_Compile::ESDKCanonicalEncryptionContext;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16;
    pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody;
    pub use ::dafny_runtime::seq;
    pub use ::dafny_runtime::int;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::AlgorithmSuiteInfo;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(39,3)
        pub fn WriteV1HeaderBody(body: &V1HeaderBody) -> Sequence<u8> {
            crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::WriteMessageFormatVersion(&Arc::new(MessageFormatVersion::V1 {})).concat(&_default::WriteV1MessageType(body.messageType())).concat(&crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::WriteESDKSuiteId(body.algorithmSuite())).concat(&crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::WriteMessageId(body.messageId())).concat(&crate::implementation_from_dafny::_EncryptionContext_Compile::_default::WriteAADSection(body.encryptionContext())).concat(&crate::implementation_from_dafny::_EncryptedDataKeys_Compile::_default::WriteEncryptedDataKeysSection(body.encryptedDataKeys())).concat(&crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::WriteContentType(body.contentType())).concat(&_default::WriteV1ReservedBytes(&_default::RESERVED_BYTES())).concat(&_default::WriteV1HeaderIvLength(crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(body.algorithmSuite()))).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint32(body.frameLength().clone()))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(108,3)
        pub fn ReadV1HeaderBody(buffer: &Arc<ReadableBuffer>, maxEdks: &Arc<Option<CountingNumbers>>, mpl: &Object<MaterialProvidersClient>) -> Arc<Result<Arc<SuccessfulRead<V1HeaderBody>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Arc<MessageFormatVersion>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::ReadMessageFormatVersion(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
            } else {
                let mut version: Arc<SuccessfulRead<Arc<MessageFormatVersion>>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(matches!(version.data().as_ref(), V1{ .. }), &Arc::new(ReadProblems::Error {
                                message: string_utf16_of("Message version must be version 1.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                } else {
                    let mut valueOrError2: Arc<Result<Arc<SuccessfulRead<Arc<MessageType>>>, Arc<ReadProblems>>> = _default::ReadV1MessageType(version.tail());
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                    } else {
                        let mut messageType: Arc<SuccessfulRead<Arc<MessageType>>> = valueOrError2.Extract();
                        let mut valueOrError3: Arc<Result<Arc<SuccessfulRead<ESDKAlgorithmSuite>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::ReadESDKSuiteId(messageType.tail(), mpl);
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                        } else {
                            let mut suite: Arc<SuccessfulRead<ESDKAlgorithmSuite>> = valueOrError3.Extract();
                            let mut valueOrError4: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(matches!(suite.data().commitment().as_ref(), None{ .. }), &Arc::new(ReadProblems::Error {
                                            message: string_utf16_of("Algorithm suite must not support commitment.")
                                        }));
                            if valueOrError4.IsFailure() {
                                valueOrError4.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                            } else {
                                let mut valueOrError5: Arc<Result<Arc<SuccessfulRead<MessageId>>, MoreNeeded>> = crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::ReadMessageIdV1(suite.tail());
                                if valueOrError5.IsFailure() {
                                    valueOrError5.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                                } else {
                                    let mut messageId: Arc<SuccessfulRead<MessageId>> = valueOrError5.Extract();
                                    let mut valueOrError6: Arc<Result<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::ReadAADSection(messageId.tail());
                                    if valueOrError6.IsFailure() {
                                        valueOrError6.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                                    } else {
                                        let mut encryptionContext: Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>> = valueOrError6.Extract();
                                        let mut valueOrError7: Arc<Result<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_EncryptedDataKeys_Compile::_default::ReadEncryptedDataKeysSection(encryptionContext.tail(), maxEdks);
                                        if valueOrError7.IsFailure() {
                                            valueOrError7.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                                        } else {
                                            let mut encryptedDataKeys: Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>> = valueOrError7.Extract();
                                            let mut valueOrError8: Arc<Result<Arc<SuccessfulRead<Arc<ContentType>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::ReadContentType(encryptedDataKeys.tail());
                                            if valueOrError8.IsFailure() {
                                                valueOrError8.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                                            } else {
                                                let mut contentType: Arc<SuccessfulRead<Arc<ContentType>>> = valueOrError8.Extract();
                                                let mut valueOrError9: Arc<Result<Arc<SuccessfulRead<ReservedBytes>>, Arc<ReadProblems>>> = _default::ReadV1ReservedBytes(contentType.tail());
                                                if valueOrError9.IsFailure() {
                                                    valueOrError9.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                                                } else {
                                                    let mut reservedBytes: Arc<SuccessfulRead<ReservedBytes>> = valueOrError9.Extract();
                                                    let mut valueOrError10: Arc<Result<Arc<SuccessfulRead<u8>>, Arc<ReadProblems>>> = _default::ReadV1HeaderIvLength(reservedBytes.tail(), suite.data());
                                                    if valueOrError10.IsFailure() {
                                                        valueOrError10.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                                                    } else {
                                                        let mut headerIvLength: Arc<SuccessfulRead<u8>> = valueOrError10.Extract();
                                                        let mut valueOrError11: Arc<Result<Arc<SuccessfulRead<u32>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt32(headerIvLength.tail());
                                                        if valueOrError11.IsFailure() {
                                                            valueOrError11.PropagateFailure::<Arc<SuccessfulRead<V1HeaderBody>>>()
                                                        } else {
                                                            let mut frameLength: Arc<SuccessfulRead<u32>> = valueOrError11.Extract();
                                                            let mut body: V1HeaderBody = Arc::new(HeaderBody::V1HeaderBody {
                                                                        messageType: messageType.data().clone(),
                                                                        algorithmSuite: suite.data().clone(),
                                                                        messageId: messageId.data().clone(),
                                                                        encryptionContext: encryptionContext.data().clone(),
                                                                        encryptedDataKeys: encryptedDataKeys.data().clone(),
                                                                        contentType: contentType.data().clone(),
                                                                        headerIvLength: headerIvLength.data().clone() as u64,
                                                                        frameLength: frameLength.data().clone()
                                                                    });
                                                            Arc::new(Result::<Arc<SuccessfulRead<V1HeaderBody>>, MoreNeeded>::Success {
                                                                    value: Arc::new(SuccessfulRead::<V1HeaderBody>::SuccessfulRead {
                                                                                data: body.clone(),
                                                                                tail: frameLength.tail().clone()
                                                                            })
                                                                })
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(231,3)
        pub fn WriteV1MessageType(messageType: &Arc<MessageType>) -> Sequence<u8> {
            seq![messageType.Serialize()]
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(239,3)
        pub fn ReadV1MessageType(buffer: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<Arc<MessageType>>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, 1);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<Arc<MessageType>>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut raw: Sequence<u8> = __let_tmp_rhs0.data().clone();
                let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                let mut valueOrError1: Arc<Result<Arc<MessageType>, Arc<ReadProblems>>> = MessageType::Get(raw.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone()))).MapFailure::<Arc<ReadProblems>>(&({
                            Arc::new(move |e: &Sequence<DafnyCharUTF16>| -> Arc<ReadProblems>{
                                    Arc::new(ReadProblems::Error {
                                            message: e.clone()
                                        })
                                })
                        }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<Arc<MessageType>>>>()
                } else {
                    let mut messageType: Arc<MessageType> = valueOrError1.Extract();
                    Arc::new(Result::<Arc<SuccessfulRead<Arc<MessageType>>>, Arc<ReadProblems>>::Success {
                            value: Arc::new(SuccessfulRead::<Arc<MessageType>>::SuccessfulRead {
                                        data: messageType.clone(),
                                        tail: tail.clone()
                                    })
                        })
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(254,3)
        pub fn WriteV1ReservedBytes(reservedBytes: &ReservedBytes) -> Sequence<u8> {
            reservedBytes.clone()
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(262,3)
        pub fn ReadV1ReservedBytes(buffer: &Arc<ReadableBuffer>) -> Arc<Result<Arc<SuccessfulRead<ReservedBytes>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, truncate!(_default::RESERVED_BYTES().cardinality(), u64));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<ReservedBytes>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut raw: Sequence<u8> = __let_tmp_rhs0.data().clone();
                let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                let mut valueOrError1: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(raw.clone() == _default::RESERVED_BYTES(), &Arc::new(ReadProblems::Error {
                                message: string_utf16_of("Incorrect reserved bytes.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<ReservedBytes>>>()
                } else {
                    let mut reservedBytes: ReservedBytes = raw.clone();
                    Arc::new(Result::<Arc<SuccessfulRead<ReservedBytes>>, Arc<ReadProblems>>::Success {
                            value: Arc::new(SuccessfulRead::<ReservedBytes>::SuccessfulRead {
                                        data: reservedBytes.clone(),
                                        tail: tail.clone()
                                    })
                        })
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(274,3)
        pub fn WriteV1HeaderIvLength(ivLength: u8) -> Sequence<u8> {
            seq![ivLength]
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(282,3)
        pub fn ReadV1HeaderIvLength(buffer: &Arc<ReadableBuffer>, suite: &Arc<AlgorithmSuiteInfo>) -> Arc<Result<Arc<SuccessfulRead<u8>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(buffer, 1);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<u8>>>()
            } else {
                let mut __let_tmp_rhs0: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError0.Extract();
                let mut raw: Sequence<u8> = __let_tmp_rhs0.data().clone();
                let mut tail: Arc<ReadableBuffer> = __let_tmp_rhs0.tail().clone();
                let mut valueOrError1: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(raw.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())) == crate::implementation_from_dafny::_SerializableTypes_Compile::_default::GetIvLength(suite), &Arc::new(ReadProblems::Error {
                                message: string_utf16_of("HeaderIv Length does not match Algorithm Suite.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<u8>>>()
                } else {
                    Arc::new(Result::<Arc<SuccessfulRead<u8>>, Arc<ReadProblems>>::Success {
                            value: Arc::new(SuccessfulRead::<u8>::SuccessfulRead {
                                        data: raw.get(&int!((&truncate!((&int!(0)).clone(), u32)).clone())),
                                        tail: tail.clone()
                                    })
                        })
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(34,3)
        pub fn RESERVED_BYTES() -> Sequence<u8> {
            seq![0, 0, 0, 0]
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(26,3)
    pub type V1HeaderBody = Arc<HeaderBody>;

    /// dafny/AwsEncryptionSdk/src/Serialize/V1HeaderBody.dfy(35,3)
    pub type ReservedBytes = Sequence<u8>;

    /// An element of ReservedBytes
    pub fn __init_ReservedBytes() -> Sequence<u8> {
        _default::RESERVED_BYTES()
    }
}
/// dafny/AwsEncryptionSdk/src/Serialize/V2HeaderBody.dfy(12,1)
pub mod _V2HeaderBody_Compile {
    pub use ::dafny_runtime::Sequence;
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageFormatVersion;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadableBuffer;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::encryptionsdk::internaldafny::types::CountingNumbers;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::MaterialProvidersClient;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::SuccessfulRead;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::ReadProblems;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageFormatVersion::V2;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ESDKAlgorithmSuite;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::materialproviders::internaldafny::types::DerivationAlgorithm::HKDF;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::MessageId;
    pub use crate::implementation_from_dafny::_SerializeFunctions_Compile::MoreNeeded;
    pub use crate::implementation_from_dafny::_EncryptionContext_Compile::ESDKCanonicalEncryptionContext;
    pub use crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::seq16;
    pub use crate::implementation_from_dafny::_SerializableTypes_Compile::ESDKEncryptedDataKey;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::ContentType;
    pub use crate::implementation_from_dafny::_HeaderTypes_Compile::HeaderBody;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::int;

    pub struct _default {}

    impl _default {
        /// dafny/AwsEncryptionSdk/src/Serialize/V2HeaderBody.dfy(30,3)
        pub fn WriteV2HeaderBody(body: &V2HeaderBody) -> Sequence<u8> {
            crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::WriteMessageFormatVersion(&Arc::new(MessageFormatVersion::V2 {})).concat(&crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::WriteESDKSuiteId(body.algorithmSuite())).concat(&crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::WriteMessageId(body.messageId())).concat(&crate::implementation_from_dafny::_EncryptionContext_Compile::_default::WriteAADSection(body.encryptionContext())).concat(&crate::implementation_from_dafny::_EncryptedDataKeys_Compile::_default::WriteEncryptedDataKeysSection(body.encryptedDataKeys())).concat(&crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::WriteContentType(body.contentType())).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::WriteUint32(body.frameLength().clone())).concat(&crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Write(body.suiteData()))
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/V2HeaderBody.dfy(88,3)
        pub fn ReadV2HeaderBody(buffer: &Arc<ReadableBuffer>, maxEdks: &Arc<Option<CountingNumbers>>, mpl: &Object<MaterialProvidersClient>) -> Arc<Result<Arc<SuccessfulRead<V2HeaderBody>>, Arc<ReadProblems>>> {
            let mut valueOrError0: Arc<Result<Arc<SuccessfulRead<Arc<MessageFormatVersion>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::ReadMessageFormatVersion(buffer);
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Arc<SuccessfulRead<V2HeaderBody>>>()
            } else {
                let mut version: Arc<SuccessfulRead<Arc<MessageFormatVersion>>> = valueOrError0.Extract();
                let mut valueOrError1: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(matches!(version.data().as_ref(), V2{ .. }), &Arc::new(ReadProblems::Error {
                                message: string_utf16_of("Message version must be version 2.")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Arc<SuccessfulRead<V2HeaderBody>>>()
                } else {
                    let mut valueOrError2: Arc<Result<Arc<SuccessfulRead<ESDKAlgorithmSuite>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::ReadESDKSuiteId(version.tail(), mpl);
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Arc<SuccessfulRead<V2HeaderBody>>>()
                    } else {
                        let mut suite: Arc<SuccessfulRead<ESDKAlgorithmSuite>> = valueOrError2.Extract();
                        let mut valueOrError3: Arc<Outcome<Arc<ReadProblems>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<ReadProblems>>(matches!(suite.data().commitment().as_ref(), HKDF{ .. }), &Arc::new(ReadProblems::Error {
                                        message: string_utf16_of("Algorithm suite must support commitment.")
                                    }));
                        if valueOrError3.IsFailure() {
                            valueOrError3.PropagateFailure::<Arc<SuccessfulRead<V2HeaderBody>>>()
                        } else {
                            let mut valueOrError4: Arc<Result<Arc<SuccessfulRead<MessageId>>, MoreNeeded>> = crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::ReadMessageIdV2(suite.tail());
                            if valueOrError4.IsFailure() {
                                valueOrError4.PropagateFailure::<Arc<SuccessfulRead<V2HeaderBody>>>()
                            } else {
                                let mut messageId: Arc<SuccessfulRead<MessageId>> = valueOrError4.Extract();
                                let mut valueOrError5: Arc<Result<Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_EncryptionContext_Compile::_default::ReadAADSection(messageId.tail());
                                if valueOrError5.IsFailure() {
                                    valueOrError5.PropagateFailure::<Arc<SuccessfulRead<V2HeaderBody>>>()
                                } else {
                                    let mut encryptionContext: Arc<SuccessfulRead<ESDKCanonicalEncryptionContext>> = valueOrError5.Extract();
                                    let mut valueOrError6: Arc<Result<Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_EncryptedDataKeys_Compile::_default::ReadEncryptedDataKeysSection(encryptionContext.tail(), maxEdks);
                                    if valueOrError6.IsFailure() {
                                        valueOrError6.PropagateFailure::<Arc<SuccessfulRead<V2HeaderBody>>>()
                                    } else {
                                        let mut encryptedDataKeys: Arc<SuccessfulRead<seq16<ESDKEncryptedDataKey>>> = valueOrError6.Extract();
                                        let mut valueOrError7: Arc<Result<Arc<SuccessfulRead<Arc<ContentType>>>, Arc<ReadProblems>>> = crate::implementation_from_dafny::_SharedHeaderFunctions_Compile::_default::ReadContentType(encryptedDataKeys.tail());
                                        if valueOrError7.IsFailure() {
                                            valueOrError7.PropagateFailure::<Arc<SuccessfulRead<V2HeaderBody>>>()
                                        } else {
                                            let mut contentType: Arc<SuccessfulRead<Arc<ContentType>>> = valueOrError7.Extract();
                                            let mut valueOrError8: Arc<Result<Arc<SuccessfulRead<u32>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::ReadUInt32(contentType.tail());
                                            if valueOrError8.IsFailure() {
                                                valueOrError8.PropagateFailure::<Arc<SuccessfulRead<V2HeaderBody>>>()
                                            } else {
                                                let mut frameLength: Arc<SuccessfulRead<u32>> = valueOrError8.Extract();
                                                let mut valueOrError9: Arc<Result<Arc<SuccessfulRead<Sequence<u8>>>, MoreNeeded>> = crate::implementation_from_dafny::_SerializeFunctions_Compile::_default::Read(frameLength.tail(), suite.data().commitment().HKDF().outputKeyLength().clone() as u64);
                                                if valueOrError9.IsFailure() {
                                                    valueOrError9.PropagateFailure::<Arc<SuccessfulRead<V2HeaderBody>>>()
                                                } else {
                                                    let mut suiteData: Arc<SuccessfulRead<Sequence<u8>>> = valueOrError9.Extract();
                                                    let mut body: V2HeaderBody = Arc::new(HeaderBody::V2HeaderBody {
                                                                algorithmSuite: suite.data().clone(),
                                                                messageId: messageId.data().clone(),
                                                                encryptionContext: encryptionContext.data().clone(),
                                                                encryptedDataKeys: encryptedDataKeys.data().clone(),
                                                                contentType: contentType.data().clone(),
                                                                frameLength: frameLength.data().clone(),
                                                                suiteData: suiteData.data().clone()
                                                            });
                                                    Arc::new(Result::<Arc<SuccessfulRead<V2HeaderBody>>, MoreNeeded>::Success {
                                                            value: Arc::new(SuccessfulRead::<V2HeaderBody>::SuccessfulRead {
                                                                        data: body.clone(),
                                                                        tail: suiteData.tail().clone()
                                                                    })
                                                        })
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        /// dafny/AwsEncryptionSdk/src/Serialize/V2HeaderBody.dfy(179,3)
        pub fn headerBytesToAADStart() -> u64 {
            truncate!(int!(1) + int!(2) + int!(32), u64)
        }
    }

    /// dafny/AwsEncryptionSdk/src/Serialize/V2HeaderBody.dfy(26,3)
    pub type V2HeaderBody = Arc<HeaderBody>;
}
/// ../mpl/AwsCryptographyPrimitives/src/WrappedHKDF.dfy(12,1)
pub mod _WrappedHKDF_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExtractInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use ::dafny_runtime::MaybePlacebo;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::DigestAlgorithm;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option;
    pub use ::dafny_runtime::Object;
    pub use crate::implementation_from_dafny::HMAC::HMac;
    pub use ::dafny_runtime::int;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfExpandInput;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::PositiveInteger;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HkdfInput;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/WrappedHKDF.dfy(22,3)
        pub fn Extract(input: &Arc<HkdfExtractInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>((matches!(input.salt().as_ref(), None{ .. }) || truncate!(input.salt().value().cardinality(), u64) != 0) && truncate!(input.ikm().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("HKDF Extract needs a salt and reasonable ikm.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut __let_tmp_rhs0: Arc<HkdfExtractInput> = input.clone();
            let mut digestAlgorithm: Arc<DigestAlgorithm> = __let_tmp_rhs0.digestAlgorithm().clone();
            let mut salt: Arc<Option<Sequence<u8>>> = __let_tmp_rhs0.salt().clone();
            let mut ikm: Sequence<u8> = __let_tmp_rhs0.ikm().clone();
            let mut valueOrError1: Arc<Result<Object<HMac>, Arc<Error>>>;
            let mut _out0: Arc<Result<Object<HMac>, Arc<Error>>> = HMac::Build(&digestAlgorithm);
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut hmac: Object<HMac> = valueOrError1.Extract();
            let mut prk: Sequence<u8>;
            let mut _out1: Sequence<u8> = crate::implementation_from_dafny::_HKDF_Compile::_default::Extract(&hmac, &salt.UnwrapOr(&crate::implementation_from_dafny::_StandardLibrary_Compile::_default::Fill::<u8>(&truncate!((&int!(0)).clone(), u8), &int!((&crate::implementation_from_dafny::_Digest_Compile::_default::Length(&digestAlgorithm)).clone()))), &ikm);
            prk = _out1.clone();
            output = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: prk.clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/WrappedHKDF.dfy(46,3)
        pub fn Expand(input: &Arc<HkdfExpandInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(1 <= input.expectedLength().clone() as u64 && (input.expectedLength().clone() as u64) <= (255 * crate::implementation_from_dafny::_Digest_Compile::_default::Length(input.digestAlgorithm())) && truncate!(input.info().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64) && crate::implementation_from_dafny::_Digest_Compile::_default::Length(input.digestAlgorithm()) == truncate!(input.prk().cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("HKDF Expand needs valid input.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut __let_tmp_rhs0: Arc<HkdfExpandInput> = input.clone();
            let mut digestAlgorithm: Arc<DigestAlgorithm> = __let_tmp_rhs0.digestAlgorithm().clone();
            let mut prk: Sequence<u8> = __let_tmp_rhs0.prk().clone();
            let mut info: Sequence<u8> = __let_tmp_rhs0.info().clone();
            let mut expectedLength: PositiveInteger = __let_tmp_rhs0.expectedLength().clone();
            let mut valueOrError1: Arc<Result<Object<HMac>, Arc<Error>>>;
            let mut _out0: Arc<Result<Object<HMac>, Arc<Error>>> = HMac::Build(&digestAlgorithm);
            valueOrError1 = _out0.clone();
            if valueOrError1.IsFailure() {
                output = MaybePlacebo::from(valueOrError1.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut hmac: Object<HMac> = valueOrError1.Extract();
            let mut omk: Sequence<u8>;
            let mut _out1: Sequence<u8> = crate::implementation_from_dafny::_HKDF_Compile::_default::Expand(&hmac, &prk, &info, expectedLength as u64, &digestAlgorithm);
            omk = _out1.clone();
            output = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: omk.clone()
                        }));
            return output.read();
        }
        /// ../mpl/AwsCryptographyPrimitives/src/WrappedHKDF.dfy(75,3)
        pub fn Hkdf(input: &Arc<HkdfInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut output = MaybePlacebo::<Arc<Result<Sequence<u8>, Arc<Error>>>>::new();
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(1 <= input.expectedLength().clone() as u64 && (input.expectedLength().clone() as u64) <= (255 * crate::implementation_from_dafny::_Digest_Compile::_default::Length(input.digestAlgorithm())) && (matches!(input.salt().as_ref(), None{ .. }) || truncate!(input.salt().value().cardinality(), u64) != 0) && truncate!(input.info().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64) && truncate!(input.ikm().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("Wrapped Hkdf input is invalid.")
                        }));
            if valueOrError0.IsFailure() {
                output = MaybePlacebo::from(valueOrError0.PropagateFailure::<Sequence<u8>>());
                return output.read();
            };
            let mut __let_tmp_rhs0: Arc<HkdfInput> = input.clone();
            let mut digest: Arc<DigestAlgorithm> = __let_tmp_rhs0.digestAlgorithm().clone();
            let mut salt: Arc<Option<Sequence<u8>>> = __let_tmp_rhs0.salt().clone();
            let mut ikm: Sequence<u8> = __let_tmp_rhs0.ikm().clone();
            let mut info: Sequence<u8> = __let_tmp_rhs0.info().clone();
            let mut expectedLength: PositiveInteger = __let_tmp_rhs0.expectedLength().clone();
            let mut okm: Sequence<u8>;
            let mut _out0: Sequence<u8> = crate::implementation_from_dafny::_HKDF_Compile::_default::Hkdf(&digest, &salt, &ikm, &info, expectedLength as u64);
            okm = _out0.clone();
            output = MaybePlacebo::from(Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                            value: okm.clone()
                        }));
            return output.read();
        }
    }
}
/// ../mpl/AwsCryptographyPrimitives/src/WrappedHMAC.dfy(7,1)
pub mod _WrappedHMAC_Compile {
    pub use ::std::sync::Arc;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::HMacInput;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result;
    pub use ::dafny_runtime::Sequence;
    pub use crate::implementation_from_dafny::software::amazon::cryptography::primitives::internaldafny::types::Error;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome;
    pub use ::dafny_runtime::truncate;
    pub use ::dafny_runtime::string_utf16_of;

    pub struct _default {}

    impl _default {
        /// ../mpl/AwsCryptographyPrimitives/src/WrappedHMAC.dfy(15,3)
        pub fn Digest(input: &Arc<HMacInput>) -> Arc<Result<Sequence<u8>, Arc<Error>>> {
            let mut valueOrError0: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(0 < truncate!(input.key().cardinality(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                            message: string_utf16_of("Key MUST NOT be 0 bytes.")
                        }));
            if valueOrError0.IsFailure() {
                valueOrError0.PropagateFailure::<Sequence<u8>>()
            } else {
                let mut valueOrError1: Arc<Outcome<Arc<Error>>> = crate::implementation_from_dafny::_Wrappers_Compile::_default::Need::<Arc<Error>>(truncate!(input.message().cardinality(), u64) < truncate!(crate::implementation_from_dafny::_StandardLibrary_Compile::_UInt_Compile::_default::INT32_MAX_LIMIT(), u64), &Arc::new(Error::AwsCryptographicPrimitivesError {
                                message: string_utf16_of("Message over INT32_MAX_LIMIT")
                            }));
                if valueOrError1.IsFailure() {
                    valueOrError1.PropagateFailure::<Sequence<u8>>()
                } else {
                    let mut valueOrError2: Arc<Result<Sequence<u8>, Arc<Error>>> = crate::implementation_from_dafny::HMAC::_default::Digest(input);
                    if valueOrError2.IsFailure() {
                        valueOrError2.PropagateFailure::<Sequence<u8>>()
                    } else {
                        let mut value: Sequence<u8> = valueOrError2.Extract();
                        Arc::new(Result::<Sequence<u8>, Arc<Error>>::Success {
                                value: value.clone()
                            })
                    }
                }
            }
        }
    }
}
/// *****************************************************************************
///  Copyright by the contributors to the Dafny Project
///  SPDX-License-Identifier: MIT
/// *****************************************************************************
/// ../mpl/libraries/src/Wrappers.dfy(8,1)
pub mod _Wrappers_Compile {
    pub use ::dafny_runtime::DafnyType;
    pub use ::std::sync::Arc;
    pub use ::std::marker::Sync;
    pub use ::std::marker::Send;
    pub use ::dafny_runtime::Sequence;
    pub use ::dafny_runtime::DafnyCharUTF16;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Option::None;
    pub use ::dafny_runtime::string_utf16_of;
    pub use ::std::fmt::Debug;
    pub use ::std::fmt::Formatter;
    pub use ::dafny_runtime::DafnyPrint;
    pub use ::std::cmp::Eq;
    pub use ::std::hash::Hash;
    pub use ::std::hash::Hasher;
    pub use ::std::default::Default;
    pub use ::std::convert::AsRef;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Success;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Result::Failure;
    pub use crate::implementation_from_dafny::_Wrappers_Compile::Outcome::Fail;

    pub struct _default {}

    impl _default {
        /// ../mpl/libraries/src/Wrappers.dfy(101,3)
        pub fn Need<_E: DafnyType>(condition: bool, error: &_E) -> Arc<Outcome<_E>> {
            if condition {
                Arc::new(Outcome::<_E>::Pass {})
            } else {
                Arc::new(Outcome::<_E>::Fail {
                        error: error.clone()
                    })
            }
        }
        /// ../mpl/libraries/src/Wrappers.dfy(111,3)
        pub fn FNeed<_E: DafnyType>(condition: bool, error: &Arc<dyn ::std::ops::Fn() -> _E + Sync + Send>) -> Arc<Outcome<_E>> {
            if condition {
                Arc::new(Outcome::<_E>::Pass {})
            } else {
                Arc::new(Outcome::<_E>::Fail {
                        error: error()
                    })
            }
        }
    }

    /// ../mpl/libraries/src/Wrappers.dfy(10,3)
    #[derive(PartialEq, Clone)]
    pub enum Option<T: DafnyType> {
        None {},
        Some {
            value: T
        }
    }

    impl<T: DafnyType> Option<T> {
        /// ../mpl/libraries/src/Wrappers.dfy(11,5)
        pub fn ToResult(self: &Arc<Self>) -> Arc<Result<T, Sequence<DafnyCharUTF16>>> {
            let mut _source0: Arc<Option<T>> = self.clone();
            if matches!((&_source0).as_ref(), None{ .. }) {
                Arc::new(Result::<T, Sequence<DafnyCharUTF16>>::Failure {
                        error: string_utf16_of("Option is None")
                    })
            } else {
                let mut ___mcc_h0: T = _source0.value().clone();
                let mut v: T = ___mcc_h0.clone();
                Arc::new(Result::<T, Sequence<DafnyCharUTF16>>::Success {
                        value: v.clone()
                    })
            }
        }
        /// ../mpl/libraries/src/Wrappers.dfy(17,5)
        pub fn _ToResult_k<_R: DafnyType>(self: &Arc<Self>, error: &_R) -> Arc<Result<T, _R>> {
            let mut _source0: Arc<Option<T>> = self.clone();
            if matches!((&_source0).as_ref(), None{ .. }) {
                Arc::new(Result::<T, _R>::Failure {
                        error: error.clone()
                    })
            } else {
                let mut ___mcc_h0: T = _source0.value().clone();
                let mut v: T = ___mcc_h0.clone();
                Arc::new(Result::<T, _R>::Success {
                        value: v.clone()
                    })
            }
        }
        /// ../mpl/libraries/src/Wrappers.dfy(23,5)
        pub fn UnwrapOr(self: &Arc<Self>, default: &T) -> T {
            let mut _source0: Arc<Option<T>> = self.clone();
            if matches!((&_source0).as_ref(), None{ .. }) {
                default.clone()
            } else {
                let mut ___mcc_h0: T = _source0.value().clone();
                let mut v: T = ___mcc_h0.clone();
                v.clone()
            }
        }
        /// ../mpl/libraries/src/Wrappers.dfy(29,5)
        pub fn IsFailure(self: &Arc<Self>) -> bool {
            matches!(self.as_ref(), None{ .. })
        }
        /// ../mpl/libraries/src/Wrappers.dfy(33,5)
        pub fn PropagateFailure<_U: DafnyType>(self: &Arc<Self>) -> Arc<Option<_U>> {
            Arc::new(Option::<_U>::None {})
        }
        /// ../mpl/libraries/src/Wrappers.dfy(39,5)
        pub fn Extract(self: &Arc<Self>) -> T {
            self.value().clone()
        }
        /// Gets the field value for all enum members which have it
        pub fn value(&self) -> &T {
            match self {
                Option::None{} => panic!("field does not exist on this variant"),
                Option::Some{value, } => value,
            }
        }
    }

    impl<T: DafnyType> Debug
        for Option<T> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType> DafnyPrint
        for Option<T> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Option::None{} => {
                    write!(_formatter, "Wrappers_Compile.Option.None")?;
                    Ok(())
                },
                Option::Some{value, } => {
                    write!(_formatter, "Wrappers_Compile.Option.Some(")?;
                    DafnyPrint::fmt_print(value, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType> Option<T> {
        /// Given type parameter conversions, returns a lambda to convert this structure
        pub fn coerce<__T0: DafnyType>(f_0: Arc<impl ::std::ops::Fn(T) -> __T0 + 'static>) -> Arc<impl ::std::ops::Fn(Option<T>) -> Option<__T0>> {
            Arc::new(move |this: Self| -> Option<__T0>{
                    match this {
                        Option::None{} => {
                            Option::None {}
                        },
                        Option::Some{value, } => {
                            Option::Some {
                                value: f_0.clone()(value)
                            }
                        },
                    }
                })
        }
    }

    impl<T: DafnyType + Eq> Eq
        for Option<T> {}

    impl<T: DafnyType + Hash> Hash
        for Option<T> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Option::None{} => {

                },
                Option::Some{value, } => {
                    Hash::hash(value, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default> Default
        for Option<T> {
        fn default() -> Option<T> {
            Option::None {}
        }
    }

    impl<T: DafnyType> AsRef<Option<T>>
        for Option<T> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/libraries/src/Wrappers.dfy(46,3)
    #[derive(PartialEq, Clone)]
    pub enum Result<T: DafnyType, R: DafnyType> {
        Success {
            value: T
        },
        Failure {
            error: R
        }
    }

    impl<T: DafnyType, R: DafnyType> Result<T, R> {
        /// ../mpl/libraries/src/Wrappers.dfy(47,5)
        pub fn ToOption(self: &Arc<Self>) -> Arc<Option<T>> {
            let mut _source0: Arc<Result<T, R>> = self.clone();
            if matches!((&_source0).as_ref(), Success{ .. }) {
                let mut ___mcc_h0: T = _source0.value().clone();
                let mut s: T = ___mcc_h0.clone();
                Arc::new(Option::<T>::Some {
                        value: s.clone()
                    })
            } else {
                let mut ___mcc_h1: R = _source0.error().clone();
                let mut e: R = ___mcc_h1.clone();
                Arc::new(Option::<T>::None {})
            }
        }
        /// ../mpl/libraries/src/Wrappers.dfy(54,5)
        pub fn UnwrapOr(self: &Arc<Self>, default: &T) -> T {
            let mut _source0: Arc<Result<T, R>> = self.clone();
            if matches!((&_source0).as_ref(), Success{ .. }) {
                let mut ___mcc_h0: T = _source0.value().clone();
                let mut s: T = ___mcc_h0.clone();
                s.clone()
            } else {
                let mut ___mcc_h1: R = _source0.error().clone();
                let mut e: R = ___mcc_h1.clone();
                default.clone()
            }
        }
        /// ../mpl/libraries/src/Wrappers.dfy(61,5)
        pub fn IsFailure(self: &Arc<Self>) -> bool {
            matches!(self.as_ref(), Failure{ .. })
        }
        /// ../mpl/libraries/src/Wrappers.dfy(65,5)
        pub fn PropagateFailure<_U: DafnyType>(self: &Arc<Self>) -> Arc<Result<_U, R>> {
            Arc::new(Result::<_U, R>::Failure {
                    error: self.error().clone()
                })
        }
        /// ../mpl/libraries/src/Wrappers.dfy(71,5)
        pub fn MapFailure<_NewR: DafnyType>(self: &Arc<Self>, reWrap: &Arc<dyn ::std::ops::Fn(&R) -> _NewR + Sync + Send>) -> Arc<Result<T, _NewR>> {
            let mut _source0: Arc<Result<T, R>> = self.clone();
            if matches!((&_source0).as_ref(), Success{ .. }) {
                let mut ___mcc_h0: T = _source0.value().clone();
                let mut s: T = ___mcc_h0.clone();
                Arc::new(Result::<T, _NewR>::Success {
                        value: s.clone()
                    })
            } else {
                let mut ___mcc_h1: R = _source0.error().clone();
                let mut e: R = ___mcc_h1.clone();
                Arc::new(Result::<T, _NewR>::Failure {
                        error: reWrap(&e)
                    })
            }
        }
        /// ../mpl/libraries/src/Wrappers.dfy(78,5)
        pub fn Extract(self: &Arc<Self>) -> T {
            self.value().clone()
        }
        /// Gets the field value for all enum members which have it
        pub fn value(&self) -> &T {
            match self {
                Result::Success{value, } => value,
                Result::Failure{error, } => panic!("field does not exist on this variant"),
            }
        }
        /// Gets the field error for all enum members which have it
        pub fn error(&self) -> &R {
            match self {
                Result::Success{value, } => panic!("field does not exist on this variant"),
                Result::Failure{error, } => error,
            }
        }
    }

    impl<T: DafnyType, R: DafnyType> Debug
        for Result<T, R> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<T: DafnyType, R: DafnyType> DafnyPrint
        for Result<T, R> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Result::Success{value, } => {
                    write!(_formatter, "Wrappers_Compile.Result.Success(")?;
                    DafnyPrint::fmt_print(value, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
                Result::Failure{error, } => {
                    write!(_formatter, "Wrappers_Compile.Result.Failure(")?;
                    DafnyPrint::fmt_print(error, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<T: DafnyType, R: DafnyType> Result<T, R> {
        /// Given type parameter conversions, returns a lambda to convert this structure
        pub fn coerce<__T0: DafnyType, __T1: DafnyType>(f_0: Arc<impl ::std::ops::Fn(T) -> __T0 + 'static>, f_1: Arc<impl ::std::ops::Fn(R) -> __T1 + 'static>) -> Arc<impl ::std::ops::Fn(Result<T, R>) -> Result<__T0, __T1>> {
            Arc::new(move |this: Self| -> Result<__T0, __T1>{
                    match this {
                        Result::Success{value, } => {
                            Result::Success {
                                value: f_0.clone()(value)
                            }
                        },
                        Result::Failure{error, } => {
                            Result::Failure {
                                error: f_1.clone()(error)
                            }
                        },
                    }
                })
        }
    }

    impl<T: DafnyType + Eq, R: DafnyType + Eq> Eq
        for Result<T, R> {}

    impl<T: DafnyType + Hash, R: DafnyType + Hash> Hash
        for Result<T, R> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Result::Success{value, } => {
                    Hash::hash(value, _state)
                },
                Result::Failure{error, } => {
                    Hash::hash(error, _state)
                },
            }
        }
    }

    impl<T: DafnyType + Default, R: DafnyType + Default> Default
        for Result<T, R> {
        fn default() -> Result<T, R> {
            Result::Success {
                value: Default::default()
            }
        }
    }

    impl<T: DafnyType, R: DafnyType> AsRef<Result<T, R>>
        for Result<T, R> {
        fn as_ref(&self) -> &Self {
            self
        }
    }

    /// ../mpl/libraries/src/Wrappers.dfy(85,3)
    #[derive(PartialEq, Clone)]
    pub enum Outcome<E: DafnyType> {
        Pass {},
        Fail {
            error: E
        }
    }

    impl<E: DafnyType> Outcome<E> {
        /// ../mpl/libraries/src/Wrappers.dfy(87,5)
        pub fn IsFailure(self: &Arc<Self>) -> bool {
            matches!(self.as_ref(), Fail{ .. })
        }
        /// ../mpl/libraries/src/Wrappers.dfy(91,5)
        pub fn PropagateFailure<_U: DafnyType>(self: &Arc<Self>) -> Arc<Result<_U, E>> {
            Arc::new(Result::<_U, E>::Failure {
                    error: self.error().clone()
                })
        }
        /// Gets the field error for all enum members which have it
        pub fn error(&self) -> &E {
            match self {
                Outcome::Pass{} => panic!("field does not exist on this variant"),
                Outcome::Fail{error, } => error,
            }
        }
    }

    impl<E: DafnyType> Debug
        for Outcome<E> {
        fn fmt(&self, f: &mut Formatter) -> ::std::fmt::Result {
            DafnyPrint::fmt_print(self, f, true)
        }
    }

    impl<E: DafnyType> DafnyPrint
        for Outcome<E> {
        fn fmt_print(&self, _formatter: &mut Formatter, _in_seq: bool) -> std::fmt::Result {
            match self {
                Outcome::Pass{} => {
                    write!(_formatter, "Wrappers_Compile.Outcome.Pass")?;
                    Ok(())
                },
                Outcome::Fail{error, } => {
                    write!(_formatter, "Wrappers_Compile.Outcome.Fail(")?;
                    DafnyPrint::fmt_print(error, _formatter, false)?;
                    write!(_formatter, ")")?;
                    Ok(())
                },
            }
        }
    }

    impl<E: DafnyType + Eq> Eq
        for Outcome<E> {}

    impl<E: DafnyType + Hash> Hash
        for Outcome<E> {
        fn hash<_H: Hasher>(&self, _state: &mut _H) {
            match self {
                Outcome::Pass{} => {

                },
                Outcome::Fail{error, } => {
                    Hash::hash(error, _state)
                },
            }
        }
    }

    impl<E: DafnyType + Default> Default
        for Outcome<E> {
        fn default() -> Outcome<E> {
            Outcome::Pass {}
        }
    }

    impl<E: DafnyType> AsRef<Outcome<E>>
        for Outcome<E> {
        fn as_ref(&self) -> &Self {
            self
        }
    }
}